[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150929103237.GA7520@twins.programming.kicks-ass.net>
Date: Tue, 29 Sep 2015 12:32:37 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: mingo@...nel.org
Cc: linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
fweisbec@...il.com, oleg@...hat.com, umgwanakikbuti@...il.com,
tglx@...utronix.de, rostedt@...dmis.org
Subject: Re: [RFC][PATCH 12/11] sched: Add preempt_count invariant check
On Tue, Sep 29, 2015 at 12:27:55PM +0200, Peter Zijlstra wrote:
>
> Ingo requested I keep my debug check for the preempt_count invariant.
>
> Requested-by: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
> kernel/sched/core.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2503,6 +2503,11 @@ static struct rq *finish_task_switch(str
> struct mm_struct *mm = rq->prev_mm;
> long prev_state;
>
> + if (unlikely(WARN_ONCE(preempt_count() != 2,
That should have: s/2/2*PREEMPT_DISABLE_OFFSET/ or something, otherwise
!PREEMPT_COUNT kernels will go funny.
> + "corrupted preempt_count: %s/%d/0x%x\n",
> + current->comm, current->pid, preempt_count())))
> + preempt_count_set(INIT_PREEMPT_COUNT);
> +
> rq->prev_mm = NULL;
>
> /*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists