Page MenuHomeFreeBSD

Fix UMA's first-touch policy with empty domains.
ClosedPublic

Authored by markj on Jun 19 2020, 3:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 18 2025, 5:27 PM
Unknown Object (File)
Sep 14 2025, 8:12 PM
Unknown Object (File)
Sep 13 2025, 2:47 PM
Unknown Object (File)
Sep 11 2025, 6:38 PM
Unknown Object (File)
Sep 11 2025, 5:22 PM
Unknown Object (File)
Sep 11 2025, 4:19 PM
Unknown Object (File)
Sep 1 2025, 10:50 PM
Unknown Object (File)
Aug 26 2025, 7:24 AM
Subscribers

Details

Summary

Suppose we are running on a CPU in a domain with no physical RAM. When
an item is freed to a first-touch zone, it ends up in the cross-domain
bucket. When the bucket is full, it gets placed in another domain's
bucket queue. However, when allocating an item, UMA will always go to
the keg on a per-CPU cache miss because the empty domain's bucket queue
will always be empty. This means that non-empty domains' bucket queues
can grow very rapidly on such systems. For example, it can easily cause
mbuf allocation failures when the zone limit is reached.

Change cache_alloc() to follow a round-robin policy when running on an
empty domain.

Diff Detail

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

Event Timeline

markj requested review of this revision.Jun 19 2020, 3:33 AM
markj created this revision.
This revision was not accepted when it landed; it landed in state Needs Review.Jun 28 2020, 9:35 PM
This revision was automatically updated to reflect the committed changes.