From: Lyude Paul <lyude@redhat.com>
To: rust-for-linux@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>
Cc: Boqun Feng <boqun.feng@gmail.com>, Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
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>,
linux-kernel@vger.kernel.org (open list:SCHEDULER)
Subject: [PATCH v9 1/9] preempt: Introduce HARDIRQ_DISABLE_BITS
Date: Thu, 27 Feb 2025 17:10:12 -0500 [thread overview]
Message-ID: <20250227221924.265259-2-lyude@redhat.com> (raw)
In-Reply-To: <20250227221924.265259-1-lyude@redhat.com>
From: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
include/linux/preempt.h | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index ca86235ac15c0..e74ab9cf02af0 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -17,6 +17,7 @@
*
* - bits 0-7 are the preemption count (max preemption depth: 256)
* - bits 8-15 are the softirq count (max # of softirqs: 256)
+ * - bits 16-23 are the hardirq disable count (max # of hardirq disable: 256)
*
* The hardirq count could in theory be the same as the number of
* interrupts in the system, but we run all interrupt handlers with
@@ -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
#define PREEMPT_SHIFT 0
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
-#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
+#define HARDIRQ_DISABLE_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
+#define HARDIRQ_SHIFT (HARDIRQ_DISABLE_SHIFT + HARDIRQ_DISABLE_BITS)
#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
#define __IRQ_MASK(x) ((1UL << (x))-1)
#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
+#define HARDIRQ_DISABLE_MASK (__IRQ_MASK(SOFTIRQ_BITS) << HARDIRQ_DISABLE_SHIFT)
#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
+#define HARDIRQ_DISABLE_OFFSET (1UL << HARDIRQ_DISABLE_SHIFT)
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
#define NMI_OFFSET (1UL << NMI_SHIFT)
--
2.48.1
next parent reply other threads:[~2025-02-27 22:21 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 ` Lyude Paul [this message]
2025-02-27 23:09 ` [PATCH v9 1/9] preempt: Introduce HARDIRQ_DISABLE_BITS Steven Rostedt
2025-02-28 1:33 ` Boqun Feng
2025-03-03 21:55 ` Lyude Paul
2025-02-28 7:57 ` Peter Zijlstra
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=20250227221924.265259-2-lyude@redhat.com \
--to=lyude@redhat.com \
--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=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--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