-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
cgroup2: map io.stats to v1 blkio.stats correctly #2968
Conversation
/cc @iyashu Does this seem reasonable? |
@iyashu can you please test it locally and give us a thumbs up here? |
@dims @cyphar lgtm. I've also tested this patch by recompiling the cadvisor with updated runc dependency. All
|
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.
LGTM
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.
LGTM, but can we have UT?
Added a unit test. |
Kubelet and cAdvisor depend on the metrics having the same values as in cgroupv1, but we didn't correctly map the number of read and write IOs to the correct cgroupv1 stats table (blkio.io_serviced). In addition, don't leak any extra stats in our output -- if users need that information we can always add a new field for it. Reported-by: Yashpal Choudhary <[email protected]> Signed-off-by: Aleksa Sarai <[email protected]>
strconv.ParseUint(..., 0) is not really safe, because on 32-bit architectures it will trigger runtime errors when trying to parse large numbers (which in the case of the cgroupv2 io controller, is almost certainly going to happen). Fixes: 1932917 ("libcontainer: add initial support for cgroups v2") Signed-off-by: Aleksa Sarai <[email protected]>
Turns out there was a bug in our handling of 64-bit values on 32-bit architectures which the new unit test picked up. It's fixed now. |
Signed-off-by: Aleksa Sarai <[email protected]>
/ping @opencontainers/runc-maintainers This is ready for review now, and is the last PR for 1.0.0. |
Coolio. I'll send out the vote for 1.0.0 now. 🎉 |
Kubelet and cAdvisor depend on the metrics having the same values as in
cgroupv1, but we didn't correctly map the number of read and write IOs
to the correct cgroupv1 stats table (blkio.io_serviced).
In addition, don't leak any extra stats in our output -- if users need
that information we can always add a new field for it.
Change-log entry:
Fixes #2967
Reported-by: Yashpal Choudhary [email protected]
Signed-off-by: Aleksa Sarai [email protected]