Page MenuHomeFreeBSD

buf_ring: Use atomic operations with br_prod_tail
ClosedPublic

Authored by andrew on Jul 26 2024, 8:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 24, 9:38 AM
Unknown Object (File)
Tue, Jun 17, 4:54 AM
Unknown Object (File)
Sun, Jun 15, 2:10 PM
Unknown Object (File)
Sat, Jun 14, 6:32 AM
Unknown Object (File)
Fri, Jun 13, 3:23 AM
Unknown Object (File)
Thu, Jun 12, 3:19 AM
Unknown Object (File)
Wed, Jun 4, 10:33 AM
Unknown Object (File)
Mon, Jun 2, 8:14 PM
Subscribers

Details

Summary

As with br_cons_tail use an atomic load acquire to read br_prod_tail
in buf_ring_dequeue_mc and buf_ring_peek*.

On dequeue we need to ensure we don't read the entry from the buf_ring
until it is available and prod_tail has updated. There is already an
appropriate store in the enqueue path and an appropriate load in the
single consumer dequeue, we just need one in the other functions that
read from the buf_ring.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 27 2024, 4:11 AM
sys/sys/buf_ring.h
148

I think the same question holds about this acq