Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use macOS 12 / iOS 15 perflevel sysctls for better cache info on Apple Platforms #101

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kulinseth
Copy link
Contributor

@kulinseth kulinseth commented Jul 12, 2022

No description provided.

Copy link
Contributor

@Maratyszcza Maratyszcza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase on the current top-of-tree. Current diff is hard to read.

@@ -128,7 +182,7 @@ static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype
#endif
}

static void decode_package_name(char* package_name) {
static void decode_hw_machine_package_name(char* package_name) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks unrelated. Please revert or move into a separate PR.

src/arm/mach/init.c Outdated Show resolved Hide resolved
src/arm/mach/init.c Outdated Show resolved Hide resolved
* iOS 15 and macOS Monterey 12 added sysctls to describe configuration information
* where not all cores are the same (number of cores, cache sizes).
*
* Each perflevel sysctl has a prefix of `hw.perflevel??.` where ?? is the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are perflevels reported by OS ordered? cpuinfo orders cores and logical processors from the most performant to the least performance, so cpuinfo_get_core(0) is the the fastest core and cpuinfo_get_core(cpuinfo_get_cores_count() - 1) is the most power-efficient core.

Copy link
Contributor

@Maratyszcza Maratyszcza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to cache-info look unrelated, they should go into a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants