Page MenuHomeFreeBSD

When downgrading exclusively busied page to shared-busy state, wakeup waiters
ClosedPublic

Authored by kib on Oct 8 2016, 5:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 26, 9:33 AM
Unknown Object (File)
Fri, Apr 25, 2:29 PM
Unknown Object (File)
Wed, Apr 23, 5:35 AM
Unknown Object (File)
Tue, Apr 22, 6:31 AM
Unknown Object (File)
Sat, Apr 19, 10:48 AM
Unknown Object (File)
Apr 4 2025, 5:31 AM
Unknown Object (File)
Mar 20 2025, 3:24 AM
Unknown Object (File)
Mar 19 2025, 11:00 PM
Subscribers

Details

Summary

... otherwise owners of the shared-busy state might get into a deadlock.

Test Plan

The vm_page_busy_downgrade() function is not used in the tree right now, but I have a plan for it.

Diff Detail

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

Event Timeline

kib retitled this revision from to When downgrading exclusively busied page to shared-busy state, wakeup waiters.
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added reviewers: alc, markj.
kib set the repository for this revision to rS FreeBSD src repository - subversion.
markj edited edge metadata.
This revision is now accepted and ready to land.Oct 10 2016, 5:42 PM
sys/vm/vm_page.c
669 ↗(On Diff #21183)

I'm confused here. It appears that we're waking up any waiters but leaving the waiters bit set in busy_lock. Do you really want to retain the second use of "| x" here if we're waking the waiters?

sys/vm/vm_page.c
669 ↗(On Diff #21183)

Hm, we cannot wake up only shared waiters. Indeed, the new value for cmpset() can (and probably should) omit VPB_BIT_WAITERS. If exclusive-busy waiter exists, it must recheck the page state and re-set the VPB_BIT_WAITERS.

kib edited edge metadata.

Do not set VPB_BIT_WAITER for the new value, we are waking every waiting threads and it is their responsibility to detect stray wakeup.

This revision now requires review to proceed.Oct 11 2016, 5:14 PM
alc edited edge metadata.
This revision is now accepted and ready to land.Oct 11 2016, 5:32 PM
This revision was automatically updated to reflect the committed changes.