diff options
author | Eric Sandeen <sandeen@redhat.com> | 2014-12-16 17:25:28 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-01-14 07:34:14 -0500 |
commit | a8b686b3af4419f92e0ea5be1c76fb68363df8e6 (patch) | |
tree | 2c103c51144d8bbcd97e2a02e1ac95ddb224a109 /kernel/sched/core.c | |
parent | 638476007d13534b2ed4134bf0279ef44071140b (diff) |
sched/debug: Check for stack overflow in ___might_sleep()
Sometimes a "BUG: sleeping function called from invalid context"
message is not indicative of locking problems, but is the result
of a stack overflow corrupting the thread info.
Witness http://oss.sgi.com/archives/xfs/2014-02/msg00325.html
for example, which took a few go-rounds to sort out.
If we're printing the warning, things are wonky already, and
it'd be informative to check for the stack end corruption at this
point, too.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/5490B158.4060005@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c0accc00566e..56c9b79772bd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -7325,6 +7325,9 @@ void ___might_sleep(const char *file, int line, int preempt_offset) | |||
7325 | in_atomic(), irqs_disabled(), | 7325 | in_atomic(), irqs_disabled(), |
7326 | current->pid, current->comm); | 7326 | current->pid, current->comm); |
7327 | 7327 | ||
7328 | if (task_stack_end_corrupted(current)) | ||
7329 | printk(KERN_EMERG "Thread overran stack, or stack corrupted\n"); | ||
7330 | |||
7328 | debug_show_held_locks(current); | 7331 | debug_show_held_locks(current); |
7329 | if (irqs_disabled()) | 7332 | if (irqs_disabled()) |
7330 | print_irqtrace_events(current); | 7333 | print_irqtrace_events(current); |