Questions tagged [cgroups]

cgroups are used to control resource management in kernel. They remain in an hierarchy and a new group can be created just by creating a directory in the appropriate place. Using cgroups, a lot of resource management can be done including memory, cpu etc.

cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for, and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.

369 questions
1
vote
1 answer

What does hierarchy support do in cgroup?

cgroup has 2 options for memory control: memory.use_hierarchy = 1 : use hierarchy memory.use_hierarchy = 0 : use flat hierarchy, according to this answer What is the difference between the two? I think, hierarchy is hierarchy, what does "flat"…
Amumu
  • 17,924
  • 31
  • 84
  • 131
1
vote
0 answers

How to use cgroup for MPI programs

Since MPI processes are invoded by mpirun/mpiexec, not by the resource manager or scheduler(torque/maui), then how to use cgroup to isolate memory and cpuset usage for every MPI process, note that we can not modify the MPI library(openmpi/mpich2),…
levin li
  • 391
  • 3
  • 10
0
votes
1 answer

CFS Priority Scheduler on Linux

How can I avoid child inheriting the cgroup of parent? In my system I have some cgroup hierarchy, one of the process is running under some particular cgroup and it spawn some process, and the child is by default running under same cgroup, but I…
pankanaj
  • 903
  • 3
  • 10
  • 13
0
votes
1 answer

Is there a way to prevent a descendant thread from getting into cgroup of its ancestor thread automatically?

I write some threads of my app to a Linux cpu cgroup, created by me, explicitly (let us talk e.g. about v1 for now, but if you know a way for v2, that would be also great). However, I see that descendant threads (created with pthread_create() called…
JenyaKh
  • 2,040
  • 17
  • 25
0
votes
0 answers

Java process with sudo not coming under created cgroup

I have a service which runs a Java process. I am assigning cgroup to the service via a slice being added in the systemd unit file. Every command that is run in the run.sh including cat commands come under the cgroup, however the main command to run…
0
votes
0 answers

Cannot execute docker exec systemctl --user for a Docker container running systemd as PID=1?

If my container running (ENTRYPOINT aka PID 1) - /lib/systemd/systemd systemd.unit=multi-user.service, and also I have VOLUME ["/sys/fs/cgroup"] then why docker exec -it --privileged systemctl --user will display me Failed to connect to bus: No such…
AnthonyGP
  • 47
  • 2
0
votes
0 answers

How to changes CPUShares for cgroup `docker`

I have Ubuntu 20.04, docker-ce 20.10.9, cgroup v1 When I start docker container, apperently docker, creates a cgroup docker with cpu.shares=1024. Where I can set the custom value of cpu.shares for this whole cgroup? I can set custom cpu.shares for…
DeamonMV
  • 722
  • 1
  • 10
  • 19
0
votes
0 answers

Cannot isolate cpu using cgroup v2

I am trying to make a stable environment for benchmarking So I need to isolate cpu (no other processes use an isolated one) I cannot use cset (works with cgroup v1 only) and I cannot use isolcpus (forbidden by a security policy). As far as I can…
Vladimir Tsyshnatiy
  • 989
  • 1
  • 10
  • 20
0
votes
0 answers

Is PageCache utilization controlled by cgroup memory quota?

If I create a cgroup with 100GB memory quota on a 256GB memory machine. After allocating 60GB anonymous memory in this cgroup, how much memory could be used for pagecache? 40GB or 196GB?
0
votes
0 answers

How to assign task to a specific set of cores exclusively?

I want to run a benchmarks to test the scalability of my modified Linux kernel. The benchmark suite use a python script to call each benchmark. I have tried two methods. Using echo 0 > /sys/devices/system/cpu/cpu${i}/online to shut down some cores…
Haoan
  • 71
  • 8
0
votes
0 answers

Clone into a specific cgroup with CLONE_INTO_CGROUP flag ,but don't change the real properties of task_struct

1、I try to use CLONE_INTO_CGROUP flag to Clone a task into a specific cpuset cgroup, then I found the child's cpuset is correct, but the real properties(task_struct->cpus_mask for me) are inherited from the parent process.It's not what I…
honor
  • 1
0
votes
0 answers

Find subsystem of sys/fs/cgroup

Why am I unable to access the cgroup's filesystem as expected in Ubuntu 22.04 (Jammy Jellyfish) virtual machine? I can only see a few files instead of the specific directory enter image description here enter image description here Now I use virtual…
Taehyeok
  • 1
  • 1
0
votes
0 answers

Docker Error - cgroup mountpoint does not exist: unknown

I have a Python/Flask application (Docker) that calls a Docker in Docker (DinD) process but when that call happens, I see: 2023-07-07T02:21:28.733399366Z Traceback (most recent call last): 2023-07-07T02:21:28.733404074Z File…
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52
0
votes
0 answers

/sys/fs/cgroup/cpuset.cpus Not Found After Enabling Privileged Mode In Kubernetes

I am currently running into an issue where /sys/fs/cgroup/cpuset.cpus is no longer present in my Kubernetes Pod when I enable Privileged mode. For example: I start off with a very simple pod spec (test.yaml): apiVersion: v1 kind: Pod metadata: …
PJConnol
  • 119
  • 1
  • 9
0
votes
0 answers

How does docker pauses containers in cgroups v2 in kernel versions lower than 5.2?

The docker pause documentation says : The docker pause command suspends all processes in the specified containers. On Linux, this uses the freezer cgroup. Traditionally, when suspending a process the SIGSTOP signal is used, which is observable by…