Re: [RFC 1/3] tick-sched: Remove last_tick and calculate next tick from now
From: Joel Fernandes
Date: Wed Nov 13 2024 - 16:40:51 EST
On Wed, Nov 13, 2024 at 01:40:17PM +0100, Frederic Weisbecker wrote:
> Le Tue, Nov 12, 2024 at 06:33:30PM +0000, Joel Fernandes a écrit :
> > On Tue, Nov 12, 2024 at 12:43:58AM +0100, Frederic Weisbecker wrote:
> > > > @@ -837,11 +837,9 @@ EXPORT_SYMBOL_GPL(get_cpu_iowait_time_us);
> > > >
> > > > static void tick_nohz_restart(struct tick_sched *ts, ktime_t now)
> > > > {
> > > > + /* Set the time to expire on the next tick and not some far away future. */
> > > > hrtimer_cancel(&ts->sched_timer);
> > > > - hrtimer_set_expires(&ts->sched_timer, ts->last_tick);
> > > > -
> > > > - /* Forward the time to expire in the future */
> > > > - hrtimer_forward(&ts->sched_timer, now, TICK_NSEC);
> > > > + hrtimer_set_expires(&ts->sched_timer, DIV_ROUND_UP_ULL(now, TICK_NSEC) * TICK_NSEC);
> > >
> > > We don't want to rewrite hrtimer_forward() but, after all, the current expiry is
> > > enough a relevant information.
> >
> > Thanks, do you envision any way we can get past the sched_skew_tick issue
> > Thomas mentioned, if we still want to do something like this patch?
>
> First, do we still want to do something like this patch? :-)
I am leaning to dropping it due to the skew issues mentioned which is a
gaping hole. And also the debug usecase you mentioned. At least I appreciate
why this mechanism exists now :-) Thank you both :-)
thanks,
- Joel