Page MenuHomeFreeBSD

Add vm_page_grab_pages()
ClosedPublic

Authored by alc on Aug 8 2017, 4:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 10:46 PM
Unknown Object (File)
Sat, Jun 28, 6:30 PM
Unknown Object (File)
Sat, Jun 28, 2:52 PM
Unknown Object (File)
Thu, Jun 26, 12:25 AM
Unknown Object (File)
Thu, Jun 19, 6:22 AM
Unknown Object (File)
Wed, Jun 18, 12:44 AM
Unknown Object (File)
Sun, Jun 15, 11:45 PM
Unknown Object (File)
Sun, Jun 15, 6:39 AM
Subscribers
None

Details

Summary

I've made some minor changes from the version that we've discussed in email. I highlight the notable ones below.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

vm/vm_page.c
3202–3204

I changed the way that this function determines if it needs to sleep on a page. This snippet is copied from vm_page_grab(). In many cases, the old version would perform both vm_page_xbusied() and vm_page_busied(). Now, we always do one or the other, never both.

3213

I made the sleep channel message distinct from vm_page_grab().

This revision is now accepted and ready to land.Aug 8 2017, 4:40 PM
markj added inline comments.
vm/vm_page.c
3174

The NOBUSY flag description needs to be updated.

Should vm_page_grab_pages() also include this assertion from vm_page_grab():

KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 ||
    (allocflags & VM_ALLOC_IGN_SBUSY) != 0,
    ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch"));
alc edited edge metadata.

Update the description of VM_ALLOC_NOBUSY.

Update the block comment in vm_page.h to reflect the capabilities of vm_page_grab_pages().

This revision now requires review to proceed.Aug 8 2017, 5:02 PM
In D11926#247397, @alc wrote:

Should vm_page_grab_pages() also include this assertion from vm_page_grab():

KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 ||
    (allocflags & VM_ALLOC_IGN_SBUSY) != 0,
    ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch"));

I can't see any reason not to, especially if we're considering implementing vm_page_grab() in terms of vm_page_grab_pages(). It might be that there's some valid use-case for specifying ALLOC_SBUSY without ALLOC_IGN_SBUSY, but until that arises it seems reasonable to be strict.

This revision was automatically updated to reflect the committed changes.