Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
e4f23a0f
Unverified
Commit
e4f23a0f
authored
Feb 18, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: kill monitor_full_path
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
c0fb6f36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
12 deletions
+6
-12
cgfsng.c
src/lxc/cgroups/cgfsng.c
+5
-7
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-5
No files found.
src/lxc/cgroups/cgfsng.c
View file @
e4f23a0f
...
@@ -1172,7 +1172,6 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
...
@@ -1172,7 +1172,6 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
h
->
container_limit_path
=
h
->
container_full_path
;
h
->
container_limit_path
=
h
->
container_full_path
;
}
else
{
}
else
{
h
->
cgfd_mon
=
move_fd
(
fd_final
);
h
->
cgfd_mon
=
move_fd
(
fd_final
);
h
->
monitor_full_path
=
move_ptr
(
path
);
}
}
return
true
;
return
true
;
...
@@ -1199,7 +1198,6 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
...
@@ -1199,7 +1198,6 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
if
(
h
->
cgfd_mon
<
0
)
if
(
h
->
cgfd_mon
<
0
)
prune
=
false
;
prune
=
false
;
free_disarm
(
h
->
monitor_full_path
);
close_prot_errno_disarm
(
h
->
cgfd_mon
);
close_prot_errno_disarm
(
h
->
cgfd_mon
);
}
}
...
@@ -1384,7 +1382,7 @@ __cgfsng_ops static bool cgfsng_monitor_create(struct cgroup_ops *ops, struct lx
...
@@ -1384,7 +1382,7 @@ __cgfsng_ops static bool cgfsng_monitor_create(struct cgroup_ops *ops, struct lx
monitor_cgroup
,
NULL
,
false
))
monitor_cgroup
,
NULL
,
false
))
continue
;
continue
;
DEBUG
(
"Failed to create cgroup
\"
%s
\"
"
,
maybe_empty
(
ops
->
hierarchies
[
i
]
->
monitor_full_path
)
);
DEBUG
(
"Failed to create cgroup
%s)"
,
monitor_cgroup
);
for
(
int
j
=
0
;
j
<=
i
;
j
++
)
for
(
int
j
=
0
;
j
<=
i
;
j
++
)
cgroup_tree_prune_leaf
(
ops
->
hierarchies
[
j
],
cgroup_tree_prune_leaf
(
ops
->
hierarchies
[
j
],
monitor_cgroup
,
false
);
monitor_cgroup
,
false
);
...
@@ -1546,18 +1544,18 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
...
@@ -1546,18 +1544,18 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
ret
=
lxc_writeat
(
h
->
cgfd_mon
,
"cgroup.procs"
,
monitor
,
monitor_len
);
ret
=
lxc_writeat
(
h
->
cgfd_mon
,
"cgroup.procs"
,
monitor
,
monitor_len
);
if
(
ret
)
if
(
ret
)
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup
\"
%s
\"
"
,
h
->
monitor_full_path
);
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup
%d"
,
h
->
cgfd_mon
);
TRACE
(
"Moved monitor into
%s cgroup via %d"
,
h
->
monitor_full_path
,
h
->
cgfd_mon
);
TRACE
(
"Moved monitor into
cgroup %d"
,
h
->
cgfd_mon
);
if
(
handler
->
transient_pid
<=
0
)
if
(
handler
->
transient_pid
<=
0
)
continue
;
continue
;
ret
=
lxc_writeat
(
h
->
cgfd_mon
,
"cgroup.procs"
,
transient
,
transient_len
);
ret
=
lxc_writeat
(
h
->
cgfd_mon
,
"cgroup.procs"
,
transient
,
transient_len
);
if
(
ret
)
if
(
ret
)
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup
\"
%s
\"
"
,
h
->
monitor_full_path
);
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup
%d"
,
h
->
cgfd_mon
);
TRACE
(
"Moved transient process into
%s cgroup via %d"
,
h
->
monitor_full_path
,
h
->
cgfd_mon
);
TRACE
(
"Moved transient process into
cgroup %d"
,
h
->
cgfd_mon
);
/*
/*
* we don't keep the fds for non-unified hierarchies around
* we don't keep the fds for non-unified hierarchies around
...
...
src/lxc/cgroups/cgroup.h
View file @
e4f23a0f
...
@@ -62,9 +62,6 @@ typedef enum {
...
@@ -62,9 +62,6 @@ typedef enum {
* - The full path to the container's limiting cgroup. May simply point to
* - The full path to the container's limiting cgroup. May simply point to
* container_full_path.
* container_full_path.
*
*
* @monitor_full_path
* - The full path to the monitor's cgroup.
*
* @version
* @version
* - legacy hierarchy
* - legacy hierarchy
* If the hierarchy is a legacy hierarchy this will be set to
* If the hierarchy is a legacy hierarchy this will be set to
...
@@ -84,7 +81,6 @@ struct hierarchy {
...
@@ -84,7 +81,6 @@ struct hierarchy {
char
*
container_base_path
;
char
*
container_base_path
;
char
*
container_full_path
;
char
*
container_full_path
;
char
*
container_limit_path
;
char
*
container_limit_path
;
char
*
monitor_full_path
;
int
version
;
int
version
;
/* cgroup2 only */
/* cgroup2 only */
...
@@ -101,7 +97,7 @@ struct hierarchy {
...
@@ -101,7 +97,7 @@ struct hierarchy {
*/
*/
int
cgfd_limit
;
int
cgfd_limit
;
/* File descriptor for the monitor's cgroup
@monitor_full_path
. */
/* File descriptor for the monitor's cgroup. */
int
cgfd_mon
;
int
cgfd_mon
;
/* File descriptor for the controller's mountpoint @mountpoint. */
/* File descriptor for the controller's mountpoint @mountpoint. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment