Re: [patch 3/4] slub: use is_kmalloc_cache in dma_kmalloc_cache

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

 



On Tue, 8 Jun 2010, David Rientjes wrote:

> diff --git a/mm/slub.c b/mm/slub.c
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2649,13 +2649,12 @@ static noinline struct kmem_cache *dma_kmalloc_cache(int index, gfp_t flags)
>  	text = kasprintf(flags & ~SLUB_DMA, "kmalloc_dma-%d",
>  			 (unsigned int)realsize);
>
> -	s = NULL;
>  	for (i = 0; i < KMALLOC_CACHES; i++)
>  		if (!kmalloc_caches[i].size)
>  			break;
>
> -	BUG_ON(i >= KMALLOC_CACHES);
>  	s = kmalloc_caches + i;
> +	BUG_ON(!is_kmalloc_cache(s));

The point here is to check if the index I is still within the bonds of
kmalloc_cache. Use of is_kmalloc_cache() will confuse the reader.

The assignment to s can be removed independently but my recent versions of
cleanup patches remove the dynmamic allocation of dma slab caches.

Sadly there is the next conference this week in Berlin. So nothing before
next week I think.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
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]