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

numastat: statistical errors occur when huge pages is used #149

Merged
merged 1 commit into from
Dec 14, 2022
Merged

numastat: statistical errors occur when huge pages is used #149

merged 1 commit into from
Dec 14, 2022

Conversation

luochenglcs
Copy link
Collaborator

@luochenglcs luochenglcs commented Dec 5, 2022

#147
Because when we calculate the huge pages memory, we use the default huge page size, it maybe get worng.

After linux commit 198d1597cc5a1(fs: proc: task_mmu: show page size in /proc//numa_maps), we can obtain the correct VM page size, so we can fix it.

Because when we calculate the huge pages memory, we use the
default huge page size, it maybe get worng.

After linux commit 198d1597cc5a1(fs: proc: task_mmu: show
page size in /proc//numa_maps), we can obtain the correct
VM page size, so we can fix it.
double vm_pagesz = 0;
char *pagesz_str = strstr(buf, VM_PGSZ_STR);
if (pagesz_str) {
vm_pagesz = (double)strtol(&pagesz_str[VM_PGSZ_STRLEN], NULL, 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please avoid double. Just unsigned long or long long

@@ -1021,11 +1031,13 @@ static void show_process_info(void)
exit(EXIT_FAILURE);
}
double value = (double)strtol(&p[1], &p, 10);
double multiplier = page_size_in_bytes;
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see it's already double.

@andikleen andikleen merged commit 80834a5 into numactl:master Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants