Page MenuHomeFreeBSD

Allow safe unlocked busy sleeps.

Authored by jeff on Mon, Feb 10, 8:11 PM.



The title is perhaps a misnomer. It does add an unlocked sleep that revalidates the page's object and pindex under the sleepq lock. This actually eliminates the need for object as an interlock in sleeps although this code is maintained because it does reduce the number of times object is dropped and picked back up.

The real thrust however is to refactor the sleep routines so I can ultimately eliminate some variants. We have too many and frankly the nonshared argument is very confusing. I am moving towards just passing allocflags. The only difference between vm_page_busy_sleep() and vm_page_sleep_if_busy() is that one returns with the object lock and one returns without. This could easily be solved with a VM_ALLOC_DROP or simply a busy_sleep() and busy_sleep_drop() that take an allocflags parameter to determine the lock type.

This helps me move towards simplifying the external API while still allowing for unlocked sleeps and potentially a third busy type (shared (io), exclusive, map) without adding a bunch of new interfaces.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jeff created this revision.Mon, Feb 10, 8:11 PM
jeff edited the summary of this revision. (Show Details)Mon, Feb 10, 8:23 PM
jeff added reviewers: alc, dougm, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository.
jeff updated this revision to Diff 68396.Sun, Feb 16, 9:20 AM

Use atomic_load()

kib accepted this revision.Sun, Feb 16, 9:12 PM
This revision is now accepted and ready to land.Sun, Feb 16, 9:12 PM