[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161201123316.GZ3924@linux.vnet.ibm.com>
Date: Thu, 1 Dec 2016 04:33:16 -0800
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Petr Mladek <pmladek@...e.com>,
Vince Weaver <vincent.weaver@...ne.edu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
"dvyukov@...gle.com" <dvyukov@...gle.com>
Subject: Re: perf: fuzzer BUG: KASAN: stack-out-of-bounds in __unwind_start
On Thu, Dec 01, 2016 at 06:52:35AM +0100, Peter Zijlstra wrote:
> On Wed, Nov 30, 2016 at 01:13:03PM -0600, Josh Poimboeuf wrote:
> > This question was probably intended for other folks, but I should point
> > out that idle tasks *do* invoke the scheduler. cpu_idle_loop() calls
> > schedule_preempt_disabled().
>
> Right, but that doesn't matter I think. The below will simply not call
> rcu_note_voluntary_context_switch() from the idle task, which would be
> fine I think.
>
> > > So is the following a sensible approach, or should I look elsewhere?
> > >
> > > #define cond_resched_rcu_qs() \
> > > do { \
> > > if (!is_idle_task(current) && !cond_resched()) \
> > > rcu_note_voluntary_context_switch(current); \
>
> You should reverse your conditions though:
>
> if (!cond_resched() && !is_idle_task(current))
> rcu_note_voluntary_context_switch(current);
>
> That way we'll still do cond_resched() and you only gate the RCU call.
This makes it illegal at early boot. This is not a problem with the
surviving cond_resched_rcu_qs(), but one of the candidates really was
called at boot time. If I reverse the order as you say, I can just as
well leave of the "!is_idle_task(current)".
So I will just drop this patch until such time as someone actually needs
to add a cond_resched_rcu_qs() that sometimes gets invoked at boot time.
Thanx, Paul
Powered by blists - more mailing lists