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)
Sat, Dec 21, 9:27 PM
Unknown Object (File)
Nov 14 2024, 12:47 PM
Unknown Object (File)
Nov 14 2024, 12:40 PM
Unknown Object (File)
Sep 30 2024, 4:40 PM
Unknown Object (File)
Sep 17 2024, 6:11 AM
Unknown Object (File)
Sep 5 2024, 6:13 PM
Unknown Object (File)
Sep 2 2024, 8:47 PM
Unknown Object (File)
Aug 18 2024, 12:48 PM
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.