diff --git a/lib/dump_stack.c b/lib/dump_stack.c index 5cff72f18c4a4ce4f0770f968dadefd4e6d190ad..33ffbf30885394c89d2c8c933eeb50a7769c357e 100644 --- a/lib/dump_stack.c +++ b/lib/dump_stack.c @@ -106,7 +106,12 @@ asmlinkage __visible void dump_stack(void) was_locked = 1; } else { local_irq_restore(flags); - cpu_relax(); + /* + * Wait for the lock to release before jumping to + * atomic_cmpxchg() in order to mitigate the thundering herd + * problem. + */ + do { cpu_relax(); } while (atomic_read(&dump_lock) != -1); goto retry; }