Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Thu, 11 Oct 2007, Akinobu Mita wrote: > This is another approach for the fix. Looks like the cleanest solution. Acked-by: Christoph Lameter <[EMAIL PROTECTED]> > Use cpumask to check whether kmem_cache_cpu_free initalization for > the CPU has already been done or not. > > --- > mm/slub.c

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Fri, 12 Oct 2007, Akinobu Mita wrote: > > > This means get_cpu_slab() always return NULL when CPU is being onlined. > > > So I can't use get_cpu_slab to check whether kmem_cache_cpu_free > > > initalization for the CPU has already been done or not. > > > > If you have set it to NULL then the

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Akinobu Mita
2007/10/12, Christoph Lameter <[EMAIL PROTECTED]>: > On Thu, 11 Oct 2007, Akinobu Mita wrote: > > > > Why would get_cpu_slab not work? > > > > > > case CPU_DEAD: > > case CPU_DEAD_FROZEN: > > down_read(_lock); > > list_for_each_entry(s, _caches,

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Thu, 11 Oct 2007, Akinobu Mita wrote: > > Why would get_cpu_slab not work? > > > case CPU_DEAD: > case CPU_DEAD_FROZEN: > down_read(_lock); > list_for_each_entry(s, _caches, list) { > struct kmem_cache_cpu *c =

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Akinobu Mita
On Wed, Oct 10, 2007 at 10:39:32AM -0700, Christoph Lameter wrote: > On Wed, 10 Oct 2007, Akinobu Mita wrote: > > > I couldn't use get_cpu_slab() for that check. But I reviced the patch to do > > what you said. > > Why would get_cpu_slab not work? case CPU_DEAD: case

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Akinobu Mita
On Wed, Oct 10, 2007 at 10:39:32AM -0700, Christoph Lameter wrote: On Wed, 10 Oct 2007, Akinobu Mita wrote: I couldn't use get_cpu_slab() for that check. But I reviced the patch to do what you said. Why would get_cpu_slab not work? case CPU_DEAD: case CPU_DEAD_FROZEN:

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Thu, 11 Oct 2007, Akinobu Mita wrote: Why would get_cpu_slab not work? case CPU_DEAD: case CPU_DEAD_FROZEN: down_read(slub_lock); list_for_each_entry(s, slab_caches, list) { struct kmem_cache_cpu *c =

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Fri, 12 Oct 2007, Akinobu Mita wrote: This means get_cpu_slab() always return NULL when CPU is being onlined. So I can't use get_cpu_slab to check whether kmem_cache_cpu_free initalization for the CPU has already been done or not. If you have set it to NULL then the earlier

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Christoph Lameter
On Thu, 11 Oct 2007, Akinobu Mita wrote: This is another approach for the fix. Looks like the cleanest solution. Acked-by: Christoph Lameter [EMAIL PROTECTED] Use cpumask to check whether kmem_cache_cpu_free initalization for the CPU has already been done or not. --- mm/slub.c |6

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-11 Thread Akinobu Mita
2007/10/12, Christoph Lameter [EMAIL PROTECTED]: On Thu, 11 Oct 2007, Akinobu Mita wrote: Why would get_cpu_slab not work? case CPU_DEAD: case CPU_DEAD_FROZEN: down_read(slub_lock); list_for_each_entry(s, slab_caches, list) {

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-10 Thread Christoph Lameter
On Wed, 10 Oct 2007, Akinobu Mita wrote: > I couldn't use get_cpu_slab() for that check. But I reviced the patch to do > what you said. Why would get_cpu_slab not work? > + if (per_cpu(kmem_cache_cpu_free, cpu)) { > + /* Already initialized once */ > + return; > +

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-10 Thread Akinobu Mita
On Tue, Oct 09, 2007 at 11:46:14AM -0700, Christoph Lameter wrote: > On Wed, 10 Oct 2007, Akinobu Mita wrote: > > > This patch removes init_alloc_cpu_cpu() from cpu hotplug notifier. But > > call it for each possible CPUs not only online CPUs at initialization time. > > Could you check if a per

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-10 Thread Akinobu Mita
On Tue, Oct 09, 2007 at 11:46:14AM -0700, Christoph Lameter wrote: On Wed, 10 Oct 2007, Akinobu Mita wrote: This patch removes init_alloc_cpu_cpu() from cpu hotplug notifier. But call it for each possible CPUs not only online CPUs at initialization time. Could you check if a per cpu

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-10 Thread Christoph Lameter
On Wed, 10 Oct 2007, Akinobu Mita wrote: I couldn't use get_cpu_slab() for that check. But I reviced the patch to do what you said. Why would get_cpu_slab not work? + if (per_cpu(kmem_cache_cpu_free, cpu)) { + /* Already initialized once */ + return; + } +

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Tue, 9 Oct 2007, Pekka Enberg wrote: > Hi Christoph, > > On 10/9/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: > > Our system come by default with the possibility of 1k cpus. However, a > > small system may only have 8 cpus. > > Maybe I am reading the code wrong, but I don't why that

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Christoph, On 10/9/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: > Our system come by default with the possibility of 1k cpus. However, a > small system may only have 8 cpus. Maybe I am reading the code wrong, but I don't why that matters as it's all statically allocated anyway (the

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Tue, 9 Oct 2007, Pekka Enberg wrote: > Hi Christoph, > > On 10/9/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: > > Could you check if a per cpu structure has already been allocated and then > > simply skip the call to init? Otherwise we end up with lots of per cpu > > structures for cpus

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Christoph, On 10/9/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: > Could you check if a per cpu structure has already been allocated and then > simply skip the call to init? Otherwise we end up with lots of per cpu > structures for cpus that will never show up. Does it matter? How? - To

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Wed, 10 Oct 2007, Akinobu Mita wrote: > This patch removes init_alloc_cpu_cpu() from cpu hotplug notifier. But > call it for each possible CPUs not only online CPUs at initialization time. Could you check if a per cpu structure has already been allocated and then simply skip the call to

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Akinobu, On 10/9/07, Akinobu Mita <[EMAIL PROTECTED]> wrote: > 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

[PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Akinobu Mita
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/broken-out/slub-place-kmem_cache_cpu-structures-in-a-numa-aware-way.patch I got slub BUG report when I tried to do cpu hotplug/unplug $ while true; do echo 0 >

[PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Akinobu Mita
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/broken-out/slub-place-kmem_cache_cpu-structures-in-a-numa-aware-way.patch I got slub BUG report when I tried to do cpu hotplug/unplug $ while true; do echo 0

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Akinobu, On 10/9/07, Akinobu Mita [EMAIL PROTECTED] wrote: 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.

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Wed, 10 Oct 2007, Akinobu Mita wrote: This patch removes init_alloc_cpu_cpu() from cpu hotplug notifier. But call it for each possible CPUs not only online CPUs at initialization time. Could you check if a per cpu structure has already been allocated and then simply skip the call to init?

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Christoph, On 10/9/07, Christoph Lameter [EMAIL PROTECTED] wrote: Could you check if a per cpu structure has already been allocated and then simply skip the call to init? Otherwise we end up with lots of per cpu structures for cpus that will never show up. Does it matter? How? - To

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Tue, 9 Oct 2007, Pekka Enberg wrote: Hi Christoph, On 10/9/07, Christoph Lameter [EMAIL PROTECTED] wrote: Could you check if a per cpu structure has already been allocated and then simply skip the call to init? Otherwise we end up with lots of per cpu structures for cpus that will

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Pekka Enberg
Hi Christoph, On 10/9/07, Christoph Lameter [EMAIL PROTECTED] wrote: Our system come by default with the possibility of 1k cpus. However, a small system may only have 8 cpus. Maybe I am reading the code wrong, but I don't why that matters as it's all statically allocated anyway (the per-cpu

Re: [PATCH -mm] slub: fix cpu hotplug offline/online path

2007-10-09 Thread Christoph Lameter
On Tue, 9 Oct 2007, Pekka Enberg wrote: Hi Christoph, On 10/9/07, Christoph Lameter [EMAIL PROTECTED] wrote: Our system come by default with the possibility of 1k cpus. However, a small system may only have 8 cpus. Maybe I am reading the code wrong, but I don't why that matters as