Page MenuHomeFreeBSD

Add vm_page_grab_pages()
ClosedPublic

Authored by alc on Aug 8 2017, 4:31 PM.
Tags
None
Referenced Files
F106425585: D11926.diff
Mon, Dec 30, 1:25 PM
Unknown Object (File)
Sat, Dec 21, 2:24 PM
Unknown Object (File)
Mon, Dec 2, 7:19 PM
Unknown Object (File)
Nov 29 2024, 9:07 PM
Unknown Object (File)
Oct 30 2024, 12:36 PM
Unknown Object (File)
Oct 30 2024, 12:36 PM
Unknown Object (File)
Oct 30 2024, 12:36 PM
Unknown Object (File)
Oct 30 2024, 12:36 PM
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.