-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix querying L3 cache size on osx-x64 #75854
Conversation
Tagging subscribers to this area: @dotnet/gc Issue DetailsOriginally reported here: The code for determining the L3 cache size returns incorrect value on osx-x64. The machine I use for testing is running macOS 12.2.1 on Intel i5-8500B processor. This processor has 9MB of L3 cache but only 256Kb of L2 cache. The ARM64 fix for checking Values on Intel:
Values on M1:
|
// and performance cores separately. "perflevel0" stands for "performance" | ||
|| sysctlbyname("hw.perflevel0.l3cachesize", &cacheSizeFromSysctl, &sz, nullptr, 0) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't add it because it wasn't used on arm64 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
We should probably backport this to release/7.0. |
Probably indeed makes sense as 256kb is quite small for gen0 budget (is heuristic the same for workstation gc?) |
Yep, I hit it on workstation GC in the first place. |
/backport to release/7.0-rc2 |
Started backporting to release/7.0-rc2: https://github.com/dotnet/runtime/actions/runs/3086969575 |
Originally reported here:
The code for determining the L3 cache size returns incorrect value on osx-x64. The machine I use for testing is running macOS 12.2.1 on Intel i5-8500B processor. This processor has 9MB of L3 cache but only 256Kb of L2 cache. The ARM64 fix for checking
hw.perflevel0.l2cachesize
mistakenly returns the L2 cache size on this machine. This in turn results in abysmal GC performance (on debug builds, at least) and frequent garbage collections.Values on Intel:
Values on M1: