lkml.org 
[lkml]   [2023]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] sched/core: introduce sched_core_idle_cpu()
From


在 2023/7/4 下午1:39, Aaron Lu 写道:
>> +#ifdef CONFIG_SCHED_CORE
>> +int sched_core_idle_cpu(int cpu)
>> +{
>> + struct rq *rq = cpu_rq(cpu);
>> +
>> + if (sched_core_enabled(rq) && rq->curr == rq->idle)
>> + return 1;
>
> If the intention is to consider forced idle cpus as idle, then should
> the above condition written as:
>
> if (sched_core_enabled(rq) && rq->core->core_forceidle_count)
> return 1;
> ?
>
> Or as long as a single cookied task is running, all normal idle cpus are
> regarded forced idle here and 1 is returned while previously, idle_cpu()
> is called for those cpus and if they have wakeup task pending, they are
> not regarded as idle so looks like a behaviour change.
>
> Thanks,
> Aaron
>

I'll fix this problem in the next version.

Best,
Cruz Zhao

>> +
>> + return idle_cpu(cpu);
>> +}
>> +
>> +#endif
>> +
>> #ifdef CONFIG_SMP
>> /*
>> * This function computes an effective utilization for the given CPU, to be
>> diff --git a/kernel/softirq.c b/kernel/softirq.c
>> index c8a6913c067d..98b98991ce45 100644
>> --- a/kernel/softirq.c
>> +++ b/kernel/softirq.c
>> @@ -630,7 +630,7 @@ static inline void tick_irq_exit(void)
>> int cpu = smp_processor_id();
>>
>> /* Make sure that timer wheel updates are propagated */
>> - if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
>> + if ((sched_core_idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
>> if (!in_hardirq())
>> tick_nohz_irq_exit();
>> }
>> --
>> 2.27.0
>>

\
 
 \ /
  Last update: 2023-07-12 04:43    [W:0.095 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site