Re: [PATCH v10 18/20] timers: Implement the hierarchical pull model

From: Anna-Maria Behnsen
Date: Tue Jan 30 2024 - 11:45:17 EST


Frederic Weisbecker <frederic@xxxxxxxxxx> writes:

> Le Sun, Jan 28, 2024 at 04:58:55PM +0100, Anna-Maria Behnsen a écrit :
>> Frederic Weisbecker <frederic@xxxxxxxxxx> writes:
>> >> +
>> >> + if (tmigr_check_lonely(topgroup))
>> >> + return READ_ONCE(topgroup->next_expiry);
>>
>> When I hand in tevt->global as a parameter, I'll need to compare the
>> first expiry of the toplevel group and the tevt->global value and return
>> the earlier expiry. Only a single child is active in top level, so it
>> might be that this CPU is the last active CPU in hierarchy.
>>
>> I didn't check all the way to the top whether all groups are
>> 'lonely'. So when the top level group has only a single active child, it
>> is also possible that the child of the top level group has two active
>> children... Then a return of KTIME_MAX would be also a more precise
>> forecast.
>>
>> This quick check is there to keep the overhead minimal when checking
>> whether it might be possible to go idle. So I don't know, if we should
>> add this additional check per level (which is pretty simple when using
>> group->parent for walking the hierarchy). What do you think?
>
> Not sure. Maybe if the tree never exceeds 3 levels (does it?) it's ok to
> do the walk?

Levels depend on the number of CPUs and NUMA nodes

Take 4096 CPUs, all evenly distributed across 4 NUMA nodes, then you
will end up with 6 levels.

Thanks,

Anna-Maria