Re: [PATCH v2 1/3] sched/fair: Call newidle_balance() from balance_callback on PREEMPT_RT

From: Valentin Schneider
Date: Fri May 07 2021 - 11:19:26 EST


On 05/05/21 14:13, Vincent Guittot wrote:
> On Thu, 29 Apr 2021 at 01:28, Scott Wood <swood@xxxxxxxxxx> wrote:
>>
>> This is required in order to be able to enable interrupts in the next
>> patch. This is limited to PREEMPT_RT to avoid adding potentially
>> measurable overhead to the non-RT case (requiring a double switch when
>> pulling a task onto a newly idle cpu).
>
> IIUC, only the newidle_balance is a problem and not the idle load
> balance that runs softirq. In this case, why not skipping
> newidle_balance entirely in case of preempt_rt and kick an idle load
> balance instead as you switch to idle thread context anyway
>

So if I follow you, that would be along the lines of having PREEMPT_RT turn
newidle_balance() into:

rq->idle_balance = CPU_IDLE;
rq->next_balance = jiffies;
trigger_load_balance(rq);

which I'm thinking isn't too crazy.