summaryrefslogtreecommitdiffstats
path: root/lib/dump_stack.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-09 10:26:02 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-09 10:26:02 +0100
commit2a96fd7417a0eb501edfde9713555bd7c2eda302 (patch)
treeef00ebfbde662b94a0423a8816a0bbab37440c1e /lib/dump_stack.c
parentca59809ff6d572ae58fc6bedf7500f5a60fdbd64 (diff)
parent388f7b1d6e8ca06762e2454d28d6c3c55ad0fe95 (diff)
downloadlinux-2a96fd7417a0eb501edfde9713555bd7c2eda302.tar.bz2
Merge tag 'v4.5-rc3' into locking/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/dump_stack.c')
-rw-r--r--lib/dump_stack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/dump_stack.c b/lib/dump_stack.c
index 6745c6230db3..c30d07e99dba 100644
--- a/lib/dump_stack.c
+++ b/lib/dump_stack.c
@@ -25,6 +25,7 @@ static atomic_t dump_lock = ATOMIC_INIT(-1);
asmlinkage __visible void dump_stack(void)
{
+ unsigned long flags;
int was_locked;
int old;
int cpu;
@@ -33,9 +34,8 @@ asmlinkage __visible void dump_stack(void)
* Permit this cpu to perform nested stack dumps while serialising
* against other CPUs
*/
- preempt_disable();
-
retry:
+ local_irq_save(flags);
cpu = smp_processor_id();
old = atomic_cmpxchg(&dump_lock, -1, cpu);
if (old == -1) {
@@ -43,6 +43,7 @@ retry:
} else if (old == cpu) {
was_locked = 1;
} else {
+ local_irq_restore(flags);
cpu_relax();
goto retry;
}
@@ -52,7 +53,7 @@ retry:
if (!was_locked)
atomic_set(&dump_lock, -1);
- preempt_enable();
+ local_irq_restore(flags);
}
#else
asmlinkage __visible void dump_stack(void)