From: Manuel Ebner <manuelebner@mailbox.org>
To: Karl Mehltretter <kmehltretter@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Boqun Feng <boqun@kernel.org>, Lyude Paul <lyude@redhat.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
Alexander Potapenko <glider@google.com>,
Marco Elver <elver@google.com>, Jonathan Corbet <corbet@lwn.net>,
Bradley Morgan <brads@mainlining.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
"Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
Subject: Re: [PATCH v6] softirq: Preserve interrupt context during IRQ exit
Date: Sun, 11 Oct 2026 11:15:39 +0200 [thread overview]
Message-ID: <e1f99f25ebd6153bca81b36646869a080bf19b35.camel@mailbox.org> (raw)
In-Reply-To: <20261011060742.30584-1-kmehltretter@gmail.com>
Hi Karl,
there's no issue with your patch but I have a question. There is
'irqentry_enter()' instead of 'irq_entry_enter()' which would fit
better into the naming scheme. I guess the root cause is in
kernel/entry/common.c .
Is there a reason for the dropped '_' ? Else I would make a patch to unify
the naming scheme.
Thanks
Manuel Ebner
On Sun, 2026-10-11 at 08:07 +0200, Karl Mehltretter wrote:
> __irq_exit_rcu() removes HARDIRQ_OFFSET from preempt_count() before
> the IRQ exit work. On the outermost IRQ exit, with no NMI or softirq
> state remaining, this makes context checks report task context. The
> softirq-dispatch, timer-wakeup and tick-exit checks account for the early
> decrement, but other code reached in this window sees the wrong context:
>
> [...]
>
> diff --git a/Documentation/core-api/entry.rst b/Documentation/core-api/entry.rst
> index 79fdaed954d9..09942135aad1 100644
> --- a/Documentation/core-api/entry.rst
> +++ b/Documentation/core-api/entry.rst
> @@ -197,8 +197,9 @@ return true, handles NOHZ tick state and interrupt time accounting. This
> means that up to the point where irq_enter_rcu() is invoked in_hardirq()
> returns false.
>
> -irq_exit_rcu() handles interrupt time accounting, undoes the preemption
> -count update and eventually handles soft interrupts and NOHZ tick state.
> +irq_exit_rcu() handles interrupt time accounting, handles soft interrupts if
> +possible, handles the NOHZ tick state and finally undoes the preemption count
> +update.
>
> In theory, the preemption count could be updated in irqentry_enter(). In
Here in entry.rst
> practice, deferring this update to irq_enter_rcu() allows the preemption-count
>
> [...]
next prev parent reply other threads:[~2026-10-11 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 6:07 [PATCH v6] softirq: Preserve interrupt context during IRQ exit Karl Mehltretter
2026-10-11 9:15 ` Manuel Ebner [this message]
2026-10-11 9:31 ` Bradley Morgan
2026-10-12 19:08 ` Karl Mehltretter
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=e1f99f25ebd6153bca81b36646869a080bf19b35.camel@mailbox.org \
--to=manuelebner@mailbox.org \
--cc=bigeasy@linutronix.de \
--cc=boqun@kernel.org \
--cc=brads@mainlining.org \
--cc=clrkwllms@kernel.org \
--cc=corbet@lwn.net \
--cc=elver@google.com \
--cc=frederic@kernel.org \
--cc=glider@google.com \
--cc=joelagnelf@nvidia.com \
--cc=kmehltretter@gmail.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=lyude@redhat.com \
--cc=mkchauras@gmail.com \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=tglx@kernel.org \
/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