public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Lyude Paul <lyude@redhat.com>
Cc: rust-for-linux@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Boqun Feng <boqun.feng@gmail.com>, Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	"open list:SCHEDULER" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9 1/9] preempt: Introduce HARDIRQ_DISABLE_BITS
Date: Fri, 28 Feb 2025 08:57:55 +0100	[thread overview]
Message-ID: <20250228075755.GC5880@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250227221924.265259-2-lyude@redhat.com>

On Thu, Feb 27, 2025 at 05:10:12PM -0500, Lyude Paul wrote:

> @@ -26,29 +27,34 @@
>   *
>   *         PREEMPT_MASK:	0x000000ff
>   *         SOFTIRQ_MASK:	0x0000ff00
> - *         HARDIRQ_MASK:	0x000f0000
> - *             NMI_MASK:	0x00f00000
> + * HARDIRQ_DISABLE_MASK:	0x00ff0000
> + *         HARDIRQ_MASK:	0x07000000
> + *             NMI_MASK:	0x38000000
>   * PREEMPT_NEED_RESCHED:	0x80000000
>   */
>  #define PREEMPT_BITS	8
>  #define SOFTIRQ_BITS	8
> -#define HARDIRQ_BITS	4
> -#define NMI_BITS	4
> +#define HARDIRQ_DISABLE_BITS	8
> +#define HARDIRQ_BITS	3
> +#define NMI_BITS	3

I'm a bit scared here. This reduces the number of NMI levels from 16 to
8, and we have 5 IST gates that can nest in wonderful ways. This might
just be achievable.

Also, you should probably double check the HARDIRQ bits against all
architectures that have interrupt priority support -- Linux doesn't
really do that, local_irq_disable() is typically disable-all, but things
like PowerPC play funny games -- ideally those games are all played
before entering the common code that has the accounting on.

And I don't think we have overflow detection on the NMI/IRQ bits.

The comment with __nmi_enter() is now wrong.


Anyway, like I said before, I like the general idea, but I hate we're
growing a 3rd form.



  parent reply	other threads:[~2025-02-28  7:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250227221924.265259-1-lyude@redhat.com>
2025-02-27 22:10 ` [PATCH v9 1/9] preempt: Introduce HARDIRQ_DISABLE_BITS Lyude Paul
2025-02-27 23:09   ` Steven Rostedt
2025-02-28  1:33     ` Boqun Feng
2025-03-03 21:55       ` Lyude Paul
2025-02-28  7:57   ` Peter Zijlstra [this message]
2025-02-27 22:10 ` [PATCH v9 2/9] preempt: Introduce __preempt_count_{sub, add}_return() Lyude Paul
2025-02-28  1:49   ` Boqun Feng
2025-02-28  9:15   ` Heiko Carstens
2025-02-28  9:24     ` Peter Zijlstra
2025-04-30 21:38     ` Lyude Paul
2025-05-05  9:56       ` Heiko Carstens
2025-03-01 18:49   ` kernel test robot
2025-03-01 19:00   ` kernel test robot
2025-02-27 22:10 ` [PATCH v9 3/9] irq & spin_lock: Add counted interrupt disabling/enabling Lyude Paul
2025-03-01 20:19   ` kernel test robot
2025-02-27 22:10 ` [PATCH v9 4/9] rust: Introduce interrupt module Lyude Paul
2025-03-02 16:56   ` Dirk Behme
2025-02-27 22:10 ` [PATCH v9 5/9] rust: helper: Add spin_{un,}lock_irq_{enable,disable}() helpers Lyude Paul
2025-02-27 22:10 ` [PATCH v9 6/9] rust: sync: Add SpinLockIrq Lyude Paul
2025-03-02 11:51   ` Guangbo Cui
2025-03-03 22:15     ` Lyude Paul
2025-03-02 17:07   ` Dirk Behme
2025-04-04 21:56     ` Lyude Paul
2025-02-27 22:10 ` [PATCH v9 7/9] rust: sync: Introduce lock::Backend::Context Lyude Paul
2025-03-03 14:22   ` Dirk Behme
2025-02-27 22:10 ` [PATCH v9 8/9] rust: sync: lock: Add `Backend::BackendInContext` Lyude Paul
2025-03-03 14:23   ` Dirk Behme
2025-02-27 22:10 ` [PATCH v9 9/9] locking: Switch to _irq_{disable,enable}() variants in cleanup guards Lyude Paul
2025-04-05  8:25   ` Guangbo Cui
2025-04-05  8:55     ` Guangbo Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250228075755.GC5880@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun.feng@gmail.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox