Page MenuHomeFreeBSD

vm_reserv: introduce unmanaged reservations
AbandonedPublic

Authored by bnovkov on May 1 2024, 1:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 27, 8:41 AM
Unknown Object (File)
Thu, Sep 26, 5:09 AM
Unknown Object (File)
Mon, Sep 23, 7:31 PM
Unknown Object (File)
Mon, Sep 23, 7:11 PM
Unknown Object (File)
Mon, Sep 23, 6:54 PM
Unknown Object (File)
Sun, Sep 22, 7:49 PM
Unknown Object (File)
Sun, Sep 22, 2:22 AM
Unknown Object (File)
Sat, Sep 21, 4:25 AM
Subscribers

Details

Reviewers
alc
markj
kib
Summary

This is the first of four patches in a series that aims to replace uma_small_alloc with a reservation-aware 0-order page allocator.

This patch introduces unmanaged reservations, i.e. reservations that are not a part of any vm_object but are still used to serve page allocation requests. In this case, they are used to allocate 0-order pages for UMA zones.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/vm/vm_reserv.c
151

Why 4 bits and not 1?

Or you might use a special invalid object value like (vm_object_t)1 instead of adding inpartpopq flags. I mention this because the check for free reservation is rv->object == NULL, which can be kept intact this way. Also unmanaged becomes exclusive with managed reservation condition by the mere way it is stored.

sys/vm/vm_reserv.c
151

No particular reason, the 4 bit split seemed cleaner since both fields are effectively booleans.

I hadn't considered the special vm_object approach, I like it more than the current approach of adding in new fields.
I'll try to work it into the patch.

Address @kib 's comment - unmanaged reservations are now distinguished using an invalid vm_object value instead of a separate variable.

kib added inline comments.
sys/vm/vm_reserv.c
1469

you can express the 4 lines above as

return (rv->object == VM_RESERV_NOOBJ_MARK);
This revision is now accepted and ready to land.May 25 2024, 10:49 PM