mirror of
https://github.com/0xAX/linux-insides.git
synced 2024-12-22 06:38:07 +00:00
copyedit: cgroups chapter
This commit is contained in:
parent
e287181a33
commit
b86c8b8519
@ -174,7 +174,7 @@ print line
|
|||||||
./cgroup_test_script.sh: line 5: /dev/tty: Operation not permitted
|
./cgroup_test_script.sh: line 5: /dev/tty: Operation not permitted
|
||||||
```
|
```
|
||||||
|
|
||||||
Similar situation will be when you will run you [docker](https://en.wikipedia.org/wiki/Docker_\(software\)) containers for example:
|
Similar situation will be when you will run you [docker](https://en.wikipedia.org/wiki/Docker_(software)) containers for example:
|
||||||
|
|
||||||
```
|
```
|
||||||
~$ docker ps
|
~$ docker ps
|
||||||
@ -213,7 +213,7 @@ Control group /:
|
|||||||
│ └─6404 /bin/bash
|
│ └─6404 /bin/bash
|
||||||
```
|
```
|
||||||
|
|
||||||
Now we know a little about `control groups` mechanism, how to use it manually and what's purpose of this mechanism. It's time to look inside of the Linux kernel source code and start to dive into implementation of this mechanism.
|
Now we know a little about `control groups` mechanism, how to use it manually and what's the purpose of this mechanism. It's time to look inside of the Linux kernel source code and start to dive into implementation of this mechanism.
|
||||||
|
|
||||||
Early initialization of control groups
|
Early initialization of control groups
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@ -294,7 +294,7 @@ Here we may see call of the `init_cgroup_root` function which will execute initi
|
|||||||
struct cgroup_root cgrp_dfl_root;
|
struct cgroup_root cgrp_dfl_root;
|
||||||
```
|
```
|
||||||
|
|
||||||
Its `cgrp` field represented by the `cgroup` structure which represents a `cgroup` as you already may guess and defined in the [include/linux/cgroup-defs.h](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/include/linux/cgroup-defs.h) header file. We already know that a process which is represented by the `task_struct` in the Linux kernel. The `task_struct` does not contain direct link to a `cgroup` where this task is attached. But it may be reached via `css_set` field of the `task_struct`. This `css_set` structure holds pointer to the array of subsystem states:
|
Its `cgrp` field represented by the `cgroup` structure which represents a `cgroup` as you already may guess and defined in the [include/linux/cgroup-defs.h](https://github.com/torvalds/linux/blob/16f73eb02d7e1765ccab3d2018e0bd98eb93d973/include/linux/cgroup-defs.h) header file. We already know that a process is represented by the `task_struct` in the Linux kernel. The `task_struct` does not contain direct link to a `cgroup` where this task is attached. But it may be reached via `css_set` field of the `task_struct`. This `css_set` structure holds pointer to the array of subsystem states:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
struct css_set {
|
struct css_set {
|
||||||
|
Loading…
Reference in New Issue
Block a user