Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148319293
D23719.id68421.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23719.id68421.diff
View Options
Index: head/sys/kern/kern_synch.c
===================================================================
--- head/sys/kern/kern_synch.c
+++ head/sys/kern/kern_synch.c
@@ -368,8 +368,8 @@
/*
* Last reference. Signal the user to call the destructor.
*
- * Ensure that the destructor sees all updates. The fence_rel
- * at the start of refcount_releasen synchronizes with this fence.
+ * Ensure that the destructor sees all updates. This synchronizes
+ * with release fences from all routines which drop the count.
*/
atomic_thread_fence_acq();
return (true);
Index: head/sys/sys/refcount.h
===================================================================
--- head/sys/sys/refcount.h
+++ head/sys/sys/refcount.h
@@ -119,6 +119,9 @@
KASSERT(n < REFCOUNT_SATURATION_VALUE / 2,
("refcount_releasen: n=%u too large", n));
+ /*
+ * Paired with acquire fence in refcount_release_last.
+ */
atomic_thread_fence_rel();
old = atomic_fetchadd_int(count, -n);
if (__predict_false(n >= REFCOUNT_COUNT(old) ||
@@ -198,6 +201,9 @@
return (false);
if (__predict_false(REFCOUNT_SATURATED(old)))
return (true);
+ /*
+ * Paired with acquire fence in refcount_release_last.
+ */
if (atomic_fcmpset_rel_int(count, &old, old - 1))
return (true);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 3:51 AM (1 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29795398
Default Alt Text
D23719.id68421.diff (1 KB)
Attached To
Mode
D23719: refcount: update comments about fencing when releasing counts
Attached
Detach File
Event Timeline
Log In to Comment