From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: [patch 4/5] mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin() Date: Fri, 30 Sep 2011 09:17:23 +0200 Message-ID: <1317367044-475-5-git-send-email-jweiner@redhat.com> References: <1317367044-475-1-git-send-email-jweiner@redhat.com> Cc: Mel Gorman , Christoph Hellwig , Dave Chinner , Wu Fengguang , Jan Kara , Rik van Riel , Minchan Kim , Chris Mason , "Theodore Ts'o" , Andreas Dilger , Shaohua Li , xfs@oss.sgi.com, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Andrew Morton Return-path: In-Reply-To: <1317367044-475-1-git-send-email-jweiner@redhat.com> List-ID: Tell the page allocator that pages allocated through grab_cache_page_write_begin() are expected to become dirty soon. Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Mel Gorman Reviewed-by: Minchan Kim --- 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 -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755770Ab1I3HSu (ORCPT ); Fri, 30 Sep 2011 03:18:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071Ab1I3HSq (ORCPT ); Fri, 30 Sep 2011 03:18:46 -0400 From: Johannes Weiner To: Andrew Morton Cc: Mel Gorman , Christoph Hellwig , Dave Chinner , Wu Fengguang , Jan Kara , Rik van Riel , Minchan Kim , Chris Mason , "Theodore Ts'o" , Andreas Dilger , Shaohua Li , xfs@oss.sgi.com, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [patch 4/5] mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin() Date: Fri, 30 Sep 2011 09:17:23 +0200 Message-Id: <1317367044-475-5-git-send-email-jweiner@redhat.com> In-Reply-To: <1317367044-475-1-git-send-email-jweiner@redhat.com> References: <1317367044-475-1-git-send-email-jweiner@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tell the page allocator that pages allocated through grab_cache_page_write_begin() are expected to become dirty soon. Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Mel Gorman Reviewed-by: Minchan Kim --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id p8U7INCq246234 for ; Fri, 30 Sep 2011 02:18:23 -0500 Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C1D0319D336 for ; Fri, 30 Sep 2011 00:18:22 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id RYLSqr3QhRqufDKw for ; Fri, 30 Sep 2011 00:18:22 -0700 (PDT) From: Johannes Weiner Subject: [patch 4/5] mm: filemap: pass __GFP_WRITE from grab_cache_page_write_begin() Date: Fri, 30 Sep 2011 09:17:23 +0200 Message-Id: <1317367044-475-5-git-send-email-jweiner@redhat.com> In-Reply-To: <1317367044-475-1-git-send-email-jweiner@redhat.com> References: <1317367044-475-1-git-send-email-jweiner@redhat.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Andrew Morton Cc: Rik van Riel , linux-ext4@vger.kernel.org, Jan Kara , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, Christoph Hellwig , linux-mm@kvack.org, Andreas Dilger , Mel Gorman , Shaohua Li , linux-fsdevel@vger.kernel.org, Theodore Ts'o , Wu Fengguang , Chris Mason , Minchan Kim Tell the page allocator that pages allocated through grab_cache_page_write_begin() are expected to become dirty soon. Signed-off-by: Johannes Weiner Reviewed-by: Rik van Riel Acked-by: Mel Gorman Reviewed-by: Minchan Kim --- 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 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs