]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
clone.2: Note a performance benefit of CLONE_INTO_CGROUP
authorMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 19 May 2020 19:41:08 +0000 (21:41 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Tue, 19 May 2020 19:41:08 +0000 (21:41 +0200)
As noted in email by Christian Brauner:

    I forgot to mention that spawning directly into a target
    cgroup is also more efficient than moving it after creation.
    The specific reason is mentioned in the commit message
    [ef2c41cf38a], the write lock of the semaphore need not be
    taken in contrast to when it is moved afterwards. That
    implementation details is not that interesting but it might
    be interesting to know that it provides performance benefits
    in general.

Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/clone.2

index a0de831deeca4dff45465acb64514d1656d5b9e3..69325ef83c39fd009ec5fa38503176d689668ee8 100644 (file)
@@ -571,6 +571,9 @@ This eliminates the accounting
 jitter that would be caused if the child process was first created in the
 same cgroup as the parent and then
 moved into the target cgroup.
+Furthermore, spawning the child process directly into a target cgroup
+is significantly cheaper than moving the child process into
+the target cgroup after it has been created.
 .IP *
 The
 .BR CLONE_INTO_CGROUP