Page MenuHomeFreeBSD

A pair of UMA optimizations to improve cache behavior.
ClosedPublic

Authored by jeff on Feb 24 2020, 11:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 24 2024, 4:09 PM
Unknown Object (File)
Jan 14 2024, 11:14 AM
Unknown Object (File)
Jan 13 2024, 9:40 AM
Unknown Object (File)
Dec 22 2023, 11:43 PM
Unknown Object (File)
Sep 29 2023, 7:37 AM
Unknown Object (File)
Sep 16 2023, 6:43 PM
Unknown Object (File)
Aug 28 2023, 7:16 AM
Unknown Object (File)
Aug 8 2023, 6:52 AM
Subscribers

Details

Summary

This adds a missing swap to uma_zfree to protect lifo behavior. The alloc bucket is now always the most recent data. This was +8% on my test.

It changes the load balancing algorithm for ROUNDROBIN to more strongly prefer the current domain unless there is a severe imbalance. I don't recall the actual % gain but it was not insignificant.

Diff Detail

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

Event Timeline

jeff added reviewers: rlibby, markj.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/vm/uma_core.c
586 ↗(On Diff #68779)

Style: missing spaces around '*'.

587 ↗(On Diff #68779)

Suppose we have domains 0, 1 with 100 and 99 items, respectively, and pref == 0. Then prefitems is left equal to LONG_MAX and we will return domain 1, but it looks like the intent is to return 0 in this case.

sys/vm/uma_core.c
587 ↗(On Diff #68779)

Yeah I should just drop the else on if domain == pref.

Looks good after fixing Mark's comments.

sys/vm/uma_core.c
586 ↗(On Diff #68779)

You could just write this is if (prefitems <= least * 2).

This revision is now accepted and ready to land.Feb 25 2020, 7:19 AM
This revision was automatically updated to reflect the committed changes.