Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refill heuristic #511

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Refill heuristic #511

merged 5 commits into from
Apr 28, 2022

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Apr 27, 2022

Modify the large buddy allocator to gradually grow its refill size up to a set amount. This is designed to work well on more limited address space platforms, but be able to grow to reduce contention on larger systems.

Primary use is for OE, where changes from CoffeeLake to IceLake mean the address space limits are very different.

mjp41 added 2 commits April 27, 2022 13:52
The large buddy allocator requests memory from its parent range.  The
request size was a fixed large request.  This was sufficiently large, so
that contention was not a problem.

This change makes it initially smaller, and gradually growing so that
contention is still not a problem, but for small work loads it requests
less memory.
@mjp41
Copy link
Member Author

mjp41 commented Apr 27, 2022

I need to do some perf testing on this to check it hasn't regressed.

@mjp41
Copy link
Member Author

mjp41 commented Apr 28, 2022

Did a small amount of perf testing yesterday. The worst regression was sh6bench, which only lasts a few 10s of milliseconds, so the initial contention in the warm up phase caused a big regression. From 0.08 seconds to 0.13 seconds, but the profile showed this was all in the contention for grabbing the initial memory.

Many examples that use a small amount of memory per thread have dropped considerably in usage.
For instance, cache-scratchN drops from 133MiB of RSS to 6 MiB of RSS. This is primarily because the first 2MiB of allocations per thread are not hitting transparent huge pages (I think). With 72 cores and a 2MiB huge page each, then you get 144MiB.

This heuristic is probably not ideal, but it works well enough, to be an improvement.

@mjp41 mjp41 merged commit 70eba1e into microsoft:main Apr 28, 2022
@mjp41 mjp41 deleted the refill_heuristic branch April 28, 2022 16:08
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants