kernel/locking/spinlock_debug.c | 4 ++-- rust/kernel/sync/lock.rs | 41 +++++++++++++++++++++++++++++++++++++---- rust/kernel/sync/lock/global.rs | 5 ++++- 3 files changed, 43 insertions(+), 7 deletions(-)
Hi Peter & Ingo,
Please pull this (mostly) Rust locking changes to tip. It's a bit late
than usual because I was at Kangrejos conference this week, however the
changes are relatively small and simple, so I think it's Ok for v6.18.
I also try using "git notes" for submission links as Thomas suggests,
let see how it goes ;-)
The following changes since commit 17d9f8eaa87d40a2ff66598875a43363e37a909b:
MAINTAINERS: update atomic infrastructure entry to include Rust (2025-09-15 09:38:36 +0200)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/ tags/rust-locking.2025.09.19a
for you to fetch changes up to 9622209360c25d78a81048a9db72f1efef7fbc58:
rust: lock: Add a Pin<&mut T> accessor (2025-09-15 22:28:35 -0400)
Regards,
Boqun
----------------------------------------------------------------
Locking changes for v6.18:
- Fix a data-race in do_raw_write_lock reported by KCSAN
Rust locking changes for v6.18
- Make `data` in `Lock` structurally pinned.
Previously the `data` field of a `Lock<T>` is not structurally pinned,
and it's impossible to initialize the `data` field with a
pin-initializer, hence e.g. a `Lock<T>` where T is a pin-initialized
type is not supported. This encourages workarounds like
`Lock<Pin<KBox<T>>`, which is more complicated and less efficient.
Therefore make the `data` field in `Lock` structurally pinned to
support pin-initialized types in a `Lock<T>`.
Since the `data` field is structurally pinned, make `Guard<T, ...>`
only `DerefMut` is T is Unpin, otherwise `Guard::as_mut()` is added to
provide a `Pin<&mut T>`. This is different than normal Rust standand
library locks.
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAmjNGoEACgkQSXnow7UH
+riU8ggAnRUTBam8NTmHJpZfVbbNSfx1ndaARxd9Wb/MLEh8OHYKbVRPJwvWGge+
dafO0VYULku7ho1SeIlLXp4Bbjy3YC6o/J6xOpr9xMmysUky7RHi+Ys0y9gKaSmW
daPurQEOS8TBUWu5yVxNAfWoRgPEiPULovbzgANKKAV7QsljyoEg7mQCPxLftPze
Hr22HxU+lr6SDH5Efc8ihGqXJAvwunk+0mkJymZbjWo3ZF3cuhXlTMcIlu1SK14a
R1VQu5UoX8S5y0T0gkJ84UJ11e0wrSZyT0EqmHWSpVBnyGgWk8H1u284hDiGG2iG
FvwoSQ9iVuxLhxjhPUSOjq30DzmFfg==
=MZj4
-----END PGP SIGNATURE-----
----------------------------------------------------------------
Alexander Sverdlin (1):
locking/spinlock/debug: Fix data-race in do_raw_write_lock
Daniel Almeida (3):
rust: lock: guard: Add T: Unpin bound to DerefMut
rust: lock: Pin the inner data
rust: lock: Add a Pin<&mut T> accessor
kernel/locking/spinlock_debug.c | 4 ++--
rust/kernel/sync/lock.rs | 41 +++++++++++++++++++++++++++++++++++++----
rust/kernel/sync/lock/global.rs | 5 ++++-
3 files changed, 43 insertions(+), 7 deletions(-)
On Fri, Sep 19, 2025 at 11:12:37AM +0200, Boqun Feng wrote: > Hi Peter & Ingo, > Peter, this pull request was missed during last cycle, and I want to push it in this cycle, and I have two options: * I can wait and add more locking patches in this cycle and send a PR in -rc4 or -rc5. * or I can send a PR as it is at the moment (as a "part 1" of locking changes), and rest locking patches could be in a different PR. Let me know which one you guys prefer, thanks! Regards, Boqun > Please pull this (mostly) Rust locking changes to tip. It's a bit late > than usual because I was at Kangrejos conference this week, however the > changes are relatively small and simple, so I think it's Ok for v6.18. > I also try using "git notes" for submission links as Thomas suggests, > let see how it goes ;-) > > The following changes since commit 17d9f8eaa87d40a2ff66598875a43363e37a909b: > > MAINTAINERS: update atomic infrastructure entry to include Rust (2025-09-15 09:38:36 +0200) > > are available in the Git repository at: > > https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/ tags/rust-locking.2025.09.19a > > for you to fetch changes up to 9622209360c25d78a81048a9db72f1efef7fbc58: > > rust: lock: Add a Pin<&mut T> accessor (2025-09-15 22:28:35 -0400) > > Regards, > Boqun > > ---------------------------------------------------------------- > Locking changes for v6.18: > > - Fix a data-race in do_raw_write_lock reported by KCSAN > > Rust locking changes for v6.18 > > - Make `data` in `Lock` structurally pinned. > > Previously the `data` field of a `Lock<T>` is not structurally pinned, > and it's impossible to initialize the `data` field with a > pin-initializer, hence e.g. a `Lock<T>` where T is a pin-initialized > type is not supported. This encourages workarounds like > `Lock<Pin<KBox<T>>`, which is more complicated and less efficient. > Therefore make the `data` field in `Lock` structurally pinned to > support pin-initialized types in a `Lock<T>`. > > Since the `data` field is structurally pinned, make `Guard<T, ...>` > only `DerefMut` is T is Unpin, otherwise `Guard::as_mut()` is added to > provide a `Pin<&mut T>`. This is different than normal Rust standand > library locks. > -----BEGIN PGP SIGNATURE----- > > iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAmjNGoEACgkQSXnow7UH > +riU8ggAnRUTBam8NTmHJpZfVbbNSfx1ndaARxd9Wb/MLEh8OHYKbVRPJwvWGge+ > dafO0VYULku7ho1SeIlLXp4Bbjy3YC6o/J6xOpr9xMmysUky7RHi+Ys0y9gKaSmW > daPurQEOS8TBUWu5yVxNAfWoRgPEiPULovbzgANKKAV7QsljyoEg7mQCPxLftPze > Hr22HxU+lr6SDH5Efc8ihGqXJAvwunk+0mkJymZbjWo3ZF3cuhXlTMcIlu1SK14a > R1VQu5UoX8S5y0T0gkJ84UJ11e0wrSZyT0EqmHWSpVBnyGgWk8H1u284hDiGG2iG > FvwoSQ9iVuxLhxjhPUSOjq30DzmFfg== > =MZj4 > -----END PGP SIGNATURE----- > > ---------------------------------------------------------------- > Alexander Sverdlin (1): > locking/spinlock/debug: Fix data-race in do_raw_write_lock > > Daniel Almeida (3): > rust: lock: guard: Add T: Unpin bound to DerefMut > rust: lock: Pin the inner data > rust: lock: Add a Pin<&mut T> accessor > > kernel/locking/spinlock_debug.c | 4 ++-- > rust/kernel/sync/lock.rs | 41 +++++++++++++++++++++++++++++++++++++---- > rust/kernel/sync/lock/global.rs | 5 ++++- > 3 files changed, 43 insertions(+), 7 deletions(-)
[Fixed Peter's email address...] On Fri, Sep 19, 2025 at 11:12:37AM +0200, Boqun Feng wrote: > Hi Peter & Ingo, > Peter, I somehow had a typo in the "To:" field of your email address, but you should be still Cced correctly, sorry about that :( Regards, Boqun > Please pull this (mostly) Rust locking changes to tip. It's a bit late > than usual because I was at Kangrejos conference this week, however the > changes are relatively small and simple, so I think it's Ok for v6.18. > I also try using "git notes" for submission links as Thomas suggests, > let see how it goes ;-) > > The following changes since commit 17d9f8eaa87d40a2ff66598875a43363e37a909b: > > MAINTAINERS: update atomic infrastructure entry to include Rust (2025-09-15 09:38:36 +0200) > > are available in the Git repository at: > > https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/ tags/rust-locking.2025.09.19a > > for you to fetch changes up to 9622209360c25d78a81048a9db72f1efef7fbc58: > > rust: lock: Add a Pin<&mut T> accessor (2025-09-15 22:28:35 -0400) > > Regards, > Boqun > > ---------------------------------------------------------------- > Locking changes for v6.18: > > - Fix a data-race in do_raw_write_lock reported by KCSAN > > Rust locking changes for v6.18 > > - Make `data` in `Lock` structurally pinned. > > Previously the `data` field of a `Lock<T>` is not structurally pinned, > and it's impossible to initialize the `data` field with a > pin-initializer, hence e.g. a `Lock<T>` where T is a pin-initialized > type is not supported. This encourages workarounds like > `Lock<Pin<KBox<T>>`, which is more complicated and less efficient. > Therefore make the `data` field in `Lock` structurally pinned to > support pin-initialized types in a `Lock<T>`. > > Since the `data` field is structurally pinned, make `Guard<T, ...>` > only `DerefMut` is T is Unpin, otherwise `Guard::as_mut()` is added to > provide a `Pin<&mut T>`. This is different than normal Rust standand > library locks. > -----BEGIN PGP SIGNATURE----- > > iQEzBAABCAAdFiEEj5IosQTPz8XU1wRHSXnow7UH+rgFAmjNGoEACgkQSXnow7UH > +riU8ggAnRUTBam8NTmHJpZfVbbNSfx1ndaARxd9Wb/MLEh8OHYKbVRPJwvWGge+ > dafO0VYULku7ho1SeIlLXp4Bbjy3YC6o/J6xOpr9xMmysUky7RHi+Ys0y9gKaSmW > daPurQEOS8TBUWu5yVxNAfWoRgPEiPULovbzgANKKAV7QsljyoEg7mQCPxLftPze > Hr22HxU+lr6SDH5Efc8ihGqXJAvwunk+0mkJymZbjWo3ZF3cuhXlTMcIlu1SK14a > R1VQu5UoX8S5y0T0gkJ84UJ11e0wrSZyT0EqmHWSpVBnyGgWk8H1u284hDiGG2iG > FvwoSQ9iVuxLhxjhPUSOjq30DzmFfg== > =MZj4 > -----END PGP SIGNATURE----- > > ---------------------------------------------------------------- > Alexander Sverdlin (1): > locking/spinlock/debug: Fix data-race in do_raw_write_lock > > Daniel Almeida (3): > rust: lock: guard: Add T: Unpin bound to DerefMut > rust: lock: Pin the inner data > rust: lock: Add a Pin<&mut T> accessor > > kernel/locking/spinlock_debug.c | 4 ++-- > rust/kernel/sync/lock.rs | 41 +++++++++++++++++++++++++++++++++++++---- > rust/kernel/sync/lock/global.rs | 5 ++++- > 3 files changed, 43 insertions(+), 7 deletions(-)
© 2016 - 2026 Red Hat, Inc.