[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e3826a8d-98cc-4497-85ce-5d92e0556cea@linux.ibm.com>
Date: Thu, 11 Sep 2025 21:26:56 +0530
From: Shrikanth Hegde <sshegde@...ux.ibm.com>
To: K Prateek Nayak <kprateek.nayak@....com>
Cc: vschneid@...hat.com, iii@...ux.ibm.com, huschle@...ux.ibm.com,
rostedt@...dmis.org, dietmar.eggemann@....com, vineeth@...byteword.org,
jgross@...e.com, pbonzini@...hat.com, seanjc@...gle.com,
mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, tglx@...utronix.de, yury.norov@...il.com,
maddy@...ux.ibm.com, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, gregkh@...uxfoundation.org
Subject: Re: [RFC PATCH v3 05/10] sched/fair: Don't consider paravirt CPUs for
wakeup and load balance
On 9/11/25 10:53 AM, K Prateek Nayak wrote:
> Hello Shrikanth,
>
> On 9/10/2025 11:12 PM, Shrikanth Hegde wrote:
>> @@ -8563,7 +8563,7 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
>> if (!is_rd_overutilized(this_rq()->rd)) {
>> new_cpu = find_energy_efficient_cpu(p, prev_cpu);
>> if (new_cpu >= 0)
>> - return new_cpu;
>> + goto check_new_cpu;
>
> Should this fallback to the overutilized path if the most energy
> efficient CPU is found to be paravirtualized or should
> find_energy_efficient_cpu() be made aware of it?
>
>> new_cpu = prev_cpu;
>> }
>>
>> @@ -8605,7 +8605,12 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
>> }
>> rcu_read_unlock();
>>
>> - return new_cpu;
>> + /* If newly found or prev_cpu is a paravirt cpu, use current cpu */
>> +check_new_cpu:
>> + if (is_cpu_paravirt(new_cpu))
>> + return cpu;
>> + else
>
> nit. redundant else.
>
Do you mean "is_cpu_paravirt(new_cpu) ? cpu; new_cpu"
This needs to return cpu instead of true/false. maybe i not seeing the obvious.
>> + return new_cpu;
>> }
>>
>> /*
>> @@ -11734,6 +11739,12 @@ static int sched_balance_rq(int this_cpu, struct rq *this_rq,
>>
>> cpumask_and(cpus, sched_domain_span(sd), cpu_active_mask);
>>
>> +#ifdef CONFIG_PARAVIRT
>> + /* Don't spread load to paravirt CPUs */
>> + if (static_branch_unlikely(&cpu_paravirt_push_tasks))
>> + cpumask_andnot(cpus, cpus, cpu_paravirt_mask);
>> +#endif
>
> Can something similar be also be done in select_idle_sibling() and
> sched_balance_find_dst_cpu() for wakeup path?
That's a good suggestion. don't make a choice which is a paravirt CPU.
Will explore.
>
>> +
>> schedstat_inc(sd->lb_count[idle]);
>>
>> redo:
Powered by blists - more mailing lists