[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250617111157.36b1b17e@gandalf.local.home>
Date: Tue, 17 Jun 2025 11:11:57 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Lyude Paul <lyude@...hat.com>, rust-for-linux@...r.kernel.org, Thomas
Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org, Daniel Almeida
<daniel.almeida@...labora.com>, Ingo Molnar <mingo@...hat.com>, Peter
Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>, Dietmar Eggemann
<dietmar.eggemann@....com>, Ben Segall <bsegall@...gle.com>, Mel Gorman
<mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>, Will Deacon
<will@...nel.org>, Waiman Long <longman@...hat.com>, Miguel Ojeda
<ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>, Gary Guo
<gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>, Andreas
Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, Trevor
Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, David
Woodhouse <dwmw@...zon.co.uk>, Jens Axboe <axboe@...nel.dk>, Sebastian
Andrzej Siewior <bigeasy@...utronix.de>, NeilBrown <neilb@...e.de>, Caleb
Sander Mateos <csander@...estorage.com>, Ryo Takakura
<ryotkkr98@...il.com>, K Prateek Nayak <kprateek.nayak@....com>
Subject: Re: [RFC RESEND v10 03/14] irq & spin_lock: Add counted interrupt
disabling/enabling
On Tue, 17 Jun 2025 07:34:10 -0700
Boqun Feng <boqun.feng@...il.com> wrote:
> Because the new local_interrupt_{disable, enable}() participate the
> preempt count game as well, for example, __raw_spin_lock_irq_disable()
> doesn't call an additional preempt_disable() and
> __raw_spin_unlock_irq_enable() doesn't call preempt_enable(). And the
> following can happen:
>
> spin_lock(a);
> // preemption is disabled.
> <interrupted and set need_resched>
>
> spin_lock_irq_disable(b);
>
> spin_unlock(a);
> spin_unlock_irq_enable(b):
> local_interrupt_enable():
> // need to check should_resched, otherwise preemption won't
> // happen.
Ah, because preempt count can be set to non-zero *before* interrupts are
disabled. That makes sense. Thanks.
Hmm, I wonder if we should add a comment stating that here?
-- Steve
Powered by blists - more mailing lists