[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191106130838.GL5671@hirez.programming.kicks-ass.net>
Date: Wed, 6 Nov 2019 14:08:38 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Quentin Perret <qperret@...gle.com>
Cc: linux-kernel@...r.kernel.org, aaron.lwe@...il.com,
valentin.schneider@....com, mingo@...nel.org, pauld@...hat.com,
jdesfossez@...italocean.com, naravamudan@...italocean.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
juri.lelli@...hat.com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, kernel-team@...roid.com, john.stultz@...aro.org
Subject: Re: NULL pointer dereference in pick_next_task_fair
On Wed, Nov 06, 2019 at 01:05:25PM +0100, Peter Zijlstra wrote:
> On Mon, Oct 28, 2019 at 05:46:03PM +0000, Quentin Perret wrote:
> >
> > After digging a bit, the offending commit seems to be:
> >
> > 67692435c411 ("sched: Rework pick_next_task() slow-path")
> >
> > By 'offending' I mean that reverting it makes the issue go away. The
> > issue comes from the fact that pick_next_entity() returns a NULL se in
> > the 'simple' path of pick_next_task_fair(), which causes obvious
> > problems in the subsequent call to set_next_entity().
> >
> > I'll dig more, but if anybody understands the issue in the meatime feel
> > free to send me a patch to try out :)
>
> So for all those who didn't follow along on IRC, the below seems to cure
> things.
>
> The only thing I'm now considering is if we shouldn't be setting
> ->on_cpu=2 _before_ calling put_prev_task(). I'll go audit the RT/DL
> cases.
So I think it all works, but that's more by accident than anything else.
I'll move the ->on_cpu=2 assignment earlier. That clearly avoids calling
put_prev_task() while we're in put_prev_task().
Powered by blists - more mailing lists