[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fe415a7-a396-508c-f459-0ddcc36f3360@oracle.com>
Date: Tue, 2 Jul 2019 09:32:27 -0700
From: Subhra Mazumdar <subhra.mazumdar@...cle.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Viresh Kumar <viresh.kumar@...aro.org>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>, tkjos@...gle.com,
Daniel Lezcano <daniel.lezcano@...aro.org>,
quentin.perret@...aro.org, chris.redpath@....com,
steven.sistare@...cle.com, songliubraving@...com
Subject: Re: [PATCH V3 2/2] sched/fair: Fallback to sched-idle CPU if idle CPU
isn't found
On 7/2/19 1:35 AM, Peter Zijlstra wrote:
> On Mon, Jul 01, 2019 at 03:08:41PM -0700, Subhra Mazumdar wrote:
>> On 7/1/19 1:03 AM, Viresh Kumar wrote:
>>> On 28-06-19, 18:16, Subhra Mazumdar wrote:
>>>> On 6/25/19 10:06 PM, Viresh Kumar wrote:
>>>>> @@ -5376,6 +5376,15 @@ static struct {
>>>>> #endif /* CONFIG_NO_HZ_COMMON */
>>>>> +/* CPU only has SCHED_IDLE tasks enqueued */
>>>>> +static int sched_idle_cpu(int cpu)
>>>>> +{
>>>>> + struct rq *rq = cpu_rq(cpu);
>>>>> +
>>>>> + return unlikely(rq->nr_running == rq->cfs.idle_h_nr_running &&
>>>>> + rq->nr_running);
>>>>> +}
>>>>> +
>>>> Shouldn't this check if rq->curr is also sched idle?
>>> Why wouldn't the current set of checks be enough to guarantee that ?
>> I thought nr_running does not include the on-cpu thread.
> It very much does.
>
>>>> And why not drop the rq->nr_running non zero check?
>>> Because CPU isn't sched-idle if nr_running and idle_h_nr_running are both 0,
>>> i.e. it is an IDLE cpu in that case. And so I thought it is important to have
>>> this check as well.
>>>
>> idle_cpu() not only checks nr_running is 0 but also rq->curr == rq->idle
> idle_cpu() will try very hard to declare a CPU !idle. But I don't see
> how that it relevant. sched_idle_cpu() will only return true if there
> are only SCHED_IDLE tasks on the CPU. Viresh's test is simple and
> straight forward.
OK makes sense.
Thanks,
Subhra
Powered by blists - more mailing lists