Page MenuHomeFreeBSD

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

Authored by markj on Jun 19 2020, 3:33 AM.

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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.