On Tue, Oct 09, 2007 at 11:46:14AM -0700, Christoph Lameter wrote:I couldn't use get_cpu_slab() for that check. But I reviced the patch to do what you said. Subject: slub: fix cpu hotplug offline/online path This patch fixes the problem introduced by: http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.23-rc8/2.6.23-rc8-mm2/b... I got slub BUG report when I tried to do cpu hotplug/unplug $ while true; do echo 0 > /sys/devices/system/cpu/cpu1/online echo 1 > /sys/devices/system/cpu/cpu1/online done This is because init_alloc_cpu_cpu() is called every time when the CPU is going to be onlined but init_alloc_cpu_cpu() is not intented to be called twice or more for same CPU. Then it breaks kmem_cache_cpu_free list for the CPU. This patch checks if a per cpu structure has already been allocated and then simply skip the call to init_alloc_cpu_cpu(). Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> --- mm/slub.c | 5 +++++ 1 file changed, 5 insertions(+) Index: 2.6-mm/mm/slub.c =================================================================== --- 2.6-mm.orig/mm/slub.c +++ 2.6-mm/mm/slub.c @@ -2033,6 +2033,11 @@ static void init_alloc_cpu_cpu(int cpu) { int i; + if (per_cpu(kmem_cache_cpu_free, cpu)) { + /* Already initialized once */ + return; + } + for (i = NR_KMEM_CACHE_CPU - 1; i >= 0; i--) free_kmem_cache_cpu(&per_cpu(kmem_cache_cpu, cpu)[i], cpu); } -
| Jeff Garzik | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Christoph Hellwig | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scan... |
| Heiko Carstens | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Arjan van de Ven | Re: [GIT]: Networking |
| Jens Axboe | Re: [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Emmanuel Dreyfus | fixing send(2) semantics (kern/29750) |
| Christos Zoulas | Re: Melting down your network [Subject changed] |
| Juan RP | Changing the I/O scheduler on-the-fly |
| Emmanuel Dreyfus | Re: fixing send(2) semantics (kern/29750) |
