From: Mel Gorman <mel@csn.ul.ie> To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: Dave Chinner <david@fromorbit.com>, Chris Mason <chris.mason@oracle.com>, Nick Piggin <npiggin@suse.de>, Rik van Riel <riel@redhat.com>, Johannes Weiner <hannes@cmpxchg.org>, Christoph Hellwig <hch@infradead.org>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>, Andrew Morton <akpm@linux-foundation.org>, Andrea Arcangeli <aarcange@redhat.com>, Mel Gorman <mel@csn.ul.ie> Subject: [PATCH 13/14] fs,btrfs: Allow kswapd to writeback pages Date: Tue, 29 Jun 2010 12:34:47 +0100 [thread overview] Message-ID: <1277811288-5195-14-git-send-email-mel@csn.ul.ie> (raw) In-Reply-To: <1277811288-5195-1-git-send-email-mel@csn.ul.ie> As only kswapd and memcg are writing back pages, there should be no danger of overflowing the stack. Allow the writing back of dirty pages in btrfs from the VM. Signed-off-by: Mel Gorman <mel@csn.ul.ie> --- fs/btrfs/disk-io.c | 21 +-------------------- 1 files changed, 1 insertions(+), 20 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 34f7c37..e4aa547 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -696,26 +696,7 @@ static int btree_writepage(struct page *page, struct writeback_control *wbc) int was_dirty; tree = &BTRFS_I(page->mapping->host)->io_tree; - if (!(current->flags & PF_MEMALLOC)) { - return extent_write_full_page(tree, page, - btree_get_extent, wbc); - } - - redirty_page_for_writepage(wbc, page); - eb = btrfs_find_tree_block(root, page_offset(page), - PAGE_CACHE_SIZE); - WARN_ON(!eb); - - was_dirty = test_and_set_bit(EXTENT_BUFFER_DIRTY, &eb->bflags); - if (!was_dirty) { - spin_lock(&root->fs_info->delalloc_lock); - root->fs_info->dirty_metadata_bytes += PAGE_CACHE_SIZE; - spin_unlock(&root->fs_info->delalloc_lock); - } - free_extent_buffer(eb); - - unlock_page(page); - return 0; + return extent_write_full_page(tree, page, btree_get_extent, wbc); } static int btree_writepages(struct address_space *mapping, -- 1.7.1
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mel@csn.ul.ie> To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: Dave Chinner <david@fromorbit.com>, Chris Mason <chris.mason@oracle.com>, Nick Piggin <npiggin@suse.de>, Rik van Riel <riel@redhat.com>, Johannes Weiner <hannes@cmpxchg.org>, Christoph Hellwig <hch@infradead.org>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>, KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>, Andrew Morton <akpm@linux-foundation.org>, Andrea Arcangeli <aarcange@redhat.com>, Mel Gorman <mel@csn.ul.ie> Subject: [PATCH 13/14] fs,btrfs: Allow kswapd to writeback pages Date: Tue, 29 Jun 2010 12:34:47 +0100 [thread overview] Message-ID: <1277811288-5195-14-git-send-email-mel@csn.ul.ie> (raw) In-Reply-To: <1277811288-5195-1-git-send-email-mel@csn.ul.ie> As only kswapd and memcg are writing back pages, there should be no danger of overflowing the stack. Allow the writing back of dirty pages in btrfs from the VM. Signed-off-by: Mel Gorman <mel@csn.ul.ie> --- fs/btrfs/disk-io.c | 21 +-------------------- 1 files changed, 1 insertions(+), 20 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 34f7c37..e4aa547 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -696,26 +696,7 @@ static int btree_writepage(struct page *page, struct writeback_control *wbc) int was_dirty; tree = &BTRFS_I(page->mapping->host)->io_tree; - if (!(current->flags & PF_MEMALLOC)) { - return extent_write_full_page(tree, page, - btree_get_extent, wbc); - } - - redirty_page_for_writepage(wbc, page); - eb = btrfs_find_tree_block(root, page_offset(page), - PAGE_CACHE_SIZE); - WARN_ON(!eb); - - was_dirty = test_and_set_bit(EXTENT_BUFFER_DIRTY, &eb->bflags); - if (!was_dirty) { - spin_lock(&root->fs_info->delalloc_lock); - root->fs_info->dirty_metadata_bytes += PAGE_CACHE_SIZE; - spin_unlock(&root->fs_info->delalloc_lock); - } - free_extent_buffer(eb); - - unlock_page(page); - return 0; + return extent_write_full_page(tree, page, btree_get_extent, wbc); } static int btree_writepages(struct address_space *mapping, -- 1.7.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-06-29 11:35 UTC|newest] Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-06-29 11:34 [PATCH 0/14] Avoid overflowing of stack during page reclaim V3 Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 01/14] vmscan: Fix mapping use after free Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 14:27 ` Minchan Kim 2010-06-29 14:27 ` Minchan Kim 2010-07-01 9:53 ` Mel Gorman 2010-07-01 9:53 ` Mel Gorman 2010-06-29 14:44 ` Johannes Weiner 2010-06-29 14:44 ` Johannes Weiner 2010-06-29 11:34 ` [PATCH 02/14] tracing, vmscan: Add trace events for kswapd wakeup, sleeping and direct reclaim Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 03/14] tracing, vmscan: Add trace events for LRU page isolation Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 04/14] tracing, vmscan: Add trace event when a page is written Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 05/14] tracing, vmscan: Add a postprocessing script for reclaim-related ftrace events Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 06/14] vmscan: kill prev_priority completely Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 07/14] vmscan: simplify shrink_inactive_list() Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 08/14] vmscan: Remove unnecessary temporary vars in do_try_to_free_pages Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 09/14] vmscan: Setup pagevec as late as possible in shrink_inactive_list() Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 10/14] vmscan: Setup pagevec as late as possible in shrink_page_list() Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 11/14] vmscan: Update isolated page counters outside of main path in shrink_inactive_list() Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 12/14] vmscan: Do not writeback pages in direct reclaim Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-07-02 19:51 ` Andrew Morton 2010-07-02 19:51 ` Andrew Morton 2010-07-05 13:49 ` Mel Gorman 2010-07-05 13:49 ` Mel Gorman 2010-07-06 0:36 ` KOSAKI Motohiro 2010-07-06 0:36 ` KOSAKI Motohiro 2010-07-06 5:46 ` Minchan Kim 2010-07-06 5:46 ` Minchan Kim 2010-07-06 6:02 ` KOSAKI Motohiro 2010-07-06 6:02 ` KOSAKI Motohiro 2010-07-06 6:38 ` Minchan Kim 2010-07-06 6:38 ` Minchan Kim 2010-07-06 10:12 ` Mel Gorman 2010-07-06 10:12 ` Mel Gorman 2010-07-06 11:13 ` KOSAKI Motohiro 2010-07-06 11:13 ` KOSAKI Motohiro 2010-07-06 11:24 ` Minchan Kim 2010-07-06 11:24 ` Minchan Kim 2010-07-06 15:25 ` Mel Gorman 2010-07-06 15:25 ` Mel Gorman 2010-07-06 15:25 ` Mel Gorman 2010-07-06 20:27 ` Johannes Weiner 2010-07-06 20:27 ` Johannes Weiner 2010-07-06 22:28 ` Minchan Kim 2010-07-06 22:28 ` Minchan Kim 2010-07-07 0:24 ` Mel Gorman 2010-07-07 0:24 ` Mel Gorman 2010-07-07 0:24 ` Mel Gorman 2010-07-07 1:15 ` Christoph Hellwig 2010-07-07 1:15 ` Christoph Hellwig 2010-07-07 9:43 ` Mel Gorman 2010-07-07 9:43 ` Mel Gorman 2010-07-07 12:51 ` Rik van Riel 2010-07-07 12:51 ` Rik van Riel 2010-07-07 1:14 ` Christoph Hellwig 2010-07-07 1:14 ` Christoph Hellwig 2010-07-08 6:39 ` KOSAKI Motohiro 2010-07-08 6:39 ` KOSAKI Motohiro 2010-07-07 5:03 ` Wu Fengguang 2010-07-07 5:03 ` Wu Fengguang 2010-07-07 9:50 ` Mel Gorman 2010-07-07 9:50 ` Mel Gorman 2010-07-07 18:09 ` Christoph Hellwig 2010-07-07 18:09 ` Christoph Hellwig 2010-06-29 11:34 ` Mel Gorman [this message] 2010-06-29 11:34 ` [PATCH 13/14] fs,btrfs: Allow kswapd to writeback pages Mel Gorman 2010-06-30 13:05 ` Chris Mason 2010-06-30 13:05 ` Chris Mason 2010-07-01 9:55 ` Mel Gorman 2010-07-01 9:55 ` Mel Gorman 2010-07-01 9:55 ` Mel Gorman 2010-06-29 11:34 ` [PATCH 14/14] fs,xfs: " Mel Gorman 2010-06-29 11:34 ` Mel Gorman 2010-06-29 12:37 ` Christoph Hellwig 2010-06-29 12:37 ` Christoph Hellwig 2010-06-29 12:51 ` Mel Gorman 2010-06-29 12:51 ` Mel Gorman 2010-06-30 0:14 ` KAMEZAWA Hiroyuki 2010-06-30 0:14 ` KAMEZAWA Hiroyuki 2010-07-01 10:30 ` Mel Gorman 2010-07-01 10:30 ` Mel Gorman 2010-07-02 6:26 ` KAMEZAWA Hiroyuki 2010-07-02 6:26 ` KAMEZAWA Hiroyuki 2010-07-02 6:31 ` KAMEZAWA Hiroyuki 2010-07-02 6:31 ` KAMEZAWA Hiroyuki 2010-07-05 14:16 ` Mel Gorman 2010-07-05 14:16 ` Mel Gorman 2010-07-06 0:45 ` KAMEZAWA Hiroyuki 2010-07-06 0:45 ` KAMEZAWA Hiroyuki 2010-07-02 19:33 ` [PATCH 0/14] Avoid overflowing of stack during page reclaim V3 Andrew Morton 2010-07-02 19:33 ` Andrew Morton 2010-07-05 1:35 ` KAMEZAWA Hiroyuki 2010-07-05 1:35 ` KAMEZAWA Hiroyuki
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1277811288-5195-14-git-send-email-mel@csn.ul.ie \ --to=mel@csn.ul.ie \ --cc=aarcange@redhat.com \ --cc=akpm@linux-foundation.org \ --cc=chris.mason@oracle.com \ --cc=david@fromorbit.com \ --cc=hannes@cmpxchg.org \ --cc=hch@infradead.org \ --cc=kamezawa.hiroyu@jp.fujitsu.com \ --cc=kosaki.motohiro@jp.fujitsu.com \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=npiggin@suse.de \ --cc=riel@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.