Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
AcceptedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 27, 5:32 PM
Unknown Object (File)
Sep 30 2024, 3:39 PM
Unknown Object (File)
Sep 30 2024, 3:38 PM
Unknown Object (File)
Sep 30 2024, 12:21 AM
Unknown Object (File)
Sep 27 2024, 4:26 PM
Unknown Object (File)
Sep 23 2024, 2:45 AM
Unknown Object (File)
Sep 18 2024, 8:40 PM
Unknown Object (File)
Sep 18 2024, 2:54 PM
Subscribers

Details

Reviewers
kib
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 58391
Build 55279: arc lint + arc unit

Event Timeline

usr.bin/time/time.c
129–132

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
129

Ubernit: bool?

This revision is now accepted and ready to land.Jun 29 2024, 3:02 AM