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
F171389667: D26427.id.diff
Thu, Sep 10, 9:08 PM
Unknown Object (File)
Mon, Sep 7, 9:31 PM
Unknown Object (File)
Sun, Sep 6, 11:44 AM
Unknown Object (File)
Sat, Sep 5, 6:03 PM
Unknown Object (File)
Sat, Sep 5, 3:57 PM
Unknown Object (File)
Sat, Sep 5, 10:29 AM
Unknown Object (File)
Sat, Sep 5, 3:48 AM
Unknown Object (File)
Fri, Sep 4, 4:06 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.