lkml.org 
[lkml]   [2015]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 12/12] sched: Add preempt_count invariant check
On Wed, 30 Sep 2015 09:10:47 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> Ingo requested I keep my debug check for the preempt_count invariant.
>
> Requested-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@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,

Nuke the "unlikely" it's redundant with the WARN_ONCE().

-- Steve

> + "corrupted preempt_count: %s/%d/0x%x\n",
> + current->comm, current->pid, preempt_count())))
> + preempt_count_set(FORK_PREEMPT_COUNT);
>
> rq->prev_mm = NULL;
>
>



\
 
 \ /
  Last update: 2015-09-30 12:01    [W:0.156 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site