Page MenuHomeFreeBSD

uma: Avoid depleting keg reserves when filling a bucket
ClosedPublic

Authored by markj on Oct 13 2020, 8:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 5:34 AM
Unknown Object (File)
Dec 12 2023, 3:43 AM
Unknown Object (File)
Nov 29 2023, 11:13 AM
Unknown Object (File)
Aug 2 2023, 2:43 AM
Unknown Object (File)
Aug 2 2023, 2:42 AM
Unknown Object (File)
Aug 2 2023, 2:42 AM
Unknown Object (File)
Aug 2 2023, 2:40 AM
Unknown Object (File)
Aug 2 2023, 2:29 AM
Subscribers

Details

Summary

zone_import() fetches a free or partially free slab from the keg and
then uses its items to populate an array, typically filling a bucket.
If a single allocation causes the keg to drop below its minimum reserve,
the inner loop ends. However, if the bucket is still not full and
M_USE_RESERVE is specified, the outer loop will continue to fetch items
from the keg.

If M_USE_RESERVE is specified and the number of free items is below the
reserved limit, we should return only a single item. Otherwise, if the
bucket size is larger than the reserve, all of the reserved items may
end up in a single per-CPU bucket, invisible to other CPUs.

Diff Detail

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

Event Timeline

markj requested review of this revision.Oct 13 2020, 8:56 PM
markj created this revision.
sys/vm/uma_core.c
3755–3759 ↗(On Diff #78193)

Should this be conditional on actually being at or below the reserve limit?

markj marked an inline comment as done.

Modify zone_import() to return as soon as the free count dips below the
reserve. This is still not perfect, since for round-robin zones we could
potentially continue allocating from other domains.

This revision is now accepted and ready to land.Oct 14 2020, 5:53 PM