Page MenuHomeFreeBSD

aio: Fix more synchronization issues in aio_biowakeup.
ClosedPublic

Authored by jhb on Feb 15 2023, 7:02 PM.
Tags
None
Referenced Files
F115793238: D38611.diff
Mon, Apr 28, 6:19 PM
Unknown Object (File)
Sat, Apr 26, 12:13 PM
Unknown Object (File)
Sun, Apr 6, 8:24 AM
Unknown Object (File)
Mar 15 2025, 10:26 PM
Unknown Object (File)
Feb 22 2025, 11:54 PM
Unknown Object (File)
Feb 6 2025, 2:53 PM
Unknown Object (File)
Nov 20 2024, 9:03 AM
Unknown Object (File)
Nov 14 2024, 8:43 PM
Subscribers

Details

Summary
  • Use atomic_store to set job->error. atomic_set does an or operation, not assignment.
  • Use refcount_* to manage job->nbio.

    This ensures proper memory barriers are present so that the last bio won't see a possibly stale value of job->error.
  • Don't re-read job->error after reading it via atomic_load.

Reported by: markj (1)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49809
Build 46700: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Feb 15 2023, 7:02 PM

hrmpf

so turns out atomic_set *is* like atomic_store on linux....

mumbling ensues

that is just a side note though

another one is that the volatile u_int stuff for refcounts needs to die, but again not a blocker

This revision is now accepted and ready to land.Feb 15 2023, 7:06 PM