Page MenuHomeFreeBSD

vm_page: Consolidate page busy sleep mechanisms
AcceptedPublic

Authored by markj on Nov 11 2021, 5:34 PM.

Details

Reviewers
alc
kib
jeff
Group Reviewers
manpages
Summary
  • Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix up callers.
  • Modify vm_page_busy_sleep() to return a status indicating whether the object lock was dropped, and fix up callers.
  • Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep() instead.
  • Remove vm_page_sleep_if_(x)busy().

Obtained from: jeff (object_concurrency patches)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 42766
Build 39654: arc lint + arc unit

Event Timeline

sys/vm/vm_page.c
1019–1020

It is somewhat strange API design.
Is it planned to allow other values for allocflags later on?

If you decide to reuse allocflags there, why not allow any flags and just operate on the (allocflags & VM_ALLOC_IGN_SBUSY) != 0? Or not reuse and then make (keep) allocflags bool argunment.

sys/vm/vm_page.c
1019–1020

I don't think there's any plan to permit other flags for now, but this way consumers use a standard terminology at least. I find it a bit nicer than a naked bool.

I could simply remove the assertion. Note that _vm_page_busy_sleep() does not have any assertion since some other calls will pass vm_page_grab* flags in unmodified.

sys/vm/vm_page.c
1019–1020

To me, removing the assertion looks reasonable.

markj marked 2 inline comments as done.

Drop assertions.

This revision is now accepted and ready to land.Nov 12 2021, 7:17 PM