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

proc_fuse: add psi(pressure stall information) procfs #665

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

loyou
Copy link
Contributor

@loyou loyou commented Nov 13, 2024

Kernel support psi(pressure stall information) since 4.20
with procfs /proc/pressure/{io,cpu,memory} and
cgroupv2 {io.pressure, cpu.pressure, memory.pressure}.

This patch add read-only psi procfs,
and people can get pressure information now.
Full functional feature for monitoring are still under investigation.

@mihalicyn mihalicyn self-requested a review November 13, 2024 13:23
@mihalicyn
Copy link
Member

Hey @loyou,

thanks for working on this.

Please, notice that you have a failing test https://github.com/lxc/lxcfs/actions/runs/11809711932/job/32900481717?pr=665

src/bindings.h Outdated Show resolved Hide resolved
@loyou
Copy link
Contributor Author

loyou commented Nov 14, 2024

I'm a little confused with the test result,

==> Testing /sys/devices/system/cpu/online
../src/lxcfs.c: 910: lxcfs_read: unknown file type: path=/sys/devices/system/cpu/online, type=-1, fi->fh=105965433156896
cat: /tmp/tmp.tDXXvo8T0e/sys/devices/system/cpu/online: Invalid argument
../src/lxcfs.c: 988: lxcfs_release: unknown file type: path=/sys/devices/system/cpu/online, type=-1, fi->fh=105965433156896

the failed line number does not match the patched file lines,
and cat /sys/devices/system/cpu/online in lxc container with patched lxcfs, it works fine.
I will resolve the live upgrade issue first and then check it again.

dir_filler(filler, buf, "swaps", 0) != 0 ||
dir_filler(filler, buf, "loadavg", 0) != 0 ||
dir_filler(filler, buf, "slabinfo", 0) != 0 ||
dirent_filler(filler, path, "pressure", buf, 0) != 0)
Copy link
Member

Choose a reason for hiding this comment

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

I haven't tested this, but it looks like if the host does not have /proc/pressure, lxcfs will have a /proc/pressure though it will be empty. I don't know whether that matters, especially as noone directly mounts /var/lib/lxcfs/proc into the container.

Copy link
Member

@hallyn hallyn left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@hallyn
Copy link
Member

hallyn commented Jan 2, 2025

Will wait briefly to see whether @mihalicyn had any more comments before merging.

@stgraber
Copy link
Member

stgraber commented Jan 3, 2025

Going to do a quick rebase on this one so it triggers the new tests we have.

Kernel support psi(pressure stall information) since 4.20
with procfs /proc/pressure/{io,cpu,memory} and
cgroupv2 {io.pressure, cpu.pressure, memory.pressure}.

This patch add read-only psi procfs,
and people can get pressure information now.
Full functional feature for monitoring are still under investigation.

Signed-off-by: Feng Sun <loyou85@gmail.com>
Copy link
Member

@mihalicyn mihalicyn left a comment

Choose a reason for hiding this comment

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

LGTM!

@stgraber stgraber merged commit 341c43c into lxc:main Jan 6, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants