Conversation
katarzyna-z
reviewed
Jul 17, 2020
katarzyna-z
reviewed
Jul 17, 2020
katarzyna-z
reviewed
Jul 17, 2020
katarzyna-z
reviewed
Jul 17, 2020
katarzyna-z
reviewed
Jul 17, 2020
katarzyna-z
reviewed
Jul 17, 2020
libcontainer/intelrdt/intelrdt.go
Outdated
| } | ||
|
|
||
| return stats, nil | ||
| return nil, nil |
There was a problem hiding this comment.
It looks strange but I see that nil, nil is returned when type was different than CTRL_MON and different than MON so maybe it will be useful to add log with proper information (maybe info level log).
Owner
Author
There was a problem hiding this comment.
It will be easier to return the error.
Owner
Author
There was a problem hiding this comment.
I also provided a unit test for that.
b6266be to
2b63c34
Compare
711c104 to
507ecec
Compare
397e410 to
2852ea3
Compare
3d6ca74 to
ffe869e
Compare
f570ef0 to
1fd7fdc
Compare
5b2c6b3 to
6276975
Compare
6276975 to
2c81c63
Compare
Fix systemd cgroup driver's Apply
In code that checks that the resource name is in the for Using strings.SplitN is an overkill in this case, resulting in allocations and thus garbage to collect. Using strings.IndexByte and checking that result is not less than 1 (meaning there is a period, and it is not the first character) is sufficient here. Fixes: 0cb8bf6 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Systemd v252 (available in CentOS Stream 9 in our CI) added support for setting cpu.idle (see [1]). The way it works is: - if CPUWeight == 0, cpu.idle is set to 1; - if CPUWeight != 0, cpu.idle is set to 0. This behavior breaks the existing test case, as described in [2]. To fix, skip the last check in the test case in case a newer systemd is used. Fixes: opencontainers#3786 [1] systemd/systemd#23299 [2] opencontainers#3786 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Values other than 1 or 0 are ignored by the kernel, see sched_group_set_idle() in kernel/sched/fair.c If the added test case ever fails, it means that the kernel now accepts values other than 0 or 1, and runc needs to adopt to that. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Systemd v252 (available in CentOS Stream 9 in our CI) added support for setting cpu.idle (see [1]). The way it works is: - if CPUWeight == 0, cpu.idle is set to 1; - if CPUWeight != 0, cpu.idle is set to 0. This commit implements setting cpu.idle in systemd cgroup driver via a unit property. In case CPUIdle is set to non-zero value, the driver sets adds CPUWeight=0 property, which will result in systemd setting cpu.idle to 1. Unfortunately, there's no way to set cpu.idle to 0 without also changing the CPUWeight value, so the driver doesn't do anything if CPUIdle is explicitly set to 0. This case is handled by the fs driver which is always used as a followup to setting systemd unit properties. Also, handle cpu.idle set via unified map. In case it is set to non-zero value, add CPUWeight=0 property, and ignore cpu.weight (otherwise we'll get two different CPUWeight properties set). Add a unit test for new values in unified map, and an integration test case. [1] systemd/systemd#23299 [2] opencontainers#3786 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
cg/sd: support CPUWeight=idle (aka cpu.idle=1)
…-no-init libctr/cgroups: don't take init's cgroup into account
Bumps [lumaxis/shellcheck-problem-matchers](https://github.com/lumaxis/shellcheck-problem-matchers) from 1 to 2. - [Release notes](https://github.com/lumaxis/shellcheck-problem-matchers/releases) - [Commits](lumaxis/shellcheck-problem-matchers@v1...v2) --- updated-dependencies: - dependency-name: lumaxis/shellcheck-problem-matchers dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
These functions were added in ancient times, facilitating the docker-in-docker case when cgroup namespace was not available. As pointed out in commit 2b28b3c, using init 1 cgroup is not correct because it won't work in case of host PID namespace. The last user of GetInitCgroup was removed by commit 54e2021. GetInitCgroupPath was never used as far as I can see, nor was I able to find any external users. Remove both functions. Modify the comment in libct/cg/fs.subsysPath to not refer to GetInitCgroupPath. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
tests: Fix fuzzer location in oss-fuzz config
…/github_actions/lumaxis/shellcheck-problem-matchers-2 build(deps): bump lumaxis/shellcheck-problem-matchers from 1 to 2
…oup-path libct/cg: rm GetInitCgroup[Path]
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0. - [Release notes](https://github.com/golang/sys/releases) - [Commits](golang/sys@v0.6.0...v0.7.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…/go_modules/golang.org/x/sys-0.7.0 build(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
This version is already used by Cirrus CI Fedora 37 job, but other CI jobs are still using 1.3.0. Bump it everywhere so we can enjoy new version features and fixes. For one thing, I noticed that new bats is reporting error location correctly. We will also be able to use "run !" and "run -N" commands. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Apparently, bash with set -e deliberately ignores non-zero return codes from ! cmd, unless this is the last command. The workaround is to either use "! cmd || false', "or run ! cmd". Choose the latter, and require bash-core 1.5.0 (since this is when "run !" was added), replacing the older check. Alas I only learned this recently from the bash-core documentation. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This is just so that the container can join the misc controller. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This variable is used in curl to download a go release, so we are using the initial Go 1.19 release in Cirrus CI, not the latest Go 1.19.x release. From the CI perspective, it makes more sense to use the latest release. Add some jq magic to extract the latest minor release information from the download page, and use it. This brings Cirrus CI jobs logic in line with all the others (GHA, Dockerfile), where by 1.20 we actually mean "latest 1.20.x". Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1. Do not use echo, as this results in lines like this: ... echo "-----" ----- ... 2. Move "cat /proc/cpuinfo" to be the last one, as the output is usually very long. 3. Add "go version" to CentOS jobs. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
ci/cirrus: use Go 1.19.x not 1.19
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.9.0. - [Release notes](https://github.com/golang/net/releases) - [Commits](golang/net@v0.8.0...v0.9.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…/go_modules/golang.org/x/net-0.9.0 build(deps): bump golang.org/x/net from 0.8.0 to 0.9.0
bump bats-core, fix some tests, use new features
For test jobs, add ubuntu 22.04 into the matrix, so we can test of both cgroup v1 and v2. For validate jobs, just switch to ubuntu 22.04 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
ci/gha: add ubuntu 22.04
Do not accept setjmp return value as variable. Signed-off-by: Kazuki Hasegawa <nanasi880@gmail.com>
Kazuki Hasegawa (1): Fix undefined behavior. Do not accept setjmp return value as variable. LGTMs: AkihiroSuda cyphar Closes opencontainers#3790
More info: https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt Signed-off-by: Paweł Szulik <pawel.szulik@intel.com>
e5ce002 to
775a366
Compare
Signed-off-by: Paweł Szulik <paul.szulik@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Paweł Szulik pawel.szulik@intel.com