[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YyrMTcL5uSftPej7@hirez.programming.kicks-ass.net>
Date: Wed, 21 Sep 2022 10:33:17 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Waiman Long <longman@...hat.com>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] locking/qspinlock: Do spin-wait in slowpath if
preemptible
On Tue, Sep 20, 2022 at 03:55:42PM -0400, Waiman Long wrote:
> There are some code paths in the kernel where arch_spin_lock() will be
> called directly when the lock isn't expected to be contended and critical
> section is short. For example, tracing_saved_cmdlines_size_read()
> in kernel/trace/trace.c does that.
>
> In most cases, preemption is also not disabled. This creates a problem
> for the qspinlock slowpath which expects preemption to be disabled
Using arch_spin_lock() without disabling preemption is a straight up
bug. Don't work around that.
Powered by blists - more mailing lists