Re: [GIT PULL] SLAB include file dependency fixes + kmemtrace updates

Linus Torvalds
2009-04-07T01:56:18Z

On Sun, 5 Apr 2009, Ingo Molnar wrote:
>
> Please pull the latest kmemtrace-for-linus git tree from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git kmemtrace-for-linus
>
> We kept this topic separate from the main tracing tree due to the
> unexpectedly wide and messy-looking scope of the fixes Pekka needed
> to do to untangle various slab*.h, rcu*.h and fs.h dependency
> chains.

I'm not sure this is the tree that brings in the problem, but my wife's
Mac Mini won't boot any more, and it looks like some slub or percpu issue,
so regardless, roughly the right people are involved in the cc here
already.

I get odd NUL page faults or GP faults in either __kmalloc,
__kmalloc_track_caller or kmem_cache_alloc, and they all seem to happen on
roughly the same code, ie it's something like this:

movq 752(%r13,%rax,8), %rdx # <variable>.cpu_slab, c
movl 24(%rdx), %eax # <variable>.objsize,
movl %eax, -44(%rbp) #, objsize
movq (%rdx), %r12 # <variable>.freelist, object
testq %r12, %r12 # object
je .L617 #,
mov 20(%rdx), %eax # <variable>.offset, <variable>.offset
-> movq (%r12,%rax,8), %rax #* object, tmp79
movq %rax, (%rdx) # tmp79, <variable>.freelist

where that arrow points to the instruction that seems to be faulting.

I think it's this code:

object = c->freelist;
c->freelist = object[c->offset];

and that "object[c->offset]" in particular.

I have not tried to bisect it yet, and I'll do that, but if this sounds
familiar to anybody, please holler before I waste a lot of time on it.

Linus