The patch titled Subject: slab: use slab_pre_alloc_hook in SLAB allocator shared with SLUB has been added to the -mm tree. Its filename is slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jesper Dangaard Brouer <brouer@xxxxxxxxxx> Subject: slab: use slab_pre_alloc_hook in SLAB allocator shared with SLUB Deduplicate code in SLAB allocator functions slab_alloc() and slab_alloc_node() by using the slab_pre_alloc_hook() call, which is now shared between SLUB and SLAB. Signed-off-by: Jesper Dangaard Brouer <brouer@xxxxxxxxxx> Cc: Christoph Lameter <cl@xxxxxxxxx> Cc: Pekka Enberg <penberg@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/slab.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff -puN mm/slab.c~slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub mm/slab.c --- a/mm/slab.c~slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub +++ a/mm/slab.c @@ -3143,15 +3143,10 @@ slab_alloc_node(struct kmem_cache *cache void *ptr; int slab_node = numa_mem_id(); - flags &= gfp_allowed_mask; - - lockdep_trace_alloc(flags); - - if (should_failslab(cachep, flags)) + cachep = slab_pre_alloc_hook(cachep, flags); + if (unlikely(!cachep)) return NULL; - cachep = memcg_kmem_get_cache(cachep, flags); - cache_alloc_debugcheck_before(cachep, flags); local_irq_save(save_flags); @@ -3231,15 +3226,10 @@ slab_alloc(struct kmem_cache *cachep, gf unsigned long save_flags; void *objp; - flags &= gfp_allowed_mask; - - lockdep_trace_alloc(flags); - - if (should_failslab(cachep, flags)) + cachep = slab_pre_alloc_hook(cachep, flags); + if (unlikely(!cachep)) return NULL; - cachep = memcg_kmem_get_cache(cachep, flags); - cache_alloc_debugcheck_before(cachep, flags); local_irq_save(save_flags); objp = __do_cache_alloc(cachep, flags); _ Patches currently in -mm which might be from brouer@xxxxxxxxxx are slub-cleanup-code-for-kmem-cgroup-support-to-kmem_cache_free_bulk.patch mm-slab-move-slub-alloc-hooks-to-common-mm-slabh.patch mm-fault-inject-take-over-bootstrap-kmem_cache-check.patch slab-use-slab_pre_alloc_hook-in-slab-allocator-shared-with-slub.patch mm-kmemcheck-skip-object-if-slab-allocation-failed.patch slab-use-slab_post_alloc_hook-in-slab-allocator-shared-with-slub.patch slab-implement-bulk-alloc-in-slab-allocator.patch slab-avoid-running-debug-slab-code-with-irqs-disabled-for-alloc_bulk.patch slab-implement-bulk-free-in-slab-allocator.patch mm-new-api-kfree_bulk-for-slabslub-allocators.patch mm-fix-some-spelling.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