lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87wm447imf.fsf@t14s.mail-host-address-is-not-set>
Date: Wed, 05 Nov 2025 13:45:44 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: Lyude Paul <lyude@...hat.com>, rust-for-linux@...r.kernel.org, Thomas
 Gleixner <tglx@...utronix.de>, Boqun Feng <boqun.feng@...il.com>,
 linux-kernel@...r.kernel.org, Daniel Almeida
 <daniel.almeida@...labora.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...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>, Alice Ryhl <aliceryhl@...gle.com>, Trevor
 Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>
Subject: Re: [PATCH v13 11/17] rust: sync: lock: Add
 `Backend::BackendInContext`

Lyude Paul <lyude@...hat.com> writes:

> From: Boqun Feng <boqun.feng@...il.com>
>
> `SpinLock`'s backend can be used for `SpinLockIrq`, if the interrupts are
> disabled. And it actually provides performance gains since interrupts are
> not needed to be disabled anymore. So add `Backend::BackendInContext` to
> describe the case where one backend can be used for another. Use it to
> implement the `lock_with()` so that `SpinLockIrq` can avoid disabling
> interrupts by using `SpinLock`'s backend.
>
> Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> Co-developed-by: Lyude Paul <lyude@...hat.com>
> Signed-off-by: Lyude Paul <lyude@...hat.com>

I am not convinced this makes sense. This saves us only a few
instructions. We already have a counter on C side, so we are not going
to update the interrupt control register if we don't need to.

I'd like to see a micro benchmark showcasing the gains that we get from
this complexity.


Best regards,
Andreas Hindborg



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ