From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Nick Piggin <npiggin@suse.de>,
linux-kernel@vger.kernel.org, pj@sgi.com,
Hugh Dickins <hugh@veritas.com>
Subject: Re: Pagecache: find_or_create_page does not call a proper page allocator function
Date: Mon, 23 Apr 2007 15:42:24 -0700 [thread overview]
Message-ID: <20070423154224.15ebf8f7.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0704231503540.975@schroedinger.engr.sgi.com>
On Mon, 23 Apr 2007 15:33:07 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:
> Grow dev page simply passes GFP_NOFS to find_or_create_page. This means the
> allocation of radix tree nodes is done with GFP_NOFS and the allocation
> of a new page is done using GFP_NOFS as well.
>
> The mapping has a flags field that contains the necessary allocation flags for
> the page cache allocation. These need to be consulted in order to get DMA
> and HIGHMEM allocations etc right.
>
> So fix grow_dev_page to do the same as __page_symlink calls. Retrieve the
> mask from the mapping and then remove __GFP_FS.
>
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
>
> ---
> fs/buffer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: linux-2.6.21-rc7/fs/buffer.c
> ===================================================================
> --- linux-2.6.21-rc7.orig/fs/buffer.c 2007-04-23 15:29:18.000000000 -0700
> +++ linux-2.6.21-rc7/fs/buffer.c 2007-04-23 15:29:43.000000000 -0700
> @@ -988,7 +988,8 @@ grow_dev_page(struct block_device *bdev,
> struct page *page;
> struct buffer_head *bh;
>
> - page = find_or_create_page(inode->i_mapping, index, GFP_NOFS);
> + page = find_or_create_page(inode->i_mapping, index,
> + mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS);
> if (!page)
> return NULL;
OK. I hope. the mapping_gfp_mask() here will have come from bdget()'s
mapping_set_gfp_mask(&inode->i_data, GFP_USER); If anyone is accidentally
setting __GFP_HIGHMEM on a blockdev address_space we'll cause ghastly
explosions. Albeit ones which were well-deserved.
We'll see how it goes.
next prev parent reply other threads:[~2007-04-23 22:43 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-23 21:11 Pagecache: find_or_create_page does not call a proper page allocator function Christoph Lameter
2007-04-23 21:29 ` Andrew Morton
2007-04-23 21:37 ` Christoph Lameter
2007-04-23 22:33 ` Christoph Lameter
2007-04-23 22:42 ` Christoph Lameter
2007-04-23 22:42 ` Andrew Morton [this message]
2007-04-24 13:09 ` Hugh Dickins
2007-04-24 17:11 ` Andrew Morton
2007-04-24 19:06 ` Hugh Dickins
2007-04-24 19:55 ` Christoph Lameter
2007-04-24 20:16 ` Hugh Dickins
2007-04-24 20:30 ` Christoph Lameter
2007-04-24 20:42 ` Andrew Morton
2007-04-24 20:44 ` Christoph Lameter
2007-04-24 20:53 ` Andrew Morton
2007-04-24 20:58 ` Christoph Lameter
2007-04-24 21:24 ` Andrew Morton
2007-04-24 21:28 ` Christoph Lameter
2007-04-24 17:38 ` Christoph Lameter
2007-04-24 17:45 ` Hugh Dickins
2007-04-24 17:48 ` Christoph Lameter
2007-04-24 17:51 ` Andrew Morton
2007-04-24 17:56 ` Christoph Lameter
2007-04-24 17:45 ` Christoph Lameter
2007-04-24 18:53 ` Hugh Dickins
2007-04-24 19:34 ` Christoph Lameter
2007-04-24 19:49 ` Andrew Morton
2007-04-24 19:59 ` Christoph Lameter
2007-04-24 20:10 ` Andrew Morton
2007-04-24 20:12 ` Christoph Lameter
2007-04-24 20:20 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070423154224.15ebf8f7.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=pj@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox