lkml.org 
[lkml]   [2022]   [Nov]   [9]   [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 Tue, Nov 08, 2022 at 06:02:11PM +0100, Anna-Maria Behnsen wrote:
> On Tue, 8 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);
> >
> > So after that, tevt->global shouldn't matter anymore for tick_nohz_next_event(),
> > right? If so then probably that line can go away (with a comment specifying why we can
> > ignore the global part)?:
> >
> > tevt.local = min_t(u64, tevt.local, tevt.global);
> >
>
> tevt->global is set to KTIME_MAX anyway. So the whole tevt information is
> also no longer required in tick_nohz_next_event(). I need to rework the
> patch where this was introduced. Then the forward_and_idle_timer_bases()
> could still simply return the next timer and then there is no longer a
> point against using your idea with naming of the functions.

You got it! ;-)

\
 
 \ /
  Last update: 2022-11-09 18:14    [W:0.094 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site