linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
@ 2011-06-06 14:14 Steven Rostedt
  2011-06-07  4:09 ` David Rientjes
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2011-06-06 14:14 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Matt Mackall, Paul Mundt, Nick Piggin, Andrew Morton


Ingo,

Please pull the latest tip/lockdep/devel tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/lockdep/devel


Steven Rostedt (1):
      slob/lockdep: Fix gfp flags passed to lockdep

----
 mm/slob.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---------------------------
commit 38787df146ddd0c5f06127936e2351cae6b46a1f
Author: Steven Rostedt <srostedt@redhat.com>
Date:   Fri Jun 3 12:11:13 2011 -0400

    slob/lockdep: Fix gfp flags passed to lockdep
    
    Doing a ktest.pl randconfig, I stumbled across the following bug
    on boot up:
    
    ------------[ cut here ]------------
    WARNING: at /home/rostedt/work/autotest/nobackup/linux-test.git/kernel/lockdep.c:2649 lockdep_trace_alloc+0xed/0x100()
    Hardware name:
    Modules linked in:
    Pid: 0, comm: swapper Not tainted 3.0.0-rc1-test-00054-g1d68b67 #1
    Call Trace:
     [<ffffffff810626ad>] warn_slowpath_common+0xad/0xf0
     [<ffffffff8106270a>] warn_slowpath_null+0x1a/0x20
     [<ffffffff810b537d>] lockdep_trace_alloc+0xed/0x100
     [<ffffffff81182fb0>] __kmalloc_node+0x30/0x2f0
     [<ffffffff81153eda>] pcpu_mem_alloc+0x13a/0x180
     [<ffffffff82be022c>] percpu_init_late+0x48/0xc2
     [<ffffffff82bd630c>] ? mem_init+0xd8/0xe3
     [<ffffffff82bbcc73>] start_kernel+0x1c2/0x449
     [<ffffffff82bbc35c>] x86_64_start_reservations+0x163/0x167
     [<ffffffff82bbc493>] x86_64_start_kernel+0x133/0x142^M
    ---[ end trace a7919e7f17c0a725 ]---
    
    Then I ran a ktest.pl config_bisect and it came up with this config
    as the problem:
    
      CONFIG_SLOB
    
    Looking at what is different between SLOB and SLAB and SLUB, I found
    that the gfp flags are masked against gfp_allowed_mask in
    SLAB and SLUB, but not SLOB.
    
    On boot up, interrupts are disabled and lockdep will warn if some flags
    are set in gfp and interrupts are disabled. But these flags are masked
    off with the gfp_allowed_mask during boot. Because SLOB does not
    mask the flags against gfp_allowed_mask it triggers the warn on.
    
    Adding this mask fixes the bug. I also found that kmem_cache_alloc_node()
    was missing both the mask and the lockdep check, and that was added too.
    
    Cc: Matt Mackall <mpm@selenic.com>
    Cc: Paul Mundt <lethal@linux-sh.org>
    Cc: Nick Piggin <npiggin@kernel.dk>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/mm/slob.c b/mm/slob.c
index 46e0aee..0ae8818 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -482,6 +482,8 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
 	int align = max(ARCH_KMALLOC_MINALIGN, ARCH_SLAB_MINALIGN);
 	void *ret;
 
+	gfp &= gfp_allowed_mask;
+
 	lockdep_trace_alloc(gfp);
 
 	if (size < PAGE_SIZE - align) {
@@ -608,6 +610,10 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
 {
 	void *b;
 
+	flags &= gfp_allowed_mask;
+
+	lockdep_trace_alloc(flags);
+
 	if (c->size < PAGE_SIZE) {
 		b = slob_alloc(c->size, flags, c->align, node);
 		trace_kmem_cache_alloc_node(_RET_IP_, b, c->size,



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-06 14:14 [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep Steven Rostedt
@ 2011-06-07  4:09 ` David Rientjes
  2011-06-07  6:06   ` Pekka Enberg
  0 siblings, 1 reply; 7+ messages in thread
From: David Rientjes @ 2011-06-07  4:09 UTC (permalink / raw)
  To: Steven Rostedt, Pekka Enberg
  Cc: LKML, Ingo Molnar, Matt Mackall, Paul Mundt, Nick Piggin, Andrew Morton

On Mon, 6 Jun 2011, Steven Rostedt wrote:

> 
> Ingo,
> 
> Please pull the latest tip/lockdep/devel tree, which can be found at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> tip/lockdep/devel
> 
> 
> Steven Rostedt (1):
>       slob/lockdep: Fix gfp flags passed to lockdep

Shouldn't this be going into Pekka's slab tree?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-07  4:09 ` David Rientjes
@ 2011-06-07  6:06   ` Pekka Enberg
  2011-06-07 10:19     ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Pekka Enberg @ 2011-06-07  6:06 UTC (permalink / raw)
  To: David Rientjes
  Cc: Steven Rostedt, LKML, Ingo Molnar, Matt Mackall, Paul Mundt,
	Nick Piggin, Andrew Morton

On Tue, Jun 7, 2011 at 7:09 AM, David Rientjes <rientjes@google.com> wrote:
>> Please pull the latest tip/lockdep/devel tree, which can be found at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
>> tip/lockdep/devel
>>
>>
>> Steven Rostedt (1):
>>       slob/lockdep: Fix gfp flags passed to lockdep
>
> Shouldn't this be going into Pekka's slab tree?

That's what I'd expect, sure. :-)

However, I'm not pulling from a "tip/lockdep/devel" branch to slab.git
so Steven needs to send this to me in patch format or Ingo picks it up
in which case consider the patch:

Acked-by: Pekka Enberg <penberg@kernel.org>

                          Pekka

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-07  6:06   ` Pekka Enberg
@ 2011-06-07 10:19     ` Ingo Molnar
  2011-06-07 11:15       ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2011-06-07 10:19 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: David Rientjes, Steven Rostedt, LKML, Matt Mackall, Paul Mundt,
	Nick Piggin, Andrew Morton


* Pekka Enberg <penberg@kernel.org> wrote:

> On Tue, Jun 7, 2011 at 7:09 AM, David Rientjes <rientjes@google.com> wrote:
> >> Please pull the latest tip/lockdep/devel tree, which can be found at:
> >>
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
> >> tip/lockdep/devel
> >>
> >>
> >> Steven Rostedt (1):
> >>       slob/lockdep: Fix gfp flags passed to lockdep
> >
> > Shouldn't this be going into Pekka's slab tree?
> 
> That's what I'd expect, sure. :-)
> 
> However, I'm not pulling from a "tip/lockdep/devel" branch to slab.git
> so Steven needs to send this to me in patch format or Ingo picks it up
> in which case consider the patch:
> 
> Acked-by: Pekka Enberg <penberg@kernel.org>

Unless there are some dependencies i missed i think it would be 
better if you pulled this, hm?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-07 10:19     ` Ingo Molnar
@ 2011-06-07 11:15       ` Steven Rostedt
  2011-06-07 11:51         ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2011-06-07 11:15 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Pekka Enberg, David Rientjes, LKML, Matt Mackall, Paul Mundt,
	Nick Piggin, Andrew Morton

On Tue, 2011-06-07 at 12:19 +0200, Ingo Molnar wrote:
> * Pekka Enberg <penberg@kernel.org> wrote:

> > However, I'm not pulling from a "tip/lockdep/devel" branch to slab.git
> > so Steven needs to send this to me in patch format or Ingo picks it up
> > in which case consider the patch:
> > 
> > Acked-by: Pekka Enberg <penberg@kernel.org>
> 
> Unless there are some dependencies i missed i think it would be 
> better if you pulled this, hm?

Nope, this is my fault. I searched for SLOB in MAINTAINERS and didn't
find it. But I should have looked at SLAB.

I'll resend this as a normal patch for Pekka.

-- Steve




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-07 11:15       ` Steven Rostedt
@ 2011-06-07 11:51         ` Ingo Molnar
  2011-06-07 12:13           ` Steven Rostedt
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2011-06-07 11:51 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Pekka Enberg, David Rientjes, LKML, Matt Mackall, Paul Mundt,
	Nick Piggin, Andrew Morton


* Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 2011-06-07 at 12:19 +0200, Ingo Molnar wrote:
> > * Pekka Enberg <penberg@kernel.org> wrote:
> 
> > > However, I'm not pulling from a "tip/lockdep/devel" branch to slab.git
> > > so Steven needs to send this to me in patch format or Ingo picks it up
> > > in which case consider the patch:
> > > 
> > > Acked-by: Pekka Enberg <penberg@kernel.org>
> > 
> > Unless there are some dependencies i missed i think it would be 
> > better if you pulled this, hm?
> 
> Nope, this is my fault. I searched for SLOB in MAINTAINERS and didn't
> find it. But I should have looked at SLAB.
> 
> I'll resend this as a normal patch for Pekka.

Pekka could pull it as well, since you've already tested that tree 
:-)

I don't think this tree includes any other commits, right?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep
  2011-06-07 11:51         ` Ingo Molnar
@ 2011-06-07 12:13           ` Steven Rostedt
  0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2011-06-07 12:13 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Pekka Enberg, David Rientjes, LKML, Matt Mackall, Paul Mundt,
	Nick Piggin, Andrew Morton

On Tue, 2011-06-07 at 13:51 +0200, Ingo Molnar wrote:

> Pekka could pull it as well, since you've already tested that tree 
> :-)
> 
> I don't think this tree includes any other commits, right?
> 

Nope, it was based off of commit:

5db1256a5131d3b133946fa02ac9770a784e6eb2

which is already in Linus's tree, and has just this one commit.

-- Steve



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-07 12:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-06 14:14 [PATCH][GIT PULL] slob/lockdep: Fix gfp flags passed to lockdep Steven Rostedt
2011-06-07  4:09 ` David Rientjes
2011-06-07  6:06   ` Pekka Enberg
2011-06-07 10:19     ` Ingo Molnar
2011-06-07 11:15       ` Steven Rostedt
2011-06-07 11:51         ` Ingo Molnar
2011-06-07 12:13           ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).