Re: [PATCH] slub: Using judgement !!c to judge per cpu has obj in fucntion has_cpu_slab().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 8 May 2012, majianpeng wrote:

> diff --git a/mm/slub.c b/mm/slub.c
> index ffe13fd..6fce08f 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2040,7 +2040,7 @@ static bool has_cpu_slab(int cpu, void *info)
>  	struct kmem_cache *s = info;
>  	struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);
>
> -	return !!(c->page);
> +	return !!c;
>  }

Dont do that. This will always return true since c will never be NULL. The
check is pointless then and you have essentially reverted the patch to
slub that avoids the IPI. Reverting
commit a8364d5555b2030d093cde0f07951628e55454e1 should have the same
effect.

This issue suggests some sort of race condition that results in not
releasing the per cpu slab or the population of the per cpu slab after
the check was done.



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]