diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2012-03-21 19:34:08 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 20:54:58 -0400 |
commit | 1010bb1b80edb0713415dfe1f97114d320f58c4f (patch) | |
tree | 70aeaba13b61aa442e0c48c99a1035e204910982 /mm/filemap.c | |
parent | a05b0855fd15504972dba2358e5faa172a1e50ba (diff) |
mm: don't set __GFP_WRITE on ramfs/sysfs writes
There is not much point in skipping zones during allocation based on the
dirty usage which they'll never contribute to. And we'd like to avoid
page reclaim waits when writing to ramfs/sysfs etc.
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Greg Thelen <gthelen@google.com>
Cc: Ying Han <yinghan@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Acked-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r-- | mm/filemap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 2f8165075a5a..e8cf8aefd6f6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2341,7 +2341,9 @@ struct page *grab_cache_page_write_begin(struct address_space *mapping, | |||
2341 | struct page *page; | 2341 | struct page *page; |
2342 | gfp_t gfp_notmask = 0; | 2342 | gfp_t gfp_notmask = 0; |
2343 | 2343 | ||
2344 | gfp_mask = mapping_gfp_mask(mapping) | __GFP_WRITE; | 2344 | gfp_mask = mapping_gfp_mask(mapping); |
2345 | if (mapping_cap_account_dirty(mapping)) | ||
2346 | gfp_mask |= __GFP_WRITE; | ||
2345 | if (flags & AOP_FLAG_NOFS) | 2347 | if (flags & AOP_FLAG_NOFS) |
2346 | gfp_notmask = __GFP_FS; | 2348 | gfp_notmask = __GFP_FS; |
2347 | repeat: | 2349 | repeat: |