HomeFreeBSD

uma: Use the bucket cache for cross-domain allocations

Description

uma: Use the bucket cache for cross-domain allocations

uma_zalloc_domain() allocates from the requested domain instead of
following a first-touch policy (the default for most zones). Currently
it is only used by malloc_domainset(), and consumers free returned items
with free(9) since r363834.

Previously uma_zalloc_domain() worked by always going to the keg for an
item. As a result, the use of UMA zone caches was unbalanced: we free
items to the caches, but always allocate from the keg, skipping the
caches.

Make some effort to allocate from the UMA caches when performing a
cross-domain allocation. This avoids blowing up the caches when
something is performing many transient allocations with
malloc_domainset().

Reported and tested by: dhw, glebius
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D26427

Details

Provenance
markjAuthored on
Differential Revision
D26427: UMA: Use the bucket cache for cross-domain allocations.
Parents
rS366378: uma: Use LIFO for non-SMR bucket caches
Branches
Unknown
Tags
Unknown