linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug
@ 2012-05-10  7:54 Konstantin Khlebnikov
  2012-05-10 10:01 ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Konstantin Khlebnikov @ 2012-05-10  7:54 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel; +Cc: Andrew Morton, Peter Zijlstra

Usually sleep-in-atomic bugs are followed by dozens other warnings.
This patch should help to figure out original source of problem.
This taint flag also turns off lockdep, because it can go mad after that.

Original TAINT_UNSAFE_SMP is used only on various ancient buggy K7 Athlons.
TAINT_UNSAFE_SMP is shown as 'S' in "Tainted" line, so let it be acronym for
SMP, Scheduler and Sleep-in-atomic. Probably we should rename it into
TAINT_SHIT, but TAINT_CRAP is already there. =)

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 Documentation/oops-tracing.txt  |    2 +-
 Documentation/sysctl/kernel.txt |    1 +
 kernel/sched/core.c             |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/oops-tracing.txt b/Documentation/oops-tracing.txt
index 13032c0..ad9b9d8 100644
--- a/Documentation/oops-tracing.txt
+++ b/Documentation/oops-tracing.txt
@@ -237,7 +237,7 @@ characters, each representing a particular tainted value.
   3: 'S' if the oops occurred on an SMP kernel running on hardware that
      hasn't been certified as safe to run multiprocessor.
      Currently this occurs only on various Athlons that are not
-     SMP capable.
+     SMP capable. Also cpu scheduler sets this after sleep-in-atomic bug.
 
   4: 'R' if a module was force unloaded by "rmmod -f", ' ' if all
      modules were unloaded normally.
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index 6d78841..b573910 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -590,6 +590,7 @@ can be ORed together:
    2 - A module was force loaded by insmod -f.
        Set by modutils >= 2.4.9 and module-init-tools.
    4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
+       Also cpu scheduler sets this after sleep-in-atomic bug.
    8 - A module was forcibly unloaded from the system by rmmod -f.
   16 - A hardware machine check error occurred on the system.
   32 - A bad page was discovered on the system.
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0533a68..5e39914 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3113,6 +3113,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
 	if (irqs_disabled())
 		print_irqtrace_events(prev);
 	dump_stack();
+	add_taint(TAINT_UNSAFE_SMP);
 }
 
 /*


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-10  7:54 [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug Konstantin Khlebnikov
@ 2012-05-10 10:01 ` Peter Zijlstra
  2012-05-10 10:56   ` Konstantin Khlebnikov
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2012-05-10 10:01 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Ingo Molnar, linux-kernel, Andrew Morton

On Thu, 2012-05-10 at 11:54 +0400, Konstantin Khlebnikov wrote:
> Usually sleep-in-atomic bugs are followed by dozens other warnings.
> This patch should help to figure out original source of problem.
> This taint flag also turns off lockdep, because it can go mad after that.

There's already TAINT_WARN any output with that set should be ignored.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-10 10:01 ` Peter Zijlstra
@ 2012-05-10 10:56   ` Konstantin Khlebnikov
  2012-05-10 11:46     ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Konstantin Khlebnikov @ 2012-05-10 10:56 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Ingo Molnar, linux-kernel, Andrew Morton

Peter Zijlstra wrote:
> On Thu, 2012-05-10 at 11:54 +0400, Konstantin Khlebnikov wrote:
>> Usually sleep-in-atomic bugs are followed by dozens other warnings.
>> This patch should help to figure out original source of problem.
>> This taint flag also turns off lockdep, because it can go mad after that.
>
> There's already TAINT_WARN any output with that set should be ignored.

Where? I do not see here anything which might set TAINT_WARN.

Or you suggest to use TAINT_WARN instead of TAINT_UNSAFE_SMP?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-10 10:56   ` Konstantin Khlebnikov
@ 2012-05-10 11:46     ` Peter Zijlstra
  2012-05-10 12:20       ` [PATCH v2] sched: taint kernel with TAINT_WARN " Konstantin Khlebnikov
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2012-05-10 11:46 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Ingo Molnar, linux-kernel, Andrew Morton

On Thu, 2012-05-10 at 14:56 +0400, Konstantin Khlebnikov wrote:
> Peter Zijlstra wrote:
> > On Thu, 2012-05-10 at 11:54 +0400, Konstantin Khlebnikov wrote:
> >> Usually sleep-in-atomic bugs are followed by dozens other warnings.
> >> This patch should help to figure out original source of problem.
> >> This taint flag also turns off lockdep, because it can go mad after that.
> >
> > There's already TAINT_WARN any output with that set should be ignored.
> 
> Where? I do not see here anything which might set TAINT_WARN.
> 
> Or you suggest to use TAINT_WARN instead of TAINT_UNSAFE_SMP?

Gargh, yeah it doesn't use WARN and related infrastructure to print that
msg so it missed out on the whole TAINT_WARN stuff.

Yeah, make it set TAINT_WARN or possibly convert the thing to use WARN.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] sched: taint kernel with TAINT_WARN after sleep-in-atomic bug
  2012-05-10 11:46     ` Peter Zijlstra
@ 2012-05-10 12:20       ` Konstantin Khlebnikov
  2012-05-18  8:54         ` Peter Zijlstra
  2012-05-18 11:16         ` [tip:sched/core] sched: Taint " tip-bot for Konstantin Khlebnikov
  0 siblings, 2 replies; 7+ messages in thread
From: Konstantin Khlebnikov @ 2012-05-10 12:20 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Andrew Morton, Ingo Molnar, linux-kernel

Usually sleep-in-atomic bugs are followed by dozens other warnings.
This patch should help to figure out original source of problem.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 kernel/sched/core.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0533a68..b6458e4 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3113,6 +3113,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
 	if (irqs_disabled())
 		print_irqtrace_events(prev);
 	dump_stack();
+	add_taint(TAINT_WARN);
 }
 
 /*


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] sched: taint kernel with TAINT_WARN after sleep-in-atomic bug
  2012-05-10 12:20       ` [PATCH v2] sched: taint kernel with TAINT_WARN " Konstantin Khlebnikov
@ 2012-05-18  8:54         ` Peter Zijlstra
  2012-05-18 11:16         ` [tip:sched/core] sched: Taint " tip-bot for Konstantin Khlebnikov
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Zijlstra @ 2012-05-18  8:54 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: Andrew Morton, Ingo Molnar, linux-kernel

On Thu, 2012-05-10 at 16:20 +0400, Konstantin Khlebnikov wrote:
> Usually sleep-in-atomic bugs are followed by dozens other warnings.
> This patch should help to figure out original source of problem.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>

Thanks!

> ---
>  kernel/sched/core.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 0533a68..b6458e4 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3113,6 +3113,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
>  	if (irqs_disabled())
>  		print_irqtrace_events(prev);
>  	dump_stack();
> +	add_taint(TAINT_WARN);
>  }
>  
>  /*
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:sched/core] sched: Taint kernel with TAINT_WARN after sleep-in-atomic bug
  2012-05-10 12:20       ` [PATCH v2] sched: taint kernel with TAINT_WARN " Konstantin Khlebnikov
  2012-05-18  8:54         ` Peter Zijlstra
@ 2012-05-18 11:16         ` tip-bot for Konstantin Khlebnikov
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Konstantin Khlebnikov @ 2012-05-18 11:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, khlebnikov, tglx

Commit-ID:  1c2927f18576d65631d8e0ddd19e1d023183222e
Gitweb:     http://git.kernel.org/tip/1c2927f18576d65631d8e0ddd19e1d023183222e
Author:     Konstantin Khlebnikov <khlebnikov@openvz.org>
AuthorDate: Thu, 10 May 2012 16:20:04 +0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 18 May 2012 13:07:40 +0200

sched: Taint kernel with TAINT_WARN after sleep-in-atomic bug

Usually sleep-in-atomic bugs are followed by dozens other warnings.
This patch should help to figure out original source of problem.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20120510122004.4873.12726.stgit@zurg
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/sched/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 24ca677..ab9745f 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3138,6 +3138,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
 	if (irqs_disabled())
 		print_irqtrace_events(prev);
 	dump_stack();
+	add_taint(TAINT_WARN);
 }
 
 /*

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-18 11:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-10  7:54 [PATCH] sched: set TAINT_UNSAFE_SMP after sleep-in-atomic bug Konstantin Khlebnikov
2012-05-10 10:01 ` Peter Zijlstra
2012-05-10 10:56   ` Konstantin Khlebnikov
2012-05-10 11:46     ` Peter Zijlstra
2012-05-10 12:20       ` [PATCH v2] sched: taint kernel with TAINT_WARN " Konstantin Khlebnikov
2012-05-18  8:54         ` Peter Zijlstra
2012-05-18 11:16         ` [tip:sched/core] sched: Taint " tip-bot for Konstantin Khlebnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).