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

Pod's cpuset is not set correctly #24465

Open
mmmmaeda opened this issue Nov 5, 2024 · 0 comments
Open

Pod's cpuset is not set correctly #24465

mmmmaeda opened this issue Nov 5, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mmmmaeda
Copy link
Contributor

mmmmaeda commented Nov 5, 2024

Issue Description

The value specified using the --cpuset-cpus option during pod creation is not set correctly.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Create pod with the option --cpuset-cpus.
    podman pod create --cpuset-cpus 0 my-pod

Describe the results you received

$ podman pod create --cpuset-cpus 0 my-pod
f5ebcc851517c729f34c27bfe895cf09afc8a51bab055c8244cdb876a8e67e2c

$ journalctl | grep f5ebcc851517c729f34c27bfe895cf09afc8a51bab055c8244cdb876a8e67e2c | grep cpuset
systemd[2274]: user-libpod_pod_f5ebcc851517c729f34c27bfe895cf09afc8a51bab055c8244cdb876a8e67e2c.slice:
Failed to set 'cpuset.cpus' attribute on '/user.slice/user-1000.slice/[email protected]/user.slice/
user-libpod_pod_f5ebcc851517c729f34c27bfe895cf09afc8a51bab055c8244cdb876a8e67e2c.slice' to '4-5': Numerical result out of range

Describe the results you expected

The value specified using the --cpuset-cpus option is set correctly.

podman info output

$ podman version
Client: Podman Engine
Version: 5.3.0-dev
API Version: 5.3.0-dev
Go Version: go1.21.13 (Red Hat 1.21.13-4.el9_4)
Git Commit: 4071bd74bc355c81928c8fa4c3a3ca05ad941929
Built: Wed Oct 23 17:55:48 2024
OS/Arch: linux/amd64

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

In the following, The value of CpusetCpus is being converted to bits as a string, not as a numerical value.
https://github.com/containers/common/blob/main/pkg/cgroups/systemd_linux.go#L182

The following conversion function is required.
https://github.com/opencontainers/runc/blob/main/libcontainer/cgroups/systemd/cpuset.go#L14

@mmmmaeda mmmmaeda added the kind/bug Categorizes issue or PR as related to a bug. label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant