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)
Wed, Sep 24, 3:05 AM
Unknown Object (File)
Tue, Sep 16, 12:33 AM
Unknown Object (File)
Sep 3 2025, 1:10 AM
Unknown Object (File)
Aug 24 2025, 3:39 PM
Unknown Object (File)
Aug 21 2025, 10:45 PM
Unknown Object (File)
Aug 14 2025, 11:50 PM
Unknown Object (File)
Aug 8 2025, 5:17 AM
Unknown Object (File)
Aug 4 2025, 12:59 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