Page MenuHomeFreeBSD

Allow safe unlocked busy sleeps.
ClosedPublic

Authored by jeff on Feb 10 2020, 8:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 12 2024, 6:54 PM
Unknown Object (File)
Dec 29 2023, 10:40 PM
Unknown Object (File)
Dec 23 2023, 12:58 AM
Unknown Object (File)
Sep 8 2023, 10:12 PM
Unknown Object (File)
Aug 28 2023, 5:19 AM
Unknown Object (File)
Aug 28 2023, 5:18 AM
Unknown Object (File)
Aug 28 2023, 5:18 AM
Unknown Object (File)
Aug 28 2023, 5:18 AM
Subscribers

Details

Summary

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

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