-
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
Do not convert blkio weight value using blkio->io conversion scheme #2786
Conversation
This will also need to be fixed in crun and systemd among other things afair @giuseppe |
More details here: opencontainers/runc#2786 Signed-off-by: Giuseppe Scrivano <[email protected]>
thanks for letting me know! I've opened a PR for crun as well: containers/crun#584 |
@keszybz FYI |
29e782f
to
7b13d84
Compare
Updated to add a test so we can try to catch this in the future. I'm not sure if there's movement to merge io.weight and io.bfq.weight at the moment, at which point we need to fix the inconsistency between 2 interface. |
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
CI failure on Fedora is a glitch (of download.fedoraproject.org) -- created #2787 to address. CI restared. |
@@ -190,6 +190,22 @@ function setup() { | |||
[[ "$output" == *'invalid configuration'* ]] | |||
} | |||
|
|||
@test "runc run (blkio weight)" { | |||
requires root cgroups_v2 |
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.
Shouldn't require root?
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.
@AkihiroSuda once #2818 is merged we will be able to enable it (rm root, add [[ "$ROOTLESS" -ne 0 ]] && requires rootless_cgroup
)
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.
...because currently runc exec test_cgroups_unified sh -c 'cat /sys/fs/cgroup/io.bfq.weight'
is not working
tests/integration/cgroups.bats
Outdated
set_cgroups_path "$BUSYBOX_BUNDLE" | ||
update_config '.linux.resources.blockIO |= {"weight": 750}' "${BUSYBOX_BUNDLE}" | ||
|
||
runc run -d --console-socket "$CONSOLE_SOCKET" test_cgroups_v2_blkio |
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.
If you add a new container name you need to add it to the teardown()
hook at the start -- teardown_running_container
.
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.
I noticed it, too, but did not comment because I am fixing all this soon (after #2757 is merged).
tests/integration/cgroups.bats
Outdated
|
||
runc exec test_cgroups_v2_blkio sh -c 'cat /sys/fs/cgroup/io.bfq.weight' | ||
[ "$status" -eq 0 ] | ||
echo "$output" |
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.
This shouldn't be necessary? runc
is a function which prints the output to the bats log (I'm also pretty sure a naked echo
doesn't work which is why runc
redirects to stderr
):
# Wrapper for runc.
function runc() {
run __runc "$@"
# Some debug information to make life easier. bats will only print it if the
# test failed, in which case the output is useful.
echo "runc $@ (status=$status):" >&2
echo "$output" >&2
}
# Raw wrapper for runc.
function __runc() {
"$RUNC" ${RUNC_USE_SYSTEMD+--systemd-cgroup} --root "$ROOT" "$@"
}
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.
Test needs to be cleaned up.
@giuseppe thanks for the ping.
Do I get this right that |
@keszybz yes, i think that is correct. Which then also raises more questions:
In general, |
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.
Indeed, the io.bfq.weight
range is 1-1000, but io.weight
range is 1-10000. runc is not currently setting io.weight
.
If useful for you, I'll be glad to change the range for BFQ too. The current BFQ range is due just to legacy.
… Il giorno 5 feb 2021, alle ore 02:36, Kir Kolyshkin ***@***.***> ha scritto:
@kolyshkin commented on this pull request.
Indeed, the io.bfq.weight range is 1-1000, but io.weight range is 1-10000. runc is not currently setting io.weight.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Took a liberty to
|
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
@AkihiroSuda PTAL |
The test case is not working under rootless on Fedora:
Apparently the problem is, rootless containers somehow do no honor cgroupns. Instead of "just this container" we see everything in container's view of /sys/fs/cgroup. Looking... |
Normal container's cgroup2 mount:
rootless container cgroup2 mount:
Ah, so it is caused by #2158. Hmmm. |
@kolyshkin sorry for the delay. yes i indeed hit this along the removal of root for the test so it wasn't done, and i forgot to put a comment on that. |
@dqminh your patch is fine (note that I pushed into your branch though), the rootless cgroup mount is a separate issue I'm going to address. |
bfq weight controller (i.e. io.bfq.weight if present) is still using the same bfq weight scheme (i.e 1->1000, see [1].) Unfortunately the documentation for this was wrong, and only fixed recently [2]. Therefore, if we map blkio weight to io.bfq.weight, there's no need to do any conversion. Otherwise, we will try to write invalid value which results in error such as: ``` time="2021-02-03T14:55:30Z" level=error msg="container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: process_linux.go:458: setting cgroup config for procHooks process caused: failed to write \"7475\": write /sys/fs/cgroup/runc-cgroups-integration-test/test-cgroup/io.bfq.weight: numerical result out of range" ``` [1] https://github.com/torvalds/linux/blob/master/Documentation/block/bfq-iosched.rst [2] torvalds/linux@65752ae Signed-off-by: Daniel Dao <[email protected]>
b9eed6c
to
c3ffd2e
Compare
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
@AkihiroSuda PTAL |
@cyphar PTAL (you requested changes and thus merging is blocked until you approve). Seems your review comments are now addressed. |
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. As an aside, feel free to dismiss my old reviews if they are clearly no longer applicable. (I wish GitHub did this already, because it treats approvals as something that can go stale but "request changes" reviews aren't treated as stale.)
BFQ weight controller is using the same BFQ weight scheme (i.e 1->1000). Therefore, there is no need to do the conversion. More details here: opencontainers/runc#2786 Fixes: kata-containers#1440 Signed-off-by: Manabu Sugimoto <[email protected]>
BFQ weight controller is using the same BFQ weight scheme (i.e 1->1000). Therefore, there is no need to do the conversion. More details here: opencontainers/runc#2786 Fixes: kata-containers#1440 Signed-off-by: Manabu Sugimoto <[email protected]>
The way libcontainer and lots of other runtime deals with blockio setting in cgroupv2 is buggy, see [1] For now, we disable BlockIO until a fix can land in libcontainer. [1] opencontainers/runc#2786 Signed-off-by: Daniel Dao <[email protected]>
The way libcontainer and lots of other runtime deals with blockio setting in cgroupv2 is buggy, see [1] For now, we disable BlockIO until a fix can land in libcontainer. [1] opencontainers/runc#2786 Signed-off-by: Daniel Dao <[email protected]>
The way libcontainer and lots of other runtime deals with blockio setting in cgroupv2 is buggy, see [1] For now, we disable BlockIO until a fix can land in libcontainer. [1] opencontainers/runc#2786 Signed-off-by: Daniel Dao <[email protected]>
The way libcontainer and lots of other runtime deals with blockio setting in cgroupv2 is buggy, see [1] For now, we disable BlockIO until a fix can land in libcontainer. [1] opencontainers/runc#2786 Signed-off-by: Daniel Dao <[email protected]>
bfq weight controller (i.e. io.bfq.weight if present) is still using the
same bfq weight scheme (i.e 1->1000, see [1].) Unfortunaly the
documentation for this was wrong, and only fixed recently [2].
Therefore, if we map blkio weight to io.bfq.weight, there's no need to
do any conversion.
[1] https://github.com/torvalds/linux/blob/master/Documentation/block/bfq-iosched.rst
[2] torvalds/linux@65752ae