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)
Sun, Mar 31, 6:07 AM
Unknown Object (File)
Mar 23 2024, 5:16 AM
Unknown Object (File)
Mar 3 2024, 4:36 AM
Unknown Object (File)
Jan 2 2024, 10:21 PM
Unknown Object (File)
Dec 22 2023, 10:12 PM
Unknown Object (File)
Dec 3 2023, 5:04 PM
Unknown Object (File)
Nov 21 2023, 10:42 PM
Unknown Object (File)
Nov 21 2023, 5:38 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.