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, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>