Re: [RFC PATCH 06/23] sched/core: Update the classification of the current task

From: Ricardo Neri
Date: Fri Sep 16 2022 - 10:45:14 EST


On Sat, Sep 10, 2022 at 03:21:20PM +0800, Hillf Danton wrote:
> On 9 Sep 2022 16:11:48 -0700 Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx> wrote:
> > @@ -5445,6 +5445,9 @@ void scheduler_tick(bool user_tick)
> > unsigned long thermal_pressure;
> > u64 resched_latency;
> >
> > + if (sched_task_classes_enabled() && user_tick)
> > + arch_update_task_class(curr, is_core_idle(cpu));
> > +
> > arch_scale_freq_tick();
> > sched_clock_tick();
>
Thank you very much for your feedback Hillf!

> Given user_tick == true, core is not idle regardless of SMT.
> IOW I doubt is_core_idle() helps here.

Perhaps is_core_idle() is a bad name? The second argument of arch_update_
task_class() is smt_siblings_idle. is_core_idle() gives us the answer
we want.

is_core_idle() only checks the siblings of @cpu. It explicitly skips itself
from the checks of idle state. We are only interested in the idle state of
the siblings.

Am I missing anything?

Thanks and BR,
Ricardo