Page MenuHomeFreeBSD

emulated atomic64: disable interrupts as the lock mechanism on !SMP
ClosedPublic

Authored by kevans on Jan 3 2020, 1:17 AM.
Tags
None
Referenced Files
F168743710: D23015.id66311.diff
Sat, Aug 29, 10:29 PM
Unknown Object (File)
Sat, Aug 29, 11:26 AM
Unknown Object (File)
Fri, Aug 28, 1:57 PM
Unknown Object (File)
Thu, Aug 27, 9:38 AM
Unknown Object (File)
Wed, Aug 26, 9:21 AM
Unknown Object (File)
Tue, Aug 25, 11:08 PM
Unknown Object (File)
Tue, Aug 25, 10:32 PM
Unknown Object (File)
Mon, Aug 10, 12:43 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/subr_atomic64.c
78 ↗(On Diff #66285)

Why not make LOCK_A64() be more like:

{ register s; s = intr_disable();

and UNLOCK_A64() be:

intr_restore(s); }

Then you don't need the added LOCK_DECL.

I think pthread_cleanup_push() and pthread_cleanup_pop() do something like this.

kevans marked an inline comment as done.

Use better construct to eliminate separate LOCK_DECL that's only used for !SMP

This revision is now accepted and ready to land.Jan 3 2020, 3:26 PM

The changes look good to me as well.