From: Paul Menage <menage@google.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Christoph Lameter <cl@linux-foundation.org>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Matt Mackall <mpm@selenic.com>,
Randy Dunlap <randy.dunlap@oracle.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch -mm] cpusets: add memory_slab_hardwall flag
Date: Mon, 9 Mar 2009 00:08:26 -0700 [thread overview]
Message-ID: <6599ad830903090008u4418e7efie137c87c6ac42e55@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.0903081438180.30551@chino.kir.corp.google.com>
Another thought - it would probably be better to call this flag
kernel_mem_hardwall or mem_hardwall_kernel, to avoid hard-coding its
name to be slab-specific.
Paul
On Sun, Mar 8, 2009 at 2:38 PM, David Rientjes <rientjes@google.com> wrote:
> On Sun, 8 Mar 2009, Paul Menage wrote:
>
>> > +/**
>> > + * current_cpuset_object_allowed - can a slab object be allocated on a node?
>> > + * @node: the node for object allocation
>> > + * @flags: allocation flags
>> > + *
>> > + * Return non-zero if object is allowed, zero otherwise.
>> > + */
>> > +int current_cpuset_object_allowed(int node, gfp_t flags)
>> > +{
>> > + return !is_slab_hardwall(task_cs(current)) ||
>> > + cpuset_node_allowed_hardwall(node, flags);
>> > +}
>> > +
>>
>> This should be in rcu_read_lock()/rcu_read_unlock() in order to safely
>> dereference the result of task_cs(current)
>>
>
> I've folded the following into the patch, thanks Paul.
> ---
> kernel/cpuset.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -1205,8 +1205,12 @@ int current_cpuset_is_being_rebound(void)
> */
> int current_cpuset_object_allowed(int node, gfp_t flags)
> {
> - return !is_slab_hardwall(task_cs(current)) ||
> - cpuset_node_allowed_hardwall(node, flags);
> + int is_hardwall;
> +
> + rcu_read_lock();
> + is_hardwall = is_slab_hardwall(task_cs(current));
> + rcu_read_unlock();
> + return !is_hardwall || cpuset_node_allowed_hardwall(node, flags);
> }
>
> static int update_relax_domain_level(struct cpuset *cs, s64 val)
next prev parent reply other threads:[~2009-03-09 7:08 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-08 16:27 David Rientjes
2009-03-08 16:53 ` Paul Menage
2009-03-08 21:38 ` David Rientjes
2009-03-09 7:08 ` Paul Menage [this message]
2009-03-09 9:18 ` David Rientjes
2009-03-08 17:01 ` Matt Mackall
2009-03-08 21:51 ` David Rientjes
2009-03-09 4:49 ` KOSAKI Motohiro
2009-03-09 9:12 ` David Rientjes
2009-03-09 10:19 ` KOSAKI Motohiro
2009-03-09 20:26 ` David Rientjes
2009-03-09 21:14 ` Christoph Lameter
2009-03-09 21:31 ` David Rientjes
2009-03-10 20:50 ` Christoph Lameter
2009-03-10 21:08 ` Matt Mackall
2009-03-12 16:08 ` Christoph Lameter
2009-03-12 17:23 ` Matt Mackall
2009-03-10 22:12 ` Paul Menage
2009-03-12 15:51 ` Christoph Lameter
2009-03-09 18:50 ` Christoph Lameter
2009-03-09 20:13 ` David Rientjes
2009-03-10 1:35 ` KOSAKI Motohiro
2009-03-10 2:01 ` David Rientjes
2009-03-10 4:05 ` Matt Mackall
2009-03-10 4:26 ` David Rientjes
2009-03-12 1:03 ` Paul E. McKenney
2009-03-12 5:51 ` David Rientjes
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=6599ad830903090008u4418e7efie137c87c6ac42e55@mail.gmail.com \
--to=menage@google.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
--cc=randy.dunlap@oracle.com \
--cc=rientjes@google.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
all inboxes | Powered by JetHome®