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

Enable Linux PSI metrics #660

Closed
jacknagel opened this issue May 3, 2021 · 4 comments · Fixed by #1161
Closed

Enable Linux PSI metrics #660

jacknagel opened this issue May 3, 2021 · 4 comments · Fixed by #1161
Assignees
Labels
enhancement New feature or request

Comments

@jacknagel
Copy link
Contributor

What would you like to be added:
Enable kernel PSI metrics on EKS AMIs.

Why is this needed:
We would like to collect PSI metrics using node-exporter. This feature is present, but not enabled, on the latest EKS AMI:

$ cat /proc/pressure/cpu
cat: /proc/pressure/cpu: Operation not supported
$ uname -a
Linux ip-10-210-10-154.ec2.internal 5.4.110-54.182.amzn2.x86_64 #1 SMP Fri Apr 9 17:56:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cat /boot/config-`uname -r` | grep PSI
CONFIG_PSI=y
CONFIG_PSI_DEFAULT_DISABLED=y
@lanxinyuchs
Copy link

"CONFIG_PSI_DEFAULT_DISABLED=y" means not enabled by default.

see the code implementation in "kernel/sched/psi.c" file:

#ifdef CONFIG_PSI_DEFAULT_DISABLED
static bool psi_enable;
#else
static bool psi_enable = true;
#endif
static int __init setup_psi(char *str)
{
	return kstrtobool(str, &psi_enable) == 0;
}
__setup("psi=", setup_psi);

Before Linux 5.6 (like 5.4), the proc entries for psi will be created no matter the "psi_enable" varible is true or false, but these entries could not be read or written.

After merging this commit(torvalds/linux@3d81768), the proc entries for psi will be created only when the "psi_enable" is true.

So for this case, you should add "psi=1" to the kernel command line to truly enable this feature, something like this:

grubby --args="psi=1" --update-kernel=/boot/vmlinuz-5.4.110-54.182.amzn2.x86_64

@cartermckinnon cartermckinnon added the enhancement New feature or request label Dec 6, 2022
@cartermckinnon cartermckinnon self-assigned this Dec 6, 2022
@ellistarn
Copy link

+1, this would be super nice for monitoring tools, especially when combined with cgroupsv2

@sidewinder12s
Copy link

@cartermckinnon Any update on if this can be enabled out of the box since we should be able to get something on the older kernel the AMI currently uses?

@cartermckinnon
Copy link
Member

No concerns from me, tested with 1.24 (on the 5.4 kernel) and seems fine. Opened #1161 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants