diff options
| author | Boqun Feng <boqun@kernel.org> | 2026-10-01 10:25:18 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2026-10-02 11:47:14 +0200 |
| commit | 1259028ec8f2a788cf560b40efca2c1fa74da89c (patch) | |
| tree | 8a506ef2e1f695cd112ecf0ec379b060163c7d9d /include | |
| parent | 9e174422f6f15a1d88994a07067f66c920d2f947 (diff) | |
| download | linux-next-1259028ec8f2a788cf560b40efca2c1fa74da89c.tar.gz linux-next-1259028ec8f2a788cf560b40efca2c1fa74da89c.zip | |
irq: Explain better on NMI_MASK overflow condition
Currently __preempt_count_nmi_enter() uses 15 as the maximum NMI nesting
level, and it's because 4 bits are used to represent the nesting level
of NMI. Replace the tautological comment with a more direct mention to
the 4 bits limitation to help readers understand this condition.
Suggested-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Boqun Feng <boqun@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Link: https://patch.msgid.link/20261001082519.16195-5-boqun@kernel.org
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hardirq.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 73b48dd9f135..2648c49cd8f6 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h @@ -108,7 +108,7 @@ DECLARE_PER_CPU(unsigned int, nmi_nesting); #define __preempt_count_nmi_enter() \ do { \ __preempt_count_add(HARDIRQ_OFFSET); \ - /* Maximum NMI nesting is 15. */ \ + /* NMI nesting is represented in 4 bits. */ \ BUG_ON(__this_cpu_read(nmi_nesting) >= 15); \ __this_cpu_inc(nmi_nesting); \ preempt_count_set(preempt_count() | NMI_MASK); \ |
