[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140117133311.GG11314@laptop.programming.kicks-ass.net>
Date: Fri, 17 Jan 2014 14:33:11 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org,
linaro-kernel@...ts.linaro.org, alex.shi@...aro.org
Subject: Re: [PATCH 2/4] sched: Fix race in idle_balance()
On Fri, Jan 17, 2014 at 10:04:02AM +0100, Daniel Lezcano wrote:
> The scheduler main function 'schedule()' checks if there are no more tasks
> on the runqueue. Then it checks if a task should be pulled in the current
> runqueue in idle_balance() assuming it will go to idle otherwise.
>
> But the idle_balance() releases the rq->lock in order to lookup in the sched
> domains and takes the lock again right after. That opens a window where
> another cpu may put a task in our runqueue, so we won't go to idle but
> we have filled the idle_stamp, thinking we will.
>
> This patch closes the window by checking if the runqueue has been modified
> but without pulling a task after taking the lock again, so we won't go to idle
> right after in the __schedule() function.
Did you actually observe this or was it found by reading the code?
--
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