drm/amdgpu: disable gfxoff when using register read interface
[linux-2.6-block.git] / lib / dump_stack.c
index 5cff72f18c4a4ce4f0770f968dadefd4e6d190ad..33ffbf30885394c89d2c8c933eeb50a7769c357e 100644 (file)
@@ -106,7 +106,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;
        }