Skip to content

Commit 81c5d12

Browse files
sohambagchiKernel Patches Daemon
authored andcommitted
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 <[email protected]>
1 parent 6217ef6 commit 81c5d12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/ringbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ static int64_t ringbuf_process_ring(struct ring *r, size_t n)
241241
bool got_new_data;
242242
void *sample;
243243

244-
cons_pos = smp_load_acquire(r->consumer_pos);
244+
cons_pos = *r->consumer_pos;
245245
do {
246246
got_new_data = false;
247247
prod_pos = smp_load_acquire(r->producer_pos);

0 commit comments

Comments
 (0)