Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1235938

Re: [PATCH v2 12/12] sched: Add preempt_count invariant check

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 12/12] sched: Add preempt_count invariant check
Date 2015-09-30 11:40 +0200
Message-ID <qem1J-Zq-13@gated-at.bofh.it> (permalink)
References <qek9A-6Kx-13@gated-at.bofh.it> <qek9C-6Kx-61@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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;
>  
> 

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/12] sched: Killing PREEMPT_ACTIVE Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
  [PATCH v2 04/12] sched: Add preempt argument to __schedule() Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
  [PATCH v2 06/12] sched: Stop setting PREEMPT_ACTIVE Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
    Re: [PATCH v2 06/12] sched: Stop setting PREEMPT_ACTIVE Frederic Weisbecker <fweisbec@gmail.com> - 2015-10-01 17:30 +0200
  [PATCH v2 08/12] sched: Simplify preempt_count tests Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
    Re: [PATCH v2 08/12] sched: Simplify preempt_count tests Frederic Weisbecker <fweisbec@gmail.com> - 2015-10-01 17:40 +0200
  [PATCH v2 12/12] sched: Add preempt_count invariant check Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
    Re: [PATCH v2 12/12] sched: Add preempt_count invariant check Steven Rostedt <rostedt@goodmis.org> - 2015-09-30 11:40 +0200
      Re: [PATCH v2 12/12] sched: Add preempt_count invariant check Peter Zijlstra <peterz@infradead.org> - 2015-09-30 13:20 +0200
  [PATCH v2 11/12] sched: More notrace Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
  [PATCH v2 01/12] sched: Simplify INIT_PREEMPT_COUNT Peter Zijlstra <peterz@infradead.org> - 2015-09-30 09:40 +0200
    Re: [PATCH v2 01/12] sched: Simplify INIT_PREEMPT_COUNT Steven Rostedt <rostedt@goodmis.org> - 2015-09-30 11:10 +0200
      Re: [PATCH v2 01/12] sched: Simplify INIT_PREEMPT_COUNT Thomas Gleixner <tglx@linutronix.de> - 2015-09-30 22:50 +0200
    Re: [PATCH v2 01/12] sched: Simplify INIT_PREEMPT_COUNT Frederic Weisbecker <fweisbec@gmail.com> - 2015-10-01 15:30 +0200

csiph-web