X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=lib%2Fdump_stack.c;h=287ea178f0fa951a225032a4ebc84030cca5cdcb;hb=7e065e0242fc285cc29c5ea4a80d108262af5148;hp=625375e7f11f98f2468002772265e30e753345fb;hpb=4d4dfc1caaea95e18223f48f5c4d49f898502941;p=people%2Farne_f%2Fkernel.git diff --git a/lib/dump_stack.c b/lib/dump_stack.c index 625375e7f11f9..287ea178f0fa9 100644 --- a/lib/dump_stack.c +++ b/lib/dump_stack.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Provide a default dump_stack() function for architectures * which don't implement their own. @@ -45,7 +46,12 @@ retry: 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; }