Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
ClosedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
F115912165: D45574.diff
Wed, Apr 30, 8:05 AM
Unknown Object (File)
Mon, Apr 21, 3:19 AM
Unknown Object (File)
Tue, Apr 1, 12:31 PM
Unknown Object (File)
Mar 1 2025, 10:08 PM
Unknown Object (File)
Feb 10 2025, 4:05 PM
Unknown Object (File)
Feb 9 2025, 2:39 PM
Unknown Object (File)
Jan 9 2025, 6:00 AM
Unknown Object (File)
Dec 14 2024, 5:09 PM
Subscribers

Details

Summary

This effectively reverts
6e824f3713011 ("time: siginfo_recvd needs to be marked volatile")
because it was actually wrong. Switch to C11 signal fence, which
provides a compiler barrier that will do the right thing.

Reported by: kib

Diff Detail

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

Event Timeline

usr.bin/time/time.c
130

I think that the right code is

local_siginfo_recvd = siginfo_recvd;
atomic_signal_fence(acq);
if (local siginfo_recvd) {
  ....

[Fence should come after reading the flag variable]

usr.bin/time/time.c
130

Ubernit: bool?

This revision is now accepted and ready to land.Jun 29 2024, 3:02 AM
This revision was automatically updated to reflect the committed changes.
kevans marked an inline comment as done.