| To: | Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> |
|---|---|
| Subject: | [patch 4/5] mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin() |
| From: | Johannes Weiner <jweiner@xxxxxxxxxx> |
| Date: | Fri, 30 Sep 2011 09:17:23 +0200 |
| Cc: | Mel Gorman <mgorman@xxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, Wu Fengguang <fengguang.wu@xxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Rik van Riel <riel@xxxxxxxxxx>, Minchan Kim <minchan.kim@xxxxxxxxx>, Chris Mason <chris.mason@xxxxxxxxxx>, "Theodore Ts'o" <tytso@xxxxxxx>, Andreas Dilger <adilger.kernel@xxxxxxxxx>, Shaohua Li <shaohua.li@xxxxxxxxx>, xfs@xxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx |
| In-reply-to: | <1317367044-475-1-git-send-email-jweiner@xxxxxxxxxx> |
| References: | <1317367044-475-1-git-send-email-jweiner@xxxxxxxxxx> |
Tell the page allocator that pages allocated through
grab_cache_page_write_begin() are expected to become dirty soon.
Signed-off-by: Johannes Weiner <jweiner@xxxxxxxxxx>
Reviewed-by: Rik van Riel <riel@xxxxxxxxxx>
Acked-by: Mel Gorman <mgorman@xxxxxxx>
Reviewed-by: Minchan Kim <minchan.kim@xxxxxxxxx>
---
mm/filemap.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 645a080..cf0352d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2349,8 +2349,11 @@ struct page *grab_cache_page_write_begin(struct
address_space *mapping,
pgoff_t index, unsigned flags)
{
int status;
+ gfp_t gfp_mask;
struct page *page;
gfp_t gfp_notmask = 0;
+
+ gfp_mask = mapping_gfp_mask(mapping) | __GFP_WRITE;
if (flags & AOP_FLAG_NOFS)
gfp_notmask = __GFP_FS;
repeat:
@@ -2358,7 +2361,7 @@ repeat:
if (page)
goto found;
- page = __page_cache_alloc(mapping_gfp_mask(mapping) & ~gfp_notmask);
+ page = __page_cache_alloc(gfp_mask & ~gfp_notmask);
if (!page)
return NULL;
status = add_to_page_cache_lru(page, mapping, index,
--
1.7.6.2
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [patch 5/5] Btrfs: pass __GFP_WRITE for buffered write page allocations, Johannes Weiner |
|---|---|
| Next by Date: | Re: [patch 3/5] mm: try to distribute dirty pages fairly across zones, Pekka Enberg |
| Previous by Thread: | [patch 5/5] Btrfs: pass __GFP_WRITE for buffered write page allocations, Johannes Weiner |
| Next by Thread: | Re: [patch 4/5] mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin(), Michal Hocko |
| Indexes: | [Date] [Thread] [Top] [All Lists] |