Re: [PATCH 2/5] sched: Add Lazy preemption model
From: Peter Zijlstra
Date: Wed Oct 09 2024 - 05:14:15 EST
On Wed, Oct 09, 2024 at 10:50:21AM +0200, Sebastian Andrzej Siewior wrote:
> On 2024-10-07 09:46:11 [+0200], Peter Zijlstra wrote:
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -1103,6 +1106,32 @@ void resched_curr(struct rq *rq)
> …
> > +static __always_inline int tif_need_resched_lazy(void)
>
> The naming is a bit confusing here because tif_need_resched() checks if
> the TIF_NEED_RESCHED is set while this returns the proper TIF bit
> instead.
Right you are; naming things be hard. How about: get_lazy_tif_bit() ?
There's only the single user anyway.
> > +{
> > + if (dynamic_preempt_lazy())
> > + return TIF_NEED_RESCHED_LAZY;
> > +
> > + return TIF_NEED_RESCHED;
> > +}
>
> Sebastian