Page MenuHomeFreeBSD

uma: Introduce per-domain reclamation functions
ClosedPublic

Authored by markj on Apr 9 2021, 11:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 3:35 AM
Unknown Object (File)
Feb 17 2024, 5:03 PM
Unknown Object (File)
Dec 20 2023, 5:55 AM
Unknown Object (File)
Dec 17 2023, 4:16 AM
Unknown Object (File)
Nov 13 2023, 6:25 AM
Unknown Object (File)
Nov 3 2023, 7:11 AM
Unknown Object (File)
Nov 1 2023, 7:07 AM
Unknown Object (File)
Oct 11 2023, 5:27 AM
Subscribers

Details

Summary

Make it possible to reclaim items from a specific NUMA domain.


- Add uma_zone_reclaim_domain() and uma_reclaim_domain().
- Permit parallel reclamations. Use a counter instead of a flag to
synchronize with zone_dtor().
- Use the zone lock to protect cache_shrink() now that parallel reclaims
can happen.
- Add a sysctl that can be used to trigger reclamation from a specific
domain.

There is one issue I am not sure how to resolve. uma_reclaim()
currently tries to put pressure on bucket sizes. If multiple page
daemons start reclaiming their respective UMA caches concurrently, we'd
be putting extra pressure on the bucket size.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Apr 9 2021, 11:02 PM

Looks good to me.

We should definitely reconsider whole bucket size pressure mechanism at some point, but I don't think we should worry about extra pressure right now. I suspect we may have insufficient pressure now. And even if we overpressure it, it should quickly compensate back if there is a lock contention. And if there is no lock contention, then shrink was reasonable. I just think we need some mechanism to create small constant pressure in case there is no memory pressure right now, but it may appear later. We should keep the subsystem fit, not overbloated, even if it is not stressed.

This revision is now accepted and ready to land.Apr 10 2021, 5:16 PM