Is a cgroup a list of key value pairs or a set of processes?Does each directory under `/sys/fs/cgroup/` represent a cgroup hierarchy, or a controller?Do processes in cgroups have to be set every boot? If so, how to persist them?CGroup Processes Not Terminated even when main process has been killed through Systemctl stop commandHow to set a process’s sched method to fifo and priority when cgroup are on?Cannot set memory.memsw.limit_in_bytes in cgroup on Ubuntu server using cgmIs there a way to identify the PID (or cgroup) of a socket without iterating through all the processes in /proc/Place all processes belonging to user in a cgroupCould not find writable mount point for cgroup hierarchy 13 while trying to create cgroupCgroup memory.usage_in_bytes shows incorrect valueWhat's the Linux kernel's behaviour when processes in a cgroup hit their memory limit?How do I read the systemd MemoryHigh value from the /sys/fs/cgroup filesystem?
Can I legally use front facing blue light in the UK?
extract characters between two commas?
When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?
What do the Banks children have against barley water?
Can I find out the caloric content of bread by dehydrating it?
Re-submission of rejected manuscript without informing co-authors
Is it wise to focus on putting odd beats on left when playing double bass drums?
Is Fable (1996) connected in any way to the Fable franchise from Lionhead Studios?
Need help identifying/translating a plaque in Tangier, Morocco
How could a lack of term limits lead to a "dictatorship?"
Can the Produce Flame cantrip be used to grapple, or as an unarmed strike, in the right circumstances?
Crop image to path created in TikZ?
Pristine Bit Checking
Check if two datetimes are between two others
Is this food a bread or a loaf?
Are objects structures and/or vice versa?
LWC and complex parameters
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?
What to wear for invited talk in Canada
Doomsday-clock for my fantasy planet
Is "plugging out" electronic devices an American expression?
What does it exactly mean if a random variable follows a distribution
Email Account under attack (really) - anything I can do?
Is a cgroup a list of key value pairs or a set of processes?
Does each directory under `/sys/fs/cgroup/` represent a cgroup hierarchy, or a controller?Do processes in cgroups have to be set every boot? If so, how to persist them?CGroup Processes Not Terminated even when main process has been killed through Systemctl stop commandHow to set a process’s sched method to fifo and priority when cgroup are on?Cannot set memory.memsw.limit_in_bytes in cgroup on Ubuntu server using cgmIs there a way to identify the PID (or cgroup) of a socket without iterating through all the processes in /proc/Place all processes belonging to user in a cgroupCould not find writable mount point for cgroup hierarchy 13 while trying to create cgroupCgroup memory.usage_in_bytes shows incorrect valueWhat's the Linux kernel's behaviour when processes in a cgroup hit their memory limit?How do I read the systemd MemoryHigh value from the /sys/fs/cgroup filesystem?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I get the idea that a cgroup is a set of processes satisfying some conditions, from http://man7.org/linux/man-pages/man7/cgroups.7.html
A cgroup is a collection of processes that are bound to a set of
limits or parameters defined via the cgroup filesystem.
Am I correct that to find out the cgroup of a process with a givn PID, just run
$ cat /proc/11/cgroup
12:perf_event:/
11:blkio:/
10:hugetlb:/
9:freezer:/
8:pids:/
7:cpuset:/
6:devices:/
5:cpu,cpuacct:/
4:rdma:/
3:memory:/
2:net_cls,net_prio:/
1:name=systemd:/
0::/
I thought cgroup is a id number. but it is a list of key value pairs.
Does the above list of key value pairs represent a list of processes?
Can I find out all the processes in the same cgroup?
Thanks.
cgroups
add a comment |
I get the idea that a cgroup is a set of processes satisfying some conditions, from http://man7.org/linux/man-pages/man7/cgroups.7.html
A cgroup is a collection of processes that are bound to a set of
limits or parameters defined via the cgroup filesystem.
Am I correct that to find out the cgroup of a process with a givn PID, just run
$ cat /proc/11/cgroup
12:perf_event:/
11:blkio:/
10:hugetlb:/
9:freezer:/
8:pids:/
7:cpuset:/
6:devices:/
5:cpu,cpuacct:/
4:rdma:/
3:memory:/
2:net_cls,net_prio:/
1:name=systemd:/
0::/
I thought cgroup is a id number. but it is a list of key value pairs.
Does the above list of key value pairs represent a list of processes?
Can I find out all the processes in the same cgroup?
Thanks.
cgroups
add a comment |
I get the idea that a cgroup is a set of processes satisfying some conditions, from http://man7.org/linux/man-pages/man7/cgroups.7.html
A cgroup is a collection of processes that are bound to a set of
limits or parameters defined via the cgroup filesystem.
Am I correct that to find out the cgroup of a process with a givn PID, just run
$ cat /proc/11/cgroup
12:perf_event:/
11:blkio:/
10:hugetlb:/
9:freezer:/
8:pids:/
7:cpuset:/
6:devices:/
5:cpu,cpuacct:/
4:rdma:/
3:memory:/
2:net_cls,net_prio:/
1:name=systemd:/
0::/
I thought cgroup is a id number. but it is a list of key value pairs.
Does the above list of key value pairs represent a list of processes?
Can I find out all the processes in the same cgroup?
Thanks.
cgroups
I get the idea that a cgroup is a set of processes satisfying some conditions, from http://man7.org/linux/man-pages/man7/cgroups.7.html
A cgroup is a collection of processes that are bound to a set of
limits or parameters defined via the cgroup filesystem.
Am I correct that to find out the cgroup of a process with a givn PID, just run
$ cat /proc/11/cgroup
12:perf_event:/
11:blkio:/
10:hugetlb:/
9:freezer:/
8:pids:/
7:cpuset:/
6:devices:/
5:cpu,cpuacct:/
4:rdma:/
3:memory:/
2:net_cls,net_prio:/
1:name=systemd:/
0::/
I thought cgroup is a id number. but it is a list of key value pairs.
Does the above list of key value pairs represent a list of processes?
Can I find out all the processes in the same cgroup?
Thanks.
cgroups
cgroups
edited Apr 5 at 18:27
Stephen Kitt
180k25411491
180k25411491
asked Apr 5 at 17:52
TimTim
28.5k79269491
28.5k79269491
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
As indicated in the manual page you’re referring to, a cgroup is a set of processes.
The contents of /proc/11/cgroup
describe all the control groups to which process 11 belongs. For v1 groups, the first field on each line is the hierarchy id, the second is the list of controllers, and the third is the pathname of the cgroup in the hierarchy. For v2 groups, the first field is 0, the second is empty, and the third is the pathname.
To find all the processes in a cgroup, look at the tasks
file in the corresponding sysfs directory, for example
cat /sys/fs/cgroup/perf_event/tasks
which corresponds to 12:perf_event:/
:
| /sys/fs/cgroup/ | perf_event | / | tasks
| | | |
|< mountpoint >|<controller>| ^ |
|
cgroup pathname --+
Thanks.perf_event
isn't a cgroup but a controller. So/sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller
– Tim
Apr 5 at 23:44
You’re forgetting the third field in12:perf_event:/
.
– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here/
. Is it a relative pathname with respect to some other pathname? (2) Does/sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in12:perf_event:/
?
– Stephen Kitt
yesterday
|
show 4 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510774%2fis-a-cgroup-a-list-of-key-value-pairs-or-a-set-of-processes%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
As indicated in the manual page you’re referring to, a cgroup is a set of processes.
The contents of /proc/11/cgroup
describe all the control groups to which process 11 belongs. For v1 groups, the first field on each line is the hierarchy id, the second is the list of controllers, and the third is the pathname of the cgroup in the hierarchy. For v2 groups, the first field is 0, the second is empty, and the third is the pathname.
To find all the processes in a cgroup, look at the tasks
file in the corresponding sysfs directory, for example
cat /sys/fs/cgroup/perf_event/tasks
which corresponds to 12:perf_event:/
:
| /sys/fs/cgroup/ | perf_event | / | tasks
| | | |
|< mountpoint >|<controller>| ^ |
|
cgroup pathname --+
Thanks.perf_event
isn't a cgroup but a controller. So/sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller
– Tim
Apr 5 at 23:44
You’re forgetting the third field in12:perf_event:/
.
– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here/
. Is it a relative pathname with respect to some other pathname? (2) Does/sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in12:perf_event:/
?
– Stephen Kitt
yesterday
|
show 4 more comments
As indicated in the manual page you’re referring to, a cgroup is a set of processes.
The contents of /proc/11/cgroup
describe all the control groups to which process 11 belongs. For v1 groups, the first field on each line is the hierarchy id, the second is the list of controllers, and the third is the pathname of the cgroup in the hierarchy. For v2 groups, the first field is 0, the second is empty, and the third is the pathname.
To find all the processes in a cgroup, look at the tasks
file in the corresponding sysfs directory, for example
cat /sys/fs/cgroup/perf_event/tasks
which corresponds to 12:perf_event:/
:
| /sys/fs/cgroup/ | perf_event | / | tasks
| | | |
|< mountpoint >|<controller>| ^ |
|
cgroup pathname --+
Thanks.perf_event
isn't a cgroup but a controller. So/sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller
– Tim
Apr 5 at 23:44
You’re forgetting the third field in12:perf_event:/
.
– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here/
. Is it a relative pathname with respect to some other pathname? (2) Does/sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in12:perf_event:/
?
– Stephen Kitt
yesterday
|
show 4 more comments
As indicated in the manual page you’re referring to, a cgroup is a set of processes.
The contents of /proc/11/cgroup
describe all the control groups to which process 11 belongs. For v1 groups, the first field on each line is the hierarchy id, the second is the list of controllers, and the third is the pathname of the cgroup in the hierarchy. For v2 groups, the first field is 0, the second is empty, and the third is the pathname.
To find all the processes in a cgroup, look at the tasks
file in the corresponding sysfs directory, for example
cat /sys/fs/cgroup/perf_event/tasks
which corresponds to 12:perf_event:/
:
| /sys/fs/cgroup/ | perf_event | / | tasks
| | | |
|< mountpoint >|<controller>| ^ |
|
cgroup pathname --+
As indicated in the manual page you’re referring to, a cgroup is a set of processes.
The contents of /proc/11/cgroup
describe all the control groups to which process 11 belongs. For v1 groups, the first field on each line is the hierarchy id, the second is the list of controllers, and the third is the pathname of the cgroup in the hierarchy. For v2 groups, the first field is 0, the second is empty, and the third is the pathname.
To find all the processes in a cgroup, look at the tasks
file in the corresponding sysfs directory, for example
cat /sys/fs/cgroup/perf_event/tasks
which corresponds to 12:perf_event:/
:
| /sys/fs/cgroup/ | perf_event | / | tasks
| | | |
|< mountpoint >|<controller>| ^ |
|
cgroup pathname --+
edited yesterday
answered Apr 5 at 18:37
Stephen KittStephen Kitt
180k25411491
180k25411491
Thanks.perf_event
isn't a cgroup but a controller. So/sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller
– Tim
Apr 5 at 23:44
You’re forgetting the third field in12:perf_event:/
.
– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here/
. Is it a relative pathname with respect to some other pathname? (2) Does/sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in12:perf_event:/
?
– Stephen Kitt
yesterday
|
show 4 more comments
Thanks.perf_event
isn't a cgroup but a controller. So/sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller
– Tim
Apr 5 at 23:44
You’re forgetting the third field in12:perf_event:/
.
– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here/
. Is it a relative pathname with respect to some other pathname? (2) Does/sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in12:perf_event:/
?
– Stephen Kitt
yesterday
Thanks.
perf_event
isn't a cgroup but a controller. So /sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller– Tim
Apr 5 at 23:44
Thanks.
perf_event
isn't a cgroup but a controller. So /sys/fs/cgroup/perf_event/tasks
seems to find all processes for a controller– Tim
Apr 5 at 23:44
You’re forgetting the third field in
12:perf_event:/
.– Stephen Kitt
2 days ago
You’re forgetting the third field in
12:perf_event:/
.– Stephen Kitt
2 days ago
(1) The third field is "the pathname of the cgroup in the hierarchy", here
/
. Is it a relative pathname with respect to some other pathname? (2) Does /sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?– Tim
yesterday
(1) The third field is "the pathname of the cgroup in the hierarchy", here
/
. Is it a relative pathname with respect to some other pathname? (2) Does /sys/fs/cgroup/perf_event/tasks
depend on the third field? also on the second field, which is a list of controllers?– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
I posted a related post unix.stackexchange.com/questions/511066/…
– Tim
yesterday
You really don’t see how
/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in 12:perf_event:/
?– Stephen Kitt
yesterday
You really don’t see how
/sys/fs/cgroup/perf_event/tasks
is contructed, based on the information in 12:perf_event:/
?– Stephen Kitt
yesterday
|
show 4 more comments
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510774%2fis-a-cgroup-a-list-of-key-value-pairs-or-a-set-of-processes%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown