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
F132285421: D8195.diff
Wed, Oct 15, 12:53 PM
Unknown Object (File)
Wed, Sep 24, 8:46 PM
Unknown Object (File)
Thu, Sep 18, 4:06 AM
Unknown Object (File)
Sep 9 2025, 4:39 PM
Unknown Object (File)
Sep 8 2025, 8:09 PM
Unknown Object (File)
Sep 6 2025, 12:10 AM
Unknown Object (File)
Sep 5 2025, 9:52 PM
Unknown Object (File)
Aug 14 2025, 9:21 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.