On Tue, Jul 08, 2025 at 10:09:45AM -0300, Wander Lairson Costa wrote: > On Mon, Jul 07, 2025 at 01:26:22PM +0200, Peter Zijlstra wrote: > > On Fri, Jul 04, 2025 at 02:07:43PM -0300, Wander Lairson Costa wrote: > > > +#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_TRACE_PREEMPT_TOGGLE) > > > +#define preempt_count_dec_and_test() \ > > > + ({ preempt_count_sub(1); should_resched(0); }) > > > +#endif > > > > Also this is terrible. Surely you can do better. > > > > Thank you for pointing this out. I'm not sure I've fully understood the > concern here. My understanding was that this logic was pre-existing and > my patch only reorganized it. > > I'm clearly missing something. Could you please elaborate a bit on the > issue you've spotted?
The normal (!DEBUG) case uses __preempt_count_dec_and_test(), which is significantly better.