From: Mel Gorman <mel@csn.ul.ie>
To: Hugh Dickins <hugh@veritas.com>
Cc: Linus Torvalds <torvalds@osdl.org>, Mel Gorman <mel@skynet.ie>,
Christoph Lameter <clameter@sgi.com>,
linux-mm@kvack.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/11] Add __GFP_MOVABLE flag and update callers
Date: Mon, 27 Nov 2006 16:32:20 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0611271628260.18063@skynet.skynet.ie> (raw)
In-Reply-To: <Pine.LNX.4.64.0611260039070.27769@blonde.wat.veritas.com>
On Sun, 26 Nov 2006, Hugh Dickins wrote:
> On Sat, 25 Nov 2006, Linus Torvalds wrote:
>> On Fri, 24 Nov 2006, Hugh Dickins wrote:
>>>
>>> You need to add in something like the patch below (mutatis mutandis
>>> for whichever approach you end up taking): tmpfs uses highmem pages
>>> for its swap vector blocks, noting where on swap the data pages are,
>>> and allocates them with mapping_gfp_mask(inode->i_mapping); but we
>>> don't have any mechanism in place for reclaiming or migrating those.
>>
>> I think this really just points out that you should _not_ put MOVABLE into
>> the "mapping_gfp_mask()" at all.
>>
>> The mapping_gfp_mask() should really just contain the "constraints" on
>> the allocation, not the "how the allocation is used". So things like "I
>> need all my pages to be in the 32bit DMA'able region" is a constraint on
>> the allocator, as is something like "I need the allocation to be atomic".
>>
>> But MOVABLE is really not a constraint on the allocator, it's a guarantee
>> by the code _calling_ the allocator that it will then make sure that it
>> _uses_ the allocation in a way that means that it is movable.
>>
Later, MOVABLE might be a constraint. For example, hotpluggable nodes may
only allow MOVABLE allocations to be allocated.
>> So it shouldn't be a property of the mapping itself, it should always be a
>> property of the code that actually does the allocation.
>>
>> Hmm?
>
> Not anything I feel strongly about, but I don't see it that way.
>
> mapping_gfp_mask() seems to me nothing more than a pragmatic way
> of getting the appropriate gfp_mask down to page_cache_alloc().
>
And that is important for any filesystem that uses generic_file_read(). As
page_cache_alloc() has no knowledge of the filesystem, it depends on the
mapping_gfp_mask() to determine if the pages are movable or not.
> alloc_inode() initializes it to whatever suits most filesystems
> (currently GFP_HIGHUSER), and those who differ adjust it (e.g.
> block_dev has good reason to avoid highmem so sets it to GFP_USER
> instead). It used to be the case that several filesystems lacked
> kmap() where needed, and those too would set GFP_USER: what you call
> a constraint seems to me equally a property of the surrounding code.
>
> If __GFP_MOVABLE is coming in, and most fs's are indeed allocating
> movable pages, then I don't see why MOVABLE shouldn't be in the
> mapping_gfp_mask. Specifying MOVABLE constrains both the caller's
> use of the pages, and the way they are allocated; as does HIGHMEM.
>
>From what I've seen, the majority of filesystems are suitable for using
__GFP_MOVABLE and it would be clearer to have GFP_HIGH_MOVABLE as the
default and setting GFP_HIGHUSER in filesystems like ramfs.
> And we shouldn't be guided by the way tmpfs (ab?)uses that gfp_mask
> for its metadata allocations as well as its page_cache_alloc()s:
> that's just a special case. Though the ramfs case is more telling
> (its pagecache pages being not at present movable).
>
> Hugh
>
--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-11-27 16:32 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 22:50 [PATCH 0/11] Avoiding fragmentation with page clustering v27 Mel Gorman
2006-11-21 22:50 ` [PATCH 1/11] Add __GFP_MOVABLE flag and update callers Mel Gorman
2006-11-21 23:30 ` Christoph Lameter
2006-11-21 23:43 ` Mel Gorman
2006-11-21 23:51 ` Dave Hansen
2006-11-22 0:44 ` Linus Torvalds
2006-11-23 16:36 ` Mel Gorman
2006-11-23 17:11 ` Linus Torvalds
2006-11-24 10:44 ` Mel Gorman
2006-11-24 19:57 ` Hugh Dickins
2006-11-24 20:13 ` Mel Gorman
2006-11-24 21:06 ` Hugh Dickins
2006-11-25 11:47 ` Mel Gorman
2006-11-25 19:01 ` Linus Torvalds
2006-11-26 0:44 ` Hugh Dickins
2006-11-27 16:32 ` Mel Gorman [this message]
2006-11-27 17:28 ` Christoph Lameter
2006-11-27 19:48 ` Add __GFP_MOVABLE for callers to flag allocations that may be migrated Mel Gorman
2006-11-24 17:59 ` [PATCH 1/11] Add __GFP_MOVABLE flag and update callers Christoph Lameter
2006-11-24 18:11 ` Linus Torvalds
2006-11-24 20:04 ` Mel Gorman
2006-11-22 2:25 ` Christoph Lameter
2006-11-23 15:00 ` Mel Gorman
2006-11-21 22:51 ` [PATCH 2/11] Split the free lists for movable and unmovable allocations Mel Gorman
2006-11-21 22:51 ` [PATCH 3/11] Choose pages from the per-cpu list based on migration type Mel Gorman
2006-11-21 22:51 ` [PATCH 4/11] Add a configure option for page clustering Mel Gorman
2006-11-21 22:52 ` [PATCH 5/11] Drain per-cpu lists when high-order allocations fail Mel Gorman
2006-11-21 22:52 ` [PATCH 6/11] Move free pages between lists on steal Mel Gorman
2006-11-21 22:52 ` [PATCH 7/11] Mark short-lived and reclaimable kernel allocations Mel Gorman
2006-11-21 22:53 ` [PATCH 8/11] [DEBUG] Add statistics Mel Gorman
2006-11-21 22:53 ` [PATCH 9/11] Add a bitmap that is used to track flags affecting a block of pages Mel Gorman
2006-11-21 22:53 ` [PATCH 10/11] Remove dependency on page->flag bits Mel Gorman
2006-11-21 22:54 ` [PATCH 11/11] Use pageblock flags for page clustering Mel Gorman
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=Pine.LNX.4.64.0611271628260.18063@skynet.skynet.ie \
--to=mel@csn.ul.ie \
--cc=clameter@sgi.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
--cc=torvalds@osdl.org \
/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