sched: Fix the PREEMPT_ACTIVE check in __trace_sched_switch_state()
authorOleg Nesterov <oleg@redhat.com>
Tue, 7 Oct 2014 19:51:08 +0000 (21:51 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 28 Oct 2014 09:47:53 +0000 (10:47 +0100)
commit8f9fbf092cd0ae31722b42c9abb427a87d55c18a
tree9ad6603648872c8eb69e9b8d52fae98a73b65b59
parent9de05d48711cd5314920ed05f873d84eaf66ccf1
sched: Fix the PREEMPT_ACTIVE check in __trace_sched_switch_state()

task_preempt_count() has nothing to do with the actual preempt counter,
thread_info->saved_preempt_count is only valid right after switch_to().

__trace_sched_switch_state() can use preempt_count(), prev is still the
current task when trace_sched_switch() is called.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
[ Added BUG_ON(). ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20141007195108.GB28002@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/trace/events/sched.h