Commit e2bf1c4b authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

sched/core: Add preempt_count invariant check

Ingo requested I keep my debug check for the preempt_count invariant.
Requested-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 499d7955
...@@ -2514,6 +2514,10 @@ static struct rq *finish_task_switch(struct task_struct *prev) ...@@ -2514,6 +2514,10 @@ static struct rq *finish_task_switch(struct task_struct *prev)
* *
* Also, see FORK_PREEMPT_COUNT. * Also, see FORK_PREEMPT_COUNT.
*/ */
if (WARN_ONCE(preempt_count() != 2*PREEMPT_DISABLE_OFFSET,
"corrupted preempt_count: %s/%d/0x%x\n",
current->comm, current->pid, preempt_count()))
preempt_count_set(FORK_PREEMPT_COUNT);
rq->prev_mm = NULL; rq->prev_mm = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment