linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: Re: [patch] mm, mempolicy: dummy slab_node return value for bugless kernels
Date: Tue, 6 Mar 2012 20:25:39 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1203061950050.24600@chino.kir.corp.google.com> (raw)
In-Reply-To: <20120306160833.0e9bf50a.akpm@linux-foundation.org>

On Tue, 6 Mar 2012, Andrew Morton wrote:

> > diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> > --- a/mm/mempolicy.c
> > +++ b/mm/mempolicy.c
> > @@ -1611,6 +1611,7 @@ unsigned slab_node(struct mempolicy *policy)
> >  
> >  	default:
> >  		BUG();
> > +		return numa_node_id();
> >  	}
> >  }
> 
> Wait.  If the above code generated a warning then surely we get a *lot*
> of warnings!  I'd expect that a lot of code assumes that BUG() never
> returns?
> 

allyesconfig with CONFIG_BUG=n results in 50 such warnings tree wide, and 
this is the only one in mm/*.

> Also, does CONIG_BUG=n even make sense?  If we got here and we know
> that the kernel has malfunctioned, what point is there in pretending
> otherwise?  Odd.
> 

I don't suspect we'll be very popular if we try to remove it, I can see 
how it would be useful when BUG() is used when the problem isn't really 
fatal (to stop something like disk corruption), like the above case isn't. 
If policy->mode isn't one of MPOL_{BIND,INTERLEAVE,PREFERRED} then we'd 
want WARN_ON_ONCE() at best; someone either didn't test their patch or 
we've flipped a bit, but the kernel can run happily along using the local 
node for slab allocations while still notifying the user.

mm/mempolicy.c misuses BUG() in every case,  Not having the perfect NUMA 
optimizations is surely annoying, but let's not crash someone's kernel.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2012-03-07  4:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-04 21:43 David Rientjes
2012-03-06 20:15 ` Rafael Aquini
2012-03-07  0:08 ` Andrew Morton
2012-03-07  0:55   ` Rafael Aquini
2012-03-07  4:25   ` David Rientjes [this message]
2012-03-07  4:29     ` [patch] mm, mempolicy: make mempolicies robust against errors David Rientjes
2012-03-07  5:30       ` KOSAKI Motohiro
2012-03-07  5:58         ` David Rientjes
2012-03-07  6:34           ` KOSAKI Motohiro
2012-03-07  6:56             ` David Rientjes
2012-03-07 16:24               ` KOSAKI Motohiro
2012-03-07 21:06                 ` David Rientjes
2012-03-08 23:51             ` Andrew Morton
2012-04-26 14:58           ` Christoph Lameter
2012-03-07 11:12     ` [patch] mm, mempolicy: dummy slab_node return value for bugless kernels Glauber Costa
2012-03-07 21:04       ` 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=alpine.DEB.2.00.1203061950050.24600@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.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