linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>, Eric Whitney <eric.whitney@hp.com>
Subject: Re: [PATCH] Use MPOL_PREFERRED for system default policy
Date: Thu, 16 Aug 2007 14:10:36 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708161407590.18404@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1187298350.5900.59.camel@localhost>

On Thu, 16 Aug 2007, Lee Schermerhorn wrote:

> > But the comparison with an MPOL_PREFERRED policy is different from
> > comparing with a MPOL_DEFAULT policy. MPOL_DEFAULT matches any other
> > policy. MPOL_PREFERRED only matches other MPOL_DEFERRED policies.
> 
> MPOL_DEFAULT doesn't match anything but itself.  Everywhere but in the
> system default policy, specifying MPOL_DEFAULT means "delete the current
> policy [task or vma] and replace it with a null pointer.  Again, the
> only place that MPOL_DEFAULT actually occurs in a struct mempolicy is in
> the system default policy.  By changing that, I can eliminate the
> MPOL_DEFAULT checks in the run time [allocation path] use of mempolicy.

Look at mpol_equal(). If the policy to compare it MPOL_DEFAULT then it 
returns true. If its MPOL_PREFERRED then it requires a matching on the 
node. Wont your change break this?

> > Safety features? Are these triggered? Could we leave the BUG() in?
> 
> I haven't seen them triggered.  I'm hoping that testing in -mm will not
> hit them either.  I suppose we could leave the BUG.  Seems a bit drastic
> for this case, where we have a reasonable fallback.  But, the BUG will
> more likely get someone's attention, I suppose :-).

So you have never seen warnings in testing and there should not be any? 
Then leave the BUG() in. WARN is useful if there is something that another
developer could fix.

> > > @@ -1376,7 +1378,8 @@ void __mpol_free(struct mempolicy *p)
> > >  		return;
> > >  	if (p->policy == MPOL_BIND)
> > >  		kfree(p->v.zonelist);
> > > -	p->policy = MPOL_DEFAULT;
> > > +	p->policy = MPOL_PREFERRED;
> > > +	p->v.preferred_node = -1;
> > 
> > Why are we initializing values here in an object that is then freed?
> 
> I wondered that myself.  I think Andi was stuffing MPOL_DEFAULT "just in
> case" or to NULL out the policy member.  I just replaced it so that I
> was sure that MPOL_DEFAULT never occurs in a struct mempolicy.  We
> always initialize the policy member when we alloc one, so I guess we can
> drop the reinit here.

I'd say remove the useless assignements. They are confusing.

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

  reply	other threads:[~2007-08-16 21:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-14 19:44 Lee Schermerhorn
2007-08-14 19:51 ` Christoph Lameter
2007-08-14 20:09   ` Lee Schermerhorn
2007-08-14 20:22     ` Lee Schermerhorn
2007-08-16 14:23       ` Lee Schermerhorn
2007-08-16 18:34         ` Christoph Lameter
2007-08-16 19:06           ` Lee Schermerhorn
2007-08-16 20:49 ` Christoph Lameter
2007-08-16 21:05   ` Lee Schermerhorn
2007-08-16 21:10     ` Christoph Lameter [this message]
2007-08-21 16:00       ` Lee Schermerhorn

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.0708161407590.18404@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=eric.whitney@hp.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