Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
2a09d91d
Commit
2a09d91d
authored
8 years ago
by
Janne Blomqvist
Committed by
Brian Christiansen
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove cpuset & devices cgroups after steps finish
Bugs 2681 and 2703
parent
dd14342d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
src/plugins/task/cgroup/task_cgroup_cpuset.c
+26
-0
26 additions, 0 deletions
src/plugins/task/cgroup/task_cgroup_cpuset.c
src/plugins/task/cgroup/task_cgroup_devices.c
+28
-0
28 additions, 0 deletions
src/plugins/task/cgroup/task_cgroup_devices.c
with
56 additions
and
0 deletions
NEWS
+
2
−
0
View file @
2a09d91d
...
@@ -6,6 +6,8 @@ documents those changes that are of interest to users and administrators.
...
@@ -6,6 +6,8 @@ documents those changes that are of interest to users and administrators.
-- Add new RPC (REQUEST_EVENT_LOG) so that slurmd and slurmstepd can log events
-- Add new RPC (REQUEST_EVENT_LOG) so that slurmd and slurmstepd can log events
through the slurmctld daemon.
through the slurmctld daemon.
-- Remove sbatch --bb option. That option was never supported.
-- Remove sbatch --bb option. That option was never supported.
-- Automically cleanup task/cgroup cpuset and devices cgroups after steps are
done.
* Changes in Slurm 17.02.0pre1
* Changes in Slurm 17.02.0pre1
==============================
==============================
...
...
This diff is collapsed.
Click to expand it.
src/plugins/task/cgroup/task_cgroup_cpuset.c
+
26
−
0
View file @
2a09d91d
...
@@ -1056,6 +1056,32 @@ extern int task_cgroup_cpuset_init(slurm_cgroup_conf_t *slurm_cgroup_conf)
...
@@ -1056,6 +1056,32 @@ extern int task_cgroup_cpuset_init(slurm_cgroup_conf_t *slurm_cgroup_conf)
extern
int
task_cgroup_cpuset_fini
(
slurm_cgroup_conf_t
*
slurm_cgroup_conf
)
extern
int
task_cgroup_cpuset_fini
(
slurm_cgroup_conf_t
*
slurm_cgroup_conf
)
{
{
xcgroup_t
cpuset_cg
;
/* Similarly to task_cgroup_memory_fini(), we must lock the
* root cgroup so we don't race with another job step that is
* being started. */
if
(
xcgroup_create
(
&
cpuset_ns
,
&
cpuset_cg
,
""
,
0
,
0
)
==
XCGROUP_SUCCESS
)
{
if
(
xcgroup_lock
(
&
cpuset_cg
)
==
XCGROUP_SUCCESS
)
{
/* First move slurmstepd to the root cpuset cg
* so we can remove the step/job/user cpuset
* cg's. */
xcgroup_move_process
(
&
cpuset_cg
,
getpid
());
if
(
xcgroup_delete
(
&
step_cpuset_cg
)
!=
SLURM_SUCCESS
)
debug2
(
"task/cgroup: unable to remove step "
"cpuset : %m"
);
if
(
xcgroup_delete
(
&
job_cpuset_cg
)
!=
XCGROUP_SUCCESS
)
debug2
(
"task/cgroup: not removing "
"job cpuset : %m"
);
if
(
xcgroup_delete
(
&
user_cpuset_cg
)
!=
XCGROUP_SUCCESS
)
debug2
(
"task/cgroup: not removing "
"user cpuset : %m"
);
xcgroup_unlock
(
&
cpuset_cg
);
}
else
error
(
"task/cgroup: unable to lock root cpuset : %m"
);
xcgroup_destroy
(
&
cpuset_cg
);
}
else
error
(
"task/cgroup: unable to create root cpuset : %m"
);
if
(
user_cgroup_path
[
0
]
!=
'\0'
)
if
(
user_cgroup_path
[
0
]
!=
'\0'
)
xcgroup_destroy
(
&
user_cpuset_cg
);
xcgroup_destroy
(
&
user_cpuset_cg
);
...
...
This diff is collapsed.
Click to expand it.
src/plugins/task/cgroup/task_cgroup_devices.c
+
28
−
0
View file @
2a09d91d
...
@@ -113,6 +113,34 @@ error:
...
@@ -113,6 +113,34 @@ error:
extern
int
task_cgroup_devices_fini
(
slurm_cgroup_conf_t
*
slurm_cgroup_conf
)
extern
int
task_cgroup_devices_fini
(
slurm_cgroup_conf_t
*
slurm_cgroup_conf
)
{
{
xcgroup_t
devices_cg
;
/* Similarly to task_cgroup_{memory,cpuset}_fini(), we must lock the
* root cgroup so we don't race with another job step that is
* being started. */
if
(
xcgroup_create
(
&
devices_ns
,
&
devices_cg
,
""
,
0
,
0
)
==
XCGROUP_SUCCESS
)
{
if
(
xcgroup_lock
(
&
devices_cg
)
==
XCGROUP_SUCCESS
)
{
/* First move slurmstepd to the root devices cg
* so we can remove the step/job/user devices
* cg's. */
xcgroup_move_process
(
&
devices_cg
,
getpid
());
if
(
xcgroup_delete
(
&
step_devices_cg
)
!=
SLURM_SUCCESS
)
debug2
(
"task/cgroup: unable to remove step "
"devices : %m"
);
if
(
xcgroup_delete
(
&
job_devices_cg
)
!=
XCGROUP_SUCCESS
)
debug2
(
"task/cgroup: not removing "
"job devices : %m"
);
if
(
xcgroup_delete
(
&
user_devices_cg
)
!=
XCGROUP_SUCCESS
)
debug2
(
"task/cgroup: not removing "
"user devices : %m"
);
xcgroup_unlock
(
&
devices_cg
);
}
else
error
(
"task/cgroup: unable to lock root devices : %m"
);
xcgroup_destroy
(
&
devices_cg
);
}
else
error
(
"task/cgroup: unable to create root devices : %m"
);
if
(
user_cgroup_path
[
0
]
!=
'\0'
)
if
(
user_cgroup_path
[
0
]
!=
'\0'
)
xcgroup_destroy
(
&
user_devices_cg
);
xcgroup_destroy
(
&
user_devices_cg
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment