Re: Pagecache: find_or_create_page does not call a proper pageallocator function

From: Hugh Dickins
Date: Tue Apr 24 2007 - 14:54:27 EST


On Tue, 24 Apr 2007, Christoph Lameter wrote:
> On Tue, 24 Apr 2007, Hugh Dickins wrote:
>
> > I've not yet looked at the patch under discussion, but this remark
> > prompts me... a couple of days ago I got very worried by the various
> > hard-wired GFP_HIGHUSER allocations in mm/migrate.c and mm/mempolicy.c,
> > and wondered how those would work out if someone has a blockdev mmap'ed.
>
> I hope you are not confused by the fact that memory policies are only
> ever applied to one zone on a node. This is either HIGHMEM or NORMAL.
> There is no memory policy support for other than the highest zone.

I was certainly ignorant of that; but I'm not convinced it eliminates
the potential issue. For a start, sys_move_pages seems not to involve
mempolicies at all - I don't see what prevents it migrating blockdev
pages away from the only node which has NORMAL memory.

> Metadata is not movable nor subject to memory policies.
> It will never be mapped into a process space.

Not as metadata, no. But someone (let's hope only root, though I may
be wrong on that) can map any part of the block device into userspace.

> > yup. wherever we dereference buffer_head.b_data we're touching
> > page_address(buffer_head.b_page) without kmapping.
>
> Yes but before we get there we will bounce pagecache pages into an area
> where we do not need kmap.

Again, I'm not convinced: bouncing gets done for the I/O,
but where is it done to meet the filesystem's expectations?

On the other hand, as I said, I've seen no problem myself in practice.
However, if there is no problem, why do block devices demand GFP_USER?

Hugh
-
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/