Re: [PATCH v4 10/17] preempt: Introduce HAS_SEPARATE_PREEMPT_RESCHED_BITS
From: Boqun Feng
Date: Wed Aug 05 2026 - 03:27:14 EST
On Wed, Aug 05, 2026 at 12:45:04PM +0530, Shrikanth Hegde wrote:
>
> Hi Boqun.
>
> > > nit: This limit is because to have the same behavior as other case when
> > > NMI_BITS=4 right?
> > > It is not easy to infer that from comment.
> > >
> >
> > It's sort of design by implementation IIUC, previously because of
> > NMI_BITS=4, we could only support nesting level being 15. And here we
> > just want to keep the same behavior here.
>
> That I understood.
>
> >
> > If your question is why 15 was a good number before this change, I guess
> > would be it's just a number that is neither too big or too small.
>
> Its more about below comment. Something like below is better?
>
> /* NMI nesting is represented in 4 bits. */
>
Sounds good, I will apply this, thank you!
Regards,
Boqun
> >
> > > > + /* Maximum NMI nesting is 15. */ \
> > > > + BUG_ON(__this_cpu_read(nmi_nesting) >= 15); \
> > > > + __this_cpu_inc(nmi_nesting); \
> > > > + preempt_count_set(preempt_count() | NMI_MASK); \