diff mbox series

[RFC,03/26] mm, slub: don't disable irq for debug_check_no_locks_freed()

Message ID 20210524233946.20352-4-vbabka@suse.cz (mailing list archive)
State New, archived
Headers show
Series SLUB: use local_lock for kmem_cache_cpu protection and reduce disabling irqs | expand

Commit Message

Vlastimil Babka May 24, 2021, 11:39 p.m. UTC
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.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
 mm/slub.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Comments

Mel Gorman May 25, 2021, 10:24 a.m. UTC | #1
On Tue, May 25, 2021 at 01:39:23AM +0200, Vlastimil Babka wrote:
> 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.
> 
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

Looks like it was needed for kmemcheck which went away back in 4.15 so

Acked-by: Mel Gorman <mgorman@techsingularity.net>
diff mbox series

Patch

diff --git a/mm/slub.c b/mm/slub.c
index ed0f2620b19b..83ad64c1d9da 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1545,20 +1545,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);