Page MenuHomeFreeBSD

UMA: Use the bucket cache for cross-domain allocations.
Needs ReviewPublic

Authored by markj on Mon, Sep 14, 8:59 PM.

Details

Summary

uma_zalloc_domain() allocates from the requested domain instead of
following a first-touch policy (used for most zones). Currently it is
only used by malloc_domainset(), which returns memory freed with free().
uma_zalloc_domain() works by always going to the keg for an item. In
particular, use of UMA zone caches is 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(). We could go further and dip into the per-CPU
caches, but I don't think the extra complexity really buys us anything,
so I propose simply popping the first item in the bucket cache.

Reported and tested by: dhw, glebius

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 33550
Build 30807: arc lint + arc unit

Event Timeline

markj requested review of this revision.Mon, Sep 14, 8:59 PM
markj created this revision.
markj added a comment.Wed, Sep 23, 7:51 PM

Any objections to this change? I'd like to commit soon if not.