All of lore.kernel.org
 help / color / mirror / Atom feed
* + sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug.patch added to -mm tree
@ 2012-05-17 23:22 akpm
  2012-05-18 10:48 ` [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug tip-bot for Konstantin Khlebnikov
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2012-05-17 23:22 UTC (permalink / raw)
  To: mm-commits; +Cc: khlebnikov, a.p.zijlstra, mingo, rdunlap


The patch titled
     From: Konstantin Khlebnikov <khlebnikov@openvz.org>
has been added to the -mm tree.  Its filename is
     sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
Subject: sched: set TAINT_UNSAFE_SMP 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.  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>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 Documentation/oops-tracing.txt  |    2 +-
 Documentation/sysctl/kernel.txt |    1 +
 kernel/sched/core.c             |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff -puN Documentation/oops-tracing.txt~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug Documentation/oops-tracing.txt
--- a/Documentation/oops-tracing.txt~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug
+++ a/Documentation/oops-tracing.txt
@@ -237,7 +237,7 @@ characters, each representing a particul
   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 -puN Documentation/sysctl/kernel.txt~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug Documentation/sysctl/kernel.txt
--- a/Documentation/sysctl/kernel.txt~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug
+++ a/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 -puN kernel/sched/core.c~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug kernel/sched/core.c
--- a/kernel/sched/core.c~sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug
+++ a/kernel/sched/core.c
@@ -3133,6 +3133,7 @@ static noinline void __schedule_bug(stru
 	if (irqs_disabled())
 		print_irqtrace_events(prev);
 	dump_stack();
+	add_taint(TAINT_UNSAFE_SMP);
 }
 
 /*
_
Subject: From: Konstantin Khlebnikov <khlebnikov@openvz.org>

Patches currently in -mm which might be from khlebnikov@openvz.org are

linux-next.patch
fs-proc-fix-abba-deadlock-in-case-of-execution-attempt-of-map_files-entries.patch
mm-remove-swap-token-code.patch
mm-vmscan-remove-lumpy-reclaim.patch
mm-vmscan-do-not-stall-on-writeback-during-memory-compaction.patch
mm-vmscan-remove-reclaim_mode_t.patch
mm-correctly-synchronize-rss-counters-at-exit-exec.patch
kernel-cgroup-push-rcu-read-locking-from-css_is_ancestor-to-callsite.patch
mm-memcg-count-pte-references-from-every-member-of-the-reclaimed-hierarchy.patch
mm-memcg-count-pte-references-from-every-member-of-the-reclaimed-hierarchy-fix.patch
bug-introduce-build_bug_on_invalid-macro.patch
bug-completely-remove-code-generated-by-disabled-vm_bug_on.patch
mm-memcg-scanning_global_lru-means-mem_cgroup_disabled.patch
mm-memcg-move-reclaim_stat-into-lruvec.patch
mm-push-lru-index-into-shrink_active_list.patch
mm-push-lru-index-into-shrink_active_list-fix.patch
mm-mark-mm-inline-functions-as-__always_inline.patch
mm-remove-lru-type-checks-from-__isolate_lru_page.patch
mm-memcg-kill-mem_cgroup_lru_del.patch
mm-memcg-use-vm_swappiness-from-target-memory-cgroup.patch
mm-vmscan-store-priority-in-struct-scan_control.patch
mm-add-link-from-struct-lruvec-to-struct-zone.patch
mm-vmscan-push-lruvec-pointer-into-isolate_lru_pages.patch
mm-vmscan-push-zone-pointer-into-shrink_page_list.patch
mm-vmscan-remove-update_isolated_counts.patch
mm-vmscan-push-lruvec-pointer-into-putback_inactive_pages.patch
mm-vmscan-replace-zone_nr_lru_pages-with-get_lruvec_size.patch
mm-vmscan-push-lruvec-pointer-into-inactive_list_is_low.patch
mm-vmscan-push-lruvec-pointer-into-shrink_list.patch
mm-vmscan-push-lruvec-pointer-into-get_scan_count.patch
mm-vmscan-push-lruvec-pointer-into-should_continue_reclaim.patch
mm-vmscan-kill-struct-mem_cgroup_zone.patch
mm-memcg-get_lru_size-not-get_lruvec_size.patch
mm-trivial-cleanups-in-vmscanc.patch
mm-memcg-apply-add-del_page-to-lruvec.patch
sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug.patch
proc-report-file-anon-bit-in-proc-pid-pagemap.patch
proc-smaps-carefully-handle-migration-entries.patch
proc-smaps-show-amount-of-nonlinear-ptes-in-vma.patch
proc-smaps-show-amount-of-hwpoison-pages.patch
fork-call-complete_vfork_done-after-clearing-child_tid-and-flushing-rss-counters.patch
c-r-prctl-add-ability-to-set-new-mm_struct-exe_file-update-after-mm-num_exe_file_vmas-removal.patch


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

* [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-17 23:22 + sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug.patch added to -mm tree akpm
@ 2012-05-18 10:48 ` tip-bot for Konstantin Khlebnikov
  2012-05-18 11:02   ` Peter Zijlstra
  0 siblings, 1 reply; 4+ messages in thread
From: tip-bot for Konstantin Khlebnikov @ 2012-05-18 10:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, rdunlap, akpm, khlebnikov, tglx

Commit-ID:  1d76f4381601a259323ad4faadce18db08ddebcd
Gitweb:     http://git.kernel.org/tip/1d76f4381601a259323ad4faadce18db08ddebcd
Author:     Konstantin Khlebnikov <khlebnikov@openvz.org>
AuthorDate: Thu, 17 May 2012 16:22:10 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 18 May 2012 09:51:08 +0200

sched: Set TAINT_UNSAFE_SMP 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.  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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Link: http://lkml.kernel.org/r/20120517232210.A292EA02FF@akpm.mtv.corp.google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 Documentation/oops-tracing.txt  |    2 +-
 Documentation/sysctl/kernel.txt |    1 +
 kernel/sched/core.c             |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

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 24ca677..b86eb50 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_UNSAFE_SMP);
 }
 
 /*

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

* Re: [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-18 10:48 ` [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug tip-bot for Konstantin Khlebnikov
@ 2012-05-18 11:02   ` Peter Zijlstra
  2012-05-18 12:10     ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Zijlstra @ 2012-05-18 11:02 UTC (permalink / raw)
  To: mingo, hpa, linux-kernel, rdunlap, akpm, khlebnikov, tglx
  Cc: linux-tip-commits

On Fri, 2012-05-18 at 03:48 -0700, tip-bot for Konstantin Khlebnikov
wrote:
> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

This is the patch I objected to.. 

> +++ 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_UNSAFE_SMP);
>  }

This should very much be TAINT_WARN.. it has nothing what so ever to do
with SMP.

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

* Re: [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug
  2012-05-18 11:02   ` Peter Zijlstra
@ 2012-05-18 12:10     ` Ingo Molnar
  0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2012-05-18 12:10 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: hpa, linux-kernel, rdunlap, akpm, khlebnikov, tglx, linux-tip-commits


* Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:

> On Fri, 2012-05-18 at 03:48 -0700, tip-bot for Konstantin Khlebnikov
> wrote:
> > Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> 
> This is the patch I objected to.. 

Yeah, I fixed it up, the latest one should be fine.

Thanks,

	Ingo

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-17 23:22 + sched-set-taint_unsafe_smp-after-sleep-in-atomic-bug.patch added to -mm tree akpm
2012-05-18 10:48 ` [tip:sched/core] sched: Set TAINT_UNSAFE_SMP after sleep-in-atomic bug tip-bot for Konstantin Khlebnikov
2012-05-18 11:02   ` Peter Zijlstra
2012-05-18 12:10     ` Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.