Page MenuHomeFreeBSD

uma: Avoid excessive per-CPU draining
ClosedPublic

Authored by des on Mar 14 2025, 12:56 AM.
Tags
None
Referenced Files
F127238012: D49349.id.diff
Fri, Aug 29, 11:23 AM
Unknown Object (File)
Mon, Aug 11, 9:00 AM
Unknown Object (File)
Mon, Aug 4, 10:43 PM
Unknown Object (File)
Jul 28 2025, 6:59 AM
Unknown Object (File)
Jul 28 2025, 4:58 AM
Unknown Object (File)
Jul 12 2025, 8:46 AM
Unknown Object (File)
Jul 6 2025, 10:20 AM
Unknown Object (File)
Jun 29 2025, 2:31 PM

Details

Summary

After commit 389a3fa693ef, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.

Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.

Fixes: 389a3fa693ef ("uma: Add UMA_ZONE_UNMANAGED")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62910
Build 59794: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 14 2025, 9:03 AM

FWIW, internal testing with an equivalent diff shows the intermittent (~8%) OOM panics seen with 389a3fa693ef are now resolved. Thanks!

des edited reviewers, added: markj; removed: des.

commandeering since @markj is afk

This revision was automatically updated to reflect the committed changes.