Re: [RFC RESEND v10 03/14] irq & spin_lock: Add counted interrupt disabling/enabling

From: Boqun Feng
Date: Mon Jun 16 2025 - 14:17:09 EST


On Mon, Jun 16, 2025 at 02:10:01PM -0400, Joel Fernandes wrote:
> On Tue, May 27, 2025 at 06:21:44PM -0400, Lyude Paul wrote:
> > From: Boqun Feng <boqun.feng@xxxxxxxxx>
> >
> > Currently the nested interrupt disabling and enabling is present by
> > _irqsave() and _irqrestore() APIs, which are relatively unsafe, for
> > example:
> [...]
> > diff --git a/include/linux/irqflags_types.h b/include/linux/irqflags_types.h
> > index c13f0d915097a..277433f7f53eb 100644
> > --- a/include/linux/irqflags_types.h
> > +++ b/include/linux/irqflags_types.h
> > @@ -19,4 +19,10 @@ struct irqtrace_events {
> >
> > #endif
> >
> > +/* Per-cpu interrupt disabling state for local_interrupt_{disable,enable}() */
> > +struct interrupt_disable_state {
> > + unsigned long flags;
> > + long count;
>
> Is count unused? I found it in earlier series but not this one. Now count

You're right, the original proposal is to use a separate count, but it
turned out we can use preempt count.

> should be in the preempt counter, not in this new per-cpu var?
>
> Sorry if I missed it from some other patch in this series. thanks,
>

Nope, it's merely some code we forgot to clean up from the previous
version.

Regards,
Boqun

> - Joel
[...]