Kevin Hao b9b3132491 dump_stack: avoid the livelock of the dump_lock
commit 5cbf2fff3bba8d3c6a4d47c1754de1cf57e2b01f upstream.

In the current code, we use the atomic_cmpxchg() to serialize the output
of the dump_stack(), but this implementation suffers the thundering herd
problem.  We have observed such kind of livelock on a Marvell cn96xx
board(24 cpus) when heavily using the dump_stack() in a kprobe handler.
Actually we can let the competitors to wait for the releasing of the
lock before jumping to atomic_cmpxchg().  This will definitely mitigate
the thundering herd problem.  Thanks Linus for the suggestion.

[akpm@linux-foundation.org: fix comment]
Link: http://lkml.kernel.org/r/20191030031637.6025-1-haokexin@gmail.com
Fixes: b58d977432c8 ("dump_stack: serialize the output from dump_stack()")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-12 19:13:19 +01:00
..
2014-10-09 11:35:48 +03:00
2019-07-10 09:56:43 +02:00
2015-07-27 14:06:24 +02:00
2015-11-23 09:44:58 +01:00
2015-05-28 11:31:52 +09:30
2015-10-05 04:49:54 +01:00
2019-04-27 09:33:59 +02:00
2014-04-30 19:49:37 +01:00
2014-08-06 18:01:25 -07:00
2016-09-24 10:07:43 +02:00
2016-03-03 15:07:24 -08:00
2014-08-08 15:57:25 -07:00
2018-12-13 09:21:28 +01:00
2015-02-12 18:54:15 -08:00
2014-06-25 17:45:43 -07:00
2015-09-08 14:35:59 -07:00
2015-02-12 18:54:16 -08:00
2019-02-08 11:25:31 +01:00
2015-03-23 22:12:08 -04:00
2015-06-25 17:00:40 -07:00
2019-04-27 09:33:54 +02:00
2018-12-17 21:55:16 +01:00
2013-04-29 18:28:42 -07:00