Page MenuHomeFreeBSD

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

Authored by markj on Sep 14 2020, 8:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 11, 5:44 AM
Unknown Object (File)
Dec 20 2023, 7:40 AM
Unknown Object (File)
Nov 14 2023, 9:36 PM
Unknown Object (File)
Nov 10 2023, 7:07 PM
Unknown Object (File)
Nov 8 2023, 12:54 PM
Unknown Object (File)
Nov 4 2023, 5:32 AM
Unknown Object (File)
Oct 9 2023, 6:04 PM
Unknown Object (File)
Oct 7 2023, 11:47 AM
Subscribers

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 Passed
Unit
No Test Coverage
Build Status
Buildable 33550
Build 30807: arc lint + arc unit

Event Timeline

markj requested review of this revision.Sep 14 2020, 8:59 PM
markj created this revision.

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

This revision was not accepted when it landed; it landed in state Needs Review.Oct 2 2020, 7:04 PM
This revision was automatically updated to reflect the committed changes.