Messages in this thread | | | Date | Wed, 12 Jul 2023 10:41:11 +0800 | Subject | Re: [PATCH v3] sched/core: introduce sched_core_idle_cpu() | From | cruzzhao <> |
| |
在 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 >>
| |