]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm, slub: don't disable irq for debug_check_no_locks_freed()
authorVlastimil Babka <vbabka@suse.cz>
Mon, 23 Aug 2021 23:58:54 +0000 (09:58 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:25 +0000 (09:33 +1000)
In slab_free_hook() we disable irqs around the
debug_check_no_locks_freed() call, which is unnecessary, as irqs are
already being disabled inside the call.  This seems to be leftover from
the past where there were more calls inside the irq disabled sections.
Remove the irq disable/enable operations.

Mel noted:
> Looks like it was needed for kmemcheck which went away back in 4.15

Link: https://lkml.kernel.org/r/20210805152000.12817-5-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/slub.c

index 4697280130f21955e82439ecf76c300b194b8c3a..fee093db2bfd79c96d52a2cd6ac5ec9b4fcc14f7 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1591,20 +1591,8 @@ static __always_inline bool slab_free_hook(struct kmem_cache *s,
 {
        kmemleak_free_recursive(x, s->flags);
 
-       /*
-        * Trouble is that we may no longer disable interrupts in the fast path
-        * So in order to make the debug calls that expect irqs to be
-        * disabled we need to disable interrupts temporarily.
-        */
-#ifdef CONFIG_LOCKDEP
-       {
-               unsigned long flags;
+       debug_check_no_locks_freed(x, s->object_size);
 
-               local_irq_save(flags);
-               debug_check_no_locks_freed(x, s->object_size);
-               local_irq_restore(flags);
-       }
-#endif
        if (!(s->flags & SLAB_DEBUG_OBJECTS))
                debug_check_no_obj_freed(x, s->object_size);