HomeFreeBSD

uma: Fix handling of reserves in zone_import()

Description

uma: Fix handling of reserves in zone_import()

Kegs with no items reserved have uk_reserve = 0. So the check
keg->uk_reserve >= dom->ud_free_items will be true once all slabs are
depleted. Then, rather than go and allocate a fresh slab, we return to
the cache layer.

The intent was to do this only when the keg actually has a reserve, so
modify the check to verify this first. Another approach would be to
make uk_reserve signed and set it to -1 until uma_zone_reserve() is
called, but this requires a few casts elsewhere.

Fixes: 1b2dcc8c54a8 ("uma: Avoid depleting keg reserves when filling a bucket")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32516

Details

Provenance
markjAuthored on Nov 1 2021, 1:27 PM
Differential Revision
D32516: uma: Fix handling of reserves in zone_import()
Parents
rGfab343a7168a: uma: Improve M_USE_RESERVE handling in keg_fetch_slab()
Branches
Unknown
Tags
Unknown