Re: [PATCH v4 10/17] preempt: Introduce HAS_SEPARATE_PREEMPT_RESCHED_BITS

Shrikanth Hegde <[email protected]> Wed, 5 Aug 2026 12:45:04 +0530
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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. */

> 
>>> +		/* 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);  \