From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org
Subject: Re: A solution for more GFP_xx flags?
Date: Tue, 12 Sep 2006 12:44:38 +1000 [thread overview]
Message-ID: <45061F16.202@yahoo.com.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0609111920590.7815@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
>I wonder if we could pass a pointer to an allocation structure
>to the allocators instead of an unsigned long?
>
>Right now the problem is that we need _node allocators to specify nodes
>and the memory policies and cpusets are determined by the allocation
>context of a process. This makes the allocators difficult to handle.
>
>We could define a structure
>
>struct allocation_control {
> unsigned long flags; /* Traditional flags */
> int node;
> struct cpuset_context *cpuset;
> struct mempol *mpol;
>};
>
>We could define struct constants called GFP_KERNEL and GFP_ATOMIC.
>const struct allocation_control gfp_kernel {
> GFP_KERNEL, -1, NULL, NULL
>}
>
>And then do
>
>alloc_pages(n, gfp_kernel)
>
>?
>
>This would also solve the problem of allocations that do not occur in a
>proper process context. F.e. slab allocations are on behalf of the slab
>allocator and not on behalf of a process. Thus the cpuset and the memory
>policies should not influence that allocation. In that case we could have
>a special allocation_control structure for that context.
>
>It would also get rid off all the xxx_node allocator variations.
>
This seems like a decent approach to make a nice general interface. I guess
existing APIs can be easily implemented by filling in the structure. If you
took this approach I don't think there should be any objections.
A minor point: would we prefer a struct argument to the allocator, or more
function arguments? It is an API that we need to get right...
---
Send instant messages to your online friends http://au.messenger.yahoo.com
--
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-09-12 2:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 2:28 Christoph Lameter
2006-09-12 2:44 ` Nick Piggin [this message]
2006-09-12 3:01 ` Christoph Lameter
2006-09-12 3:05 ` Peter Chubb
2006-09-12 3:07 ` Christoph Lameter
2006-09-12 3:11 ` Peter Chubb
2006-09-12 5:32 ` Christoph Lameter
2006-09-12 6:16 ` Paul Jackson
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=45061F16.202@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.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