Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752278AbeAJWTA (ORCPT + 1 other); Wed, 10 Jan 2018 17:19:00 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:35593 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbeAJWS5 (ORCPT ); Wed, 10 Jan 2018 17:18:57 -0500 X-Google-Smtp-Source: ACJfBot2sYa663u91+L6aRBpHH5SGRR1zKrsFBIcN01loxIl2jKBPI3oWNW9RUSxEFOY4Z4gOfzIog== Cc: mtk.manpages@gmail.com, Peter Zijlstra , cgroups@vger.kernel.org, lkml , linux-man , "Serge E. Hallyn" , Mike Galbraith , Li Zefan , Ingo Molnar , Paul Turner , kernel-team@fb.com, Andy Lutomirski , Johannes Weiner , Lauro Venancio , Waiman Long Subject: Re: cgroups(7): documenting cgroups v2 thread mode To: Tejun Heo References: <20180109211000.GT3668920@devbig577.frc2.facebook.com> <5c9ea5dd-12dc-99d6-7905-40fdbc34e6ae@gmail.com> <20180110144708.GC3668920@devbig577.frc2.facebook.com> From: "Michael Kerrisk (man-pages)" Message-ID: <704d0cd5-0bab-f876-a09c-9d60e9d2ef93@gmail.com> Date: Wed, 10 Jan 2018 23:18:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180110144708.GC3668920@devbig577.frc2.facebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hello Tejun, On 01/10/2018 03:47 PM, Tejun Heo wrote: > Hello, > > On Tue, Jan 09, 2018 at 11:54:03PM +0100, Michael Kerrisk (man-pages) wrote: >> One more thing. I added the following sentence to the text: >> >> The cgroup.threads file is writable only for the cgroups inside a >> threaded subtree. >> >> Can you confirm that that is correct, please. > > The only extra restriction is that the domain cgroup must be the same > for the source and destination, which is true for the entire threaded > subtree (the threaded domain). As each domain cgroup is its own > unique domain, cgroup.threads in them would only allow migrating to > self which is a noop; otherwise, it'd return -EOPNOTSUPP. Ahh yes. Now I understand. I made the description of the containment rules for cgroup.threads more explicit in the text: As with writing to cgroup.procs, some containment rules apply when writing to the cgroup.threads file: * The writer must have write permission on the cgroup.threads file in the destination cgroup. * The writer must have write permission on the cgroup.procs file in the common ancestor of the source and destination cgroups. (In some cases, the common ancestor may be the source or desti‐ nation cgroup itself.) * The source and destination cgroups must be in the same threaded subtree. (Outside a threaded subtree, an attempt to move a thread by writing its thread ID to the cgroup.threads in a dif‐ ferent domain cgroup fails with the error EOPNOTSUPP.) Okay? (I realize that the last bullet point is a rather different way of formulating your idea that "the only extra restriction is that the domain cgroup must be the same for the source and destination". But I think the reformulation is easier to understand, no?) Cheers, Michael -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/