The patch titled slab: optimize kmalloc_node the same way as kmalloc has been added to the -mm tree. Its filename is slab-optimize-kmalloc_node-the-same-way-as-kmalloc.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: slab: optimize kmalloc_node the same way as kmalloc From: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> Acked-by: Christoph Lameter <clameter@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- diff -puN include/linux/slab.h~slab-optimize-kmalloc_node-the-same-way-as-kmalloc include/linux/slab.h --- a/include/linux/slab.h~slab-optimize-kmalloc_node-the-same-way-as-kmalloc +++ a/include/linux/slab.h @@ -212,7 +212,30 @@ extern int slab_is_available(void); #ifdef CONFIG_NUMA extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); -extern void *kmalloc_node(size_t size, gfp_t flags, int node); +extern void *__kmalloc_node(size_t size, gfp_t flags, int node); + +static inline void *kmalloc_node(size_t size, gfp_t flags, int node) +{ + if (__builtin_constant_p(size)) { + int i = 0; +#define CACHE(x) \ + if (size <= x) \ + goto found; \ + else \ + i++; +#include "kmalloc_sizes.h" +#undef CACHE + { + extern void __you_cannot_kmalloc_that_much(void); + __you_cannot_kmalloc_that_much(); + } +found: + return kmem_cache_alloc_node((flags & GFP_DMA) ? + malloc_sizes[i].cs_dmacachep : + malloc_sizes[i].cs_cachep, flags, node); + } + return __kmalloc_node(size, flags, node); +} #else static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, gfp_t flags, int node) { diff -puN mm/slab.c~slab-optimize-kmalloc_node-the-same-way-as-kmalloc mm/slab.c --- a/mm/slab.c~slab-optimize-kmalloc_node-the-same-way-as-kmalloc +++ a/mm/slab.c @@ -3348,7 +3348,7 @@ void *kmem_cache_alloc_node(struct kmem_ } EXPORT_SYMBOL(kmem_cache_alloc_node); -void *kmalloc_node(size_t size, gfp_t flags, int node) +void *__kmalloc_node(size_t size, gfp_t flags, int node) { struct kmem_cache *cachep; _ Patches currently in -mm which might be from hch@xxxxxx are origin.patch git-scsi-misc.patch git-scsi-rc-fixes.patch pci_module_init-conversion-in-scsi-subsys-2nd-try.patch slab-clean-up-leak-tracking-ifdefs-a-little-bit.patch slab-optimize-kmalloc_node-the-same-way-as-kmalloc.patch add-address_space_operationsbatch_write.patch add-address_space_operationsbatch_write-fix.patch pass-io-size-to-batch_write-address-space-operation.patch vectorize-aio_read-aio_write-fileop-methods.patch remove-readv-writev-methods-and-use-aio_read-aio_write.patch streamline-generic_file_-interfaces-and-filemap.patch add-vector-aio-support.patch ecryptfs-mmap-operations.patch ecryptfs-dont-muck-with-the-existing-nameidata-structures.patch streamline-generic_file_-interfaces-and-filemap-ecryptfs.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html