Re: [Slub allocator] There are chances that kmem_cache_cpu->freelistgets lost if the process happens to be rescheduled to a differenet cpu beforethe local_irq_save() completes in __slab_alloc()

From: Christoph Lameter
Date: Mon Dec 12 2011 - 10:50:11 EST


On Mon, 12 Dec 2011, Eric Dumazet wrote:

> We miss a deactivate_slab() call or just deliver object if c->freelist
> is not null (and NUMA node matches)
>
> Untested patch :
>
> diff --git a/mm/slub.c b/mm/slub.c
> index ed3334d..923d238 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2166,6 +2166,12 @@ redo:
> goto new_slab;
> }
>
> +#ifdef CONFIG_PREEMPT
> + object = c->freelist;
> + if (object)
> + goto load_freelist;
> +#endif
> +
> stat(s, ALLOC_SLOWPATH);
>
> do {

Correct. Issue was introduced in 2.6.39.

Acked-by: Christoph Lameter <cl@xxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/