Skip to content

Commit d63385a

Browse files
Liu Shixinakpm00
Liu Shixin
authored andcommitted
mm/kmemleak: move set_track_prepare() outside raw_spinlocks
set_track_prepare() will call __alloc_pages() which attempts to acquire zone->lock(spinlocks), so move it outside object->lock(raw_spinlocks) because it's not right to acquire spinlocks while holding raw_spinlocks in RT mode. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Liu Shixin <[email protected]> Acked-by: Catalin Marinas <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Patrick Wang <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 4eff7d6 commit d63385a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/kmemleak.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ EXPORT_SYMBOL_GPL(kmemleak_free_percpu);
11521152
void __ref kmemleak_update_trace(const void *ptr)
11531153
{
11541154
struct kmemleak_object *object;
1155+
depot_stack_handle_t trace_handle;
11551156
unsigned long flags;
11561157

11571158
pr_debug("%s(0x%px)\n", __func__, ptr);
@@ -1168,8 +1169,9 @@ void __ref kmemleak_update_trace(const void *ptr)
11681169
return;
11691170
}
11701171

1172+
trace_handle = set_track_prepare();
11711173
raw_spin_lock_irqsave(&object->lock, flags);
1172-
object->trace_handle = set_track_prepare();
1174+
object->trace_handle = trace_handle;
11731175
raw_spin_unlock_irqrestore(&object->lock, flags);
11741176

11751177
put_object(object);

0 commit comments

Comments
 (0)