lkml.org 
[lkml]   [2022]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 14/16] timer: Implement the hierarchical pull model
On Mon, 7 Nov 2022, Frederic Weisbecker wrote:

> On Fri, Nov 04, 2022 at 03:57:35PM +0100, Anna-Maria Behnsen wrote:
> > @@ -1859,6 +1863,36 @@ void forward_and_idle_timer_bases(unsigned long basej, u64 basem,
> > */
> > is_idle = time_after(nextevt, basej + 1);
> >
> > + if (is_idle) {
> > + u64 next_tmigr;
> > +
> > + next_tmigr = tmigr_cpu_deactivate(tevt->global);
> > +
> > + tevt->global = KTIME_MAX;
> > +
> > + /*
> > + * If CPU is the last going idle in timer migration
> > + * hierarchy, make sure CPU will wake up in time to handle
> > + * remote timers. next_tmigr == KTIME_MAX if other CPUs are
> > + * still active.
> > + */
> > + if (next_tmigr < tevt->local) {
> > + u64 tmp;
> > +
> > + /* If we missed a tick already, force 0 delta */
> > + if (next_tmigr < basem)
> > + next_tmigr = basem;
> > +
> > + tmp = div_u64(next_tmigr - basem, TICK_NSEC);
> > +
> > + nextevt = basej + (unsigned long)tmp;
> > + tevt->local = next_tmigr;
> > + is_idle = time_after(nextevt, basej + 1);
> > + } else {
> > + nextevt = nextevt_local;
>
> That else part look unecessary.

Yes, you are right. I will add a comment instead. Maybe someone wants to
improve it and then requires the proper nextevt...

> > + }
> > + }
> > +
> > /* We need to mark both bases in sync */
> > base_local->is_idle = base_global->is_idle = is_idle;
>
> Do we still need to maintain base_global->is_idle ?

is_idle information is required in trigger_dyntick_cpu(). I made a mistake
with the hunk in trigger_dyntick_cpu() introduced in this patch. Because
after this patch, global timers are still enqueued on any CPU because
crystallball still exists. trigger_dyntick_cpu() is also required for non
pinned timers. I need to move the hunk of trigger_dyntick_cpu() into the
last patch of the queue where crystallball is removed during enqueue and
there update also this line. Then I will drop the update of
base_global->is_idle in timer_clear_idle() as well.

Sorry. This went wrong during splitting and folding the queue back and
forwards...

> (I'm going to do daily reviews on this patch because it's quite dense :)

Thanks! I try to answer your questions fast. Let me know when you are done
or when you need an updated version for further review :)

Thanks,

Anna-Maria

\
 
 \ /
  Last update: 2022-11-08 17:17    [W:0.232 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site