[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250730185218.2343700-1-soham.bagchi@utah.edu>
Date: Wed, 30 Jul 2025 12:52:18 -0600
From: Soham Bagchi <soham.bagchi@...h.edu>
To: ast@...nel.org,
daniel@...earbox.net,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
john.fastabend@...il.com,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org,
bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
sohambagchi@...look.com
Cc: Soham Bagchi <soham.bagchi@...h.edu>
Subject: [PATCH] bpf: relax acquire for consumer_pos in ringbuf_process_ring()
Since r->consumer_pos is modified only by the user thread
in the given ringbuf context (and as such, it is thread-local)
it does not require a load-acquire.
Signed-off-by: Soham Bagchi <soham.bagchi@...h.edu>
---
tools/lib/bpf/ringbuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/ringbuf.c b/tools/lib/bpf/ringbuf.c
index 9702b70da44..7753a6570cf 100644
--- a/tools/lib/bpf/ringbuf.c
+++ b/tools/lib/bpf/ringbuf.c
@@ -241,7 +241,7 @@ static int64_t ringbuf_process_ring(struct ring *r, size_t n)
bool got_new_data;
void *sample;
- cons_pos = smp_load_acquire(r->consumer_pos);
+ cons_pos = *r->consumer_pos;
do {
got_new_data = false;
prod_pos = smp_load_acquire(r->producer_pos);
--
2.34.1
Powered by blists - more mailing lists