diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2011-10-11 23:56:23 -0400 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-03-01 09:28:37 -0600 |
commit | cce3c0f4a0a171e2829235ce46ac67524b08250c (patch) | |
tree | 0ec424dff8b7391475bc1417eb610aa1b790cf21 /mm/pagewalk.c | |
parent | 304ee5f7f563bce6ef1da009d7123b2ca5f8e08b (diff) |
slab: Fix __do_drain to use the right array cache
The array cache in __do_drain() was using the cpu_cache_get() function
which uses smp_processor_id() to get the proper array. On mainline, this
is fine as __do_drain() is called by for_each_cpu() which runs
__do_drain() on the CPU it is processing. In RT locks are used instead
and __do_drain() is only called from a single CPU. This can cause the
accounting to be off and trigger the following bug:
slab error in kmem_cache_destroy(): cache `nfs_write_data': Can't free all objects
Pid: 2905, comm: rmmod Not tainted 3.0.6-test-rt17+ #78
Call Trace:
[<ffffffff810fb623>] kmem_cache_destroy+0xa0/0xdf
[<ffffffffa03aaffb>] nfs_destroy_writepagecache+0x49/0x4e [nfs]
[<ffffffffa03c0fe0>] exit_nfs_fs+0xe/0x46 [nfs]
[<ffffffff8107af09>] sys_delete_module+0x1ba/0x22c
[<ffffffff8109429d>] ? audit_syscall_entry+0x11c/0x148
[<ffffffff814b6442>] system_call_fastpath+0x16/0x1b
This can be easily triggered by a simple while loop:
# while :; do modprobe nfs; rmmod nfs; done
The proper function to use is cpu_cache_get_on_cpu(). It works for both
RT and non-RT as the non-RT passes in smp_processor_id() into
__do_drain().
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Cc: Clark Williams <clark@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1318391783.13262.11.camel@gandalf.stny.rr.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'mm/pagewalk.c')
0 files changed, 0 insertions, 0 deletions