Skip to content

rust: more memory barriers bindings

Gary Guo dri-devel linux-arch lkml lkmm nouveau rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rust: sync: add helpers for mb, dma_mb and friendsrust/helpers/barrier.c+30 -01 reply
2/3rust: sync: generic memory barriersrust/kernel/sync/atomic/ordering.rs rust/kernel/sync/barrier.rs+168 -285 replies
3/3gpu: nova-core: fix wrong use of barriers in GSP codedrivers/gpu/nova-core/gsp/cmdq.rs drivers/gpu/nova-core/gsp/fw.rs+19 -126 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchEliot Courtney
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] rust: more memory barriers bindings

From: Gary Guo <[email protected]>

This expands the existing smp barriers to also mandatory barriers and DMA barriers.

The API looks like:
mb(Ordering)/smp_mb(Ordering)/dma_mb(Ordering), where Ordering is one of Full, Read, Write and also Acquire, Release.

The Acquire and Release barriers are mapped to Full barriers for now and they only serve the purpose of documenting what ordering is needed without codegen optimizations, but they could be improved later to produce better codegen compared to full barriers. More on them in the commit message of patch 2.

A user of these introduced API is included in patch 3, which is a concurrency bug that exists in Nova code today due to missing barriers.

To: Miguel Ojeda <[email protected]>
To: Boqun Feng <[email protected]>
To: Danilo Krummrich <[email protected]>
To: Alexandre Courbot <[email protected]>
Cc: Björn Roy Baron <[email protected]>
Cc: Benno Lossin <[email protected]>
Cc: Andreas Hindborg <[email protected]>
Cc: Alice Ryhl <[email protected]>
Cc: Trevor Gross <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Andrea Parri <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: David Howells <[email protected]>
Cc: Jade Alglave <[email protected]>
Cc: Luc Maranget <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Akira Yokosawa <[email protected]>
Cc: Daniel Lustig <[email protected]>
Cc: Joel Fernandes <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

Gary Guo (3):
rust: sync: add helpers for mb, dma_mb and friends
rust: sync: generic memory barriers
gpu: nova-core: fix wrong use of barriers in GSP code

 drivers/gpu/nova-core/gsp/cmdq.rs   |  19 +++
 drivers/gpu/nova-core/gsp/fw.rs     |  12 --
 rust/helpers/barrier.c              |  30 +++++
 rust/kernel/sync/atomic/ordering.rs |   2 +-
 rust/kernel/sync/barrier.rs         | 194 ++++++++++++++++++++++++----
 5 files changed, 217 insertions(+), 40 deletions(-)

base-commit: 36ece9697e89016181e5ae87510e40fb31d86f2b

Signature · 1 line
2.51.2