Ingo requested I keep my debug check for the preempt_count invariant.

Requested-by: Ingo Molnar <mi...@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
---
 kernel/sched/core.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2514,6 +2514,10 @@ static struct rq *finish_task_switch(str
         *
         * Also, see FORK_PREEMPT_COUNT.
         */
+       if (unlikely(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;
 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to