Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
ClosedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
F170509673: D45574.id.diff
Sat, Sep 5, 4:06 AM
F170502600: D45574.id.diff
Sat, Sep 5, 3:21 AM
F170424965: D45574.diff
Fri, Sep 4, 6:45 PM
F170413730: D45574.diff
Fri, Sep 4, 5:28 PM
Unknown Object (File)
Fri, Sep 4, 3:06 AM
Unknown Object (File)
Fri, Sep 4, 2:41 AM
Unknown Object (File)
Wed, Sep 2, 5:11 PM
Unknown Object (File)
Wed, Sep 2, 1:14 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.bin/time/time.c
130–133

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–133

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.