[PATCH v2 6/6] sched: Default enable HRTICK

Peter Zijlstra posted 6 patches 2 weeks, 4 days ago
[PATCH v2 6/6] sched: Default enable HRTICK
Posted by Peter Zijlstra 2 weeks, 4 days ago
... for generic entry architectures. This decouples preemption from
CONFIG_HZ, leaving only the periodic load-balancer and various
accounting things relying on the tick.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/sched/features.h |    5 +++++
 1 file changed, 5 insertions(+)

--- a/kernel/sched/features.h
+++ b/kernel/sched/features.h
@@ -63,8 +63,13 @@ SCHED_FEAT(DELAY_ZERO, true)
  */
 SCHED_FEAT(WAKEUP_PREEMPTION, true)
 
+#ifdef TIF_HRTIMER_REARM
+SCHED_FEAT(HRTICK, true)
+SCHED_FEAT(HRTICK_DL, true)
+#else
 SCHED_FEAT(HRTICK, false)
 SCHED_FEAT(HRTICK_DL, false)
+#endif
 
 /*
  * Decrement CPU capacity based on time not spent running tasks
Re: [PATCH v2 6/6] sched: Default enable HRTICK
Posted by Phil Auld 2 weeks, 3 days ago
Hi Peter,

On Wed, Jan 21, 2026 at 05:20:16PM +0100 Peter Zijlstra wrote:
> ... for generic entry architectures. This decouples preemption from
> CONFIG_HZ, leaving only the periodic load-balancer and various
> accounting things relying on the tick.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  kernel/sched/features.h |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- a/kernel/sched/features.h
> +++ b/kernel/sched/features.h
> @@ -63,8 +63,13 @@ SCHED_FEAT(DELAY_ZERO, true)
>   */
>  SCHED_FEAT(WAKEUP_PREEMPTION, true)
>  
> +#ifdef TIF_HRTIMER_REARM
> +SCHED_FEAT(HRTICK, true)
> +SCHED_FEAT(HRTICK_DL, true)
> +#else
>  SCHED_FEAT(HRTICK, false)
>  SCHED_FEAT(HRTICK_DL, false)
> +#endif

I maybe be missing something. But the title of this patch
and the above code do not seem to match.


Cheers,
Phil

>  
>  /*
>   * Decrement CPU capacity based on time not spent running tasks
> 
> 
> 

--
Re: [PATCH v2 6/6] sched: Default enable HRTICK
Posted by Peter Zijlstra 2 weeks, 3 days ago
On Wed, Jan 21, 2026 at 05:24:44PM -0500, Phil Auld wrote:
> Hi Peter,
> 
> On Wed, Jan 21, 2026 at 05:20:16PM +0100 Peter Zijlstra wrote:
> > ... for generic entry architectures. This decouples preemption from
> > CONFIG_HZ, leaving only the periodic load-balancer and various
> > accounting things relying on the tick.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> >  kernel/sched/features.h |    5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > --- a/kernel/sched/features.h
> > +++ b/kernel/sched/features.h
> > @@ -63,8 +63,13 @@ SCHED_FEAT(DELAY_ZERO, true)
> >   */
> >  SCHED_FEAT(WAKEUP_PREEMPTION, true)
> >  
> > +#ifdef TIF_HRTIMER_REARM

Arguably this should be CONFIG_GENERIC_ENTRY I suppose

> > +SCHED_FEAT(HRTICK, true)
> > +SCHED_FEAT(HRTICK_DL, true)
> > +#else
> >  SCHED_FEAT(HRTICK, false)
> >  SCHED_FEAT(HRTICK_DL, false)
> > +#endif
> 
> I maybe be missing something. But the title of this patch
> and the above code do not seem to match.

You mean it only default enables it for a subset of architectures?
Re: [PATCH v2 6/6] sched: Default enable HRTICK
Posted by Phil Auld 2 weeks, 3 days ago
On Thu, Jan 22, 2026 at 12:40:54PM +0100 Peter Zijlstra wrote:
> On Wed, Jan 21, 2026 at 05:24:44PM -0500, Phil Auld wrote:
> > Hi Peter,
> > 
> > On Wed, Jan 21, 2026 at 05:20:16PM +0100 Peter Zijlstra wrote:
> > > ... for generic entry architectures. This decouples preemption from
> > > CONFIG_HZ, leaving only the periodic load-balancer and various
> > > accounting things relying on the tick.
> > > 
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > ---
> > >  kernel/sched/features.h |    5 +++++
> > >  1 file changed, 5 insertions(+)
> > > 
> > > --- a/kernel/sched/features.h
> > > +++ b/kernel/sched/features.h
> > > @@ -63,8 +63,13 @@ SCHED_FEAT(DELAY_ZERO, true)
> > >   */
> > >  SCHED_FEAT(WAKEUP_PREEMPTION, true)
> > >  
> > > +#ifdef TIF_HRTIMER_REARM
> 
> Arguably this should be CONFIG_GENERIC_ENTRY I suppose
> 
> > > +SCHED_FEAT(HRTICK, true)
> > > +SCHED_FEAT(HRTICK_DL, true)
> > > +#else
> > >  SCHED_FEAT(HRTICK, false)
> > >  SCHED_FEAT(HRTICK_DL, false)
> > > +#endif
> > 
> > I maybe be missing something. But the title of this patch
> > and the above code do not seem to match.
> 
> You mean it only default enables it for a subset of architectures?
>

Nope, I mean I can't read... nevermind.


Cheers,
Phil

--