Commit aa912e4a authored by Mark A. Grondona's avatar Mark A. Grondona
Browse files

xcgroup: add xcgroup_move_process helper function

This patch adds a helper function to common/xcgroup.c to aid
in moving processes between cgroups. If the cgroups.procs file
is writable then writing the PID to that file is used, as this
method moves all threads in a process atomically.

If cgroups.procs is not writable, then each thread must be moved
individually by walking the /proc/PID/task/ directory and writing
each taskid individually to the 'tasks' file in the cgroup. The
second method is racy if a process is concurrently creating
threads, but it is better than the current method of just moving
one of the process's threads.
parent b720f7f1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment