Page MenuHomeFreeBSD

Fix checks in the bucket allocation path.
AbandonedPublic

Authored by markj on Oct 31 2018, 10:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 1, 9:41 AM
Unknown Object (File)
Tue, Sep 30, 11:51 PM
Unknown Object (File)
Sun, Sep 28, 3:22 PM
Unknown Object (File)
Fri, Sep 26, 2:29 AM
Unknown Object (File)
Sun, Sep 21, 6:01 PM
Unknown Object (File)
Sep 11 2025, 10:54 PM
Unknown Object (File)
Sep 6 2025, 8:46 AM
Unknown Object (File)
Jul 31 2025, 8:51 PM
Subscribers
None

Details

Summary

For UMA_ZONE_NUMA zones, we only install a newly allocated bucket in the
pcpu cache if we're still running within the selected domain after the
bucket allocation. However, if the selected domain was empty, we set
domain = UMA_ANYDOMAIN, so the test domain == PCPU_GET(domain) is always
false and we end up caching the bucket in one of the per-domain lists.

Fix the problem by testing domain == UMA_ANYDOMAIN instead of checking
for UMA_ZONE_NUMA. As pointed out in D16666, this is clearer and saves
an extra memory reference in common cases. After r339043, this change
also ensures that we maintain pcpu caches for CPUs belonging to extra
domains when UMA_ZONE_NUMA is set. Presently, the only zones with this
attribute are the bucket zones themselves.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20546
Build 19971: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/vm/uma_core.c
3187

Hmm, this is kind of odd. We always add full buckets to domain 0's bucket list for first-touch zones.