Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
AcceptedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
F97545958: D45574.id139798.diff
Mon, Sep 30, 12:21 AM
Unknown Object (File)
Fri, Sep 27, 4:26 PM
Unknown Object (File)
Mon, Sep 23, 2:45 AM
Unknown Object (File)
Wed, Sep 18, 8:40 PM
Unknown Object (File)
Wed, Sep 18, 2:54 PM
Unknown Object (File)
Mon, Sep 16, 9:09 AM
Unknown Object (File)
Mon, Sep 16, 5:55 AM
Unknown Object (File)
Wed, Sep 11, 6:06 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