Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166219608
D36084.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
975 B
Referenced Files
None
Subscribers
None
D36084.diff
View Options
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -973,27 +973,13 @@
{
u_int x;
- vm_page_assert_sbusied(m);
-
- x = vm_page_busy_fetch(m);
- for (;;) {
- KASSERT(x != VPB_FREED,
- ("vm_page_sunbusy: Unlocking freed page."));
- if (VPB_SHARERS(x) > 1) {
- if (atomic_fcmpset_int(&m->busy_lock, &x,
- x - VPB_ONE_SHARER))
- break;
- continue;
- }
- KASSERT((x & ~VPB_BIT_WAITERS) == VPB_SHARERS_WORD(1),
- ("vm_page_sunbusy: invalid lock state"));
- if (!atomic_fcmpset_rel_int(&m->busy_lock, &x, VPB_UNBUSIED))
- continue;
- if ((x & VPB_BIT_WAITERS) == 0)
- break;
+ atomic_thread_fence_rel();
+ x = atomic_fetchadd_int(&m->busy_lock, -VPB_ONE_SHARER);
+ KASSERT(x != VPB_FREED, ("page %p is freed", m));
+ KASSERT(x != VPB_UNBUSIED && (x & VPB_BIT_SHARED) != 0,
+ ("page %p not sbusied", m));
+ if (x == (VPB_SHARERS_WORD(1) | VPB_BIT_WAITERS))
wakeup(m);
- break;
- }
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 13, 11:06 AM (12 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36567819
Default Alt Text
D36084.diff (975 B)
Attached To
Mode
D36084: vm: use atomic fetchadd in vm_page_sunbusy
Attached
Detach File
Event Timeline
Log In to Comment