[PATCH 8/9] mm: dont set __GFP_WRITE on ramfs/sysfs writes

From: Fengguang Wu
Date: Tue Feb 28 2012 - 09:58:45 EST


Try to avoid page reclaim waits when writing to ramfs/sysfs etc.

Maybe not a big deal...

CC: Johannes Weiner <jweiner@xxxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---
mm/filemap.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- linux.orig/mm/filemap.c 2012-02-28 10:24:12.000000000 +0800
+++ linux/mm/filemap.c 2012-02-28 10:25:55.568321275 +0800
@@ -2340,9 +2340,13 @@ struct page *grab_cache_page_write_begin
int status;
gfp_t gfp_mask;
struct page *page;
- gfp_t lru_gfp_mask = GFP_KERNEL | __GFP_WRITE;
+ gfp_t lru_gfp_mask = GFP_KERNEL;

- gfp_mask = mapping_gfp_mask(mapping) | __GFP_WRITE;
+ gfp_mask = mapping_gfp_mask(mapping);
+ if (mapping_cap_account_dirty(mapping)) {
+ gfp_mask |= __GFP_WRITE;
+ lru_gfp_mask |= __GFP_WRITE;
+ }
if (flags & AOP_FLAG_NOFS) {
gfp_mask &= ~__GFP_FS;
lru_gfp_mask &= ~__GFP_FS;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/