Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp938634ybl; Wed, 8 Jan 2020 08:19:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxmHv+NLp+Po1MmYG5nKqUgx11gmBaVhYPyEMvNFAjKmryNkiD+fHst+w/rScfGaI3jFWUC X-Received: by 2002:a54:4106:: with SMTP id l6mr3573722oic.76.1578500343304; Wed, 08 Jan 2020 08:19:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578500343; cv=none; d=google.com; s=arc-20160816; b=K0LQhEs+BcRRvyyE7iqXHuzO/dbrIGYjVfplfRUAyV3pTYgSTI120tjg4a3Hmh6cXs 1qQiVX7c3tyagaukoTnAjYvgzcNABq+XsT/+MYEKpbHrpTgLdw4viJK0H2fdLrjZjQLV o3M9gzqqEI9pZWg99FJr775R+G5tUK5B+/ltGCLW253dKRFIaQuqeQgMyT0qwQQtRxgO g6urm59Mwe2aqQ1W9y71ZTU92beZhlrYFEMxT+B2WBeT6iLEedggJNHSwMWWhptYdAm7 T4ec3Pe9EevVvHlCh9kfewCoAgQXCvms/gJ++SbFgFWoUljt747PwNTVPRh5oeD7mThi hIsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=nYi/9ghjIaiG727TFvGLi6u/Ym/hL50zibtB4g5pCoY=; b=1JrF+rSThhRokpNLxneHNmqQjV41ZSAJNmG4a50wPw4TvK93dSinRgrM9gpkwTbNIH iXoItpYApiB/lrP8tMzmjLVPRsf9TsbZTLcRo2jzQoiqML+4Tmmo4/fjUIEzg+5ZZN59 3i2gGbdD8Z+YE9FDuJdH//OPYoyGA5z5h9WZpGOpYkNrBLRXucI66jBxRk9rEQfVzrhV T33HqkFOQsHXUNgPL3L0cUYvMT5t4XtQ/p8U1HHSCpFASpcnSoLQhVc//rW5uMF7v6Tl hVxMJDLx8BLaKBkkNsC8qWOVy80gD148OQuHTp2hJq+bgQ7RsOqhIlnlarLBhKPV+Zpo AXzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m24si1929370oic.11.2020.01.08.08.18.43; Wed, 08 Jan 2020 08:19:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbgAHQBJ (ORCPT + 99 others); Wed, 8 Jan 2020 11:01:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:38584 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727152AbgAHQBJ (ORCPT ); Wed, 8 Jan 2020 11:01:09 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 145C8AEAF; Wed, 8 Jan 2020 16:01:07 +0000 (UTC) Date: Wed, 8 Jan 2020 17:01:02 +0100 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Christian Brauner Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Tejun Heo , Ingo Molnar , Oleg Nesterov , Johannes Weiner , Li Zefan , Peter Zijlstra , cgroups@vger.kernel.org Subject: Re: [PATCH v2 2/3] clone3: allow spawning processes into cgroups Message-ID: <20200108160102.GA17415@blackbody.suse.cz> References: <20191223061504.28716-1-christian.brauner@ubuntu.com> <20191223061504.28716-3-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <20191223061504.28716-3-christian.brauner@ubuntu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 23, 2019 at 07:15:03AM +0100, Christian Brauner wrote: > This adds support for creating a process in a different cgroup than its > parent. Binding fork and migration together looks useful. > --- a/kernel/cgroup/cgroup.c > +++ b/kernel/cgroup/cgroup.c > @@ -5882,21 +5882,176 @@ void cgroup_fork(struct task_struct *child) > INIT_LIST_HEAD(&child->cg_list); Just a nitpick, I noticed the comment for cgroup_fork should be updated too (generic migration happens in cgroup_post_fork). > --- a/kernel/fork.c > +++ b/kernel/fork.c > [...] > @@ -2279,8 +2278,7 @@ static __latent_entropy struct task_struct *copy_pr= ocess( > write_unlock_irq(&tasklist_lock); > =20 > proc_fork_connector(p); > - cgroup_post_fork(p); > - cgroup_threadgroup_change_end(current); > + cgroup_post_fork(current, p, args); I can see that when CLONE_INTO_CGROUP | CLONE_NEWCGROUP is passed, then the child's cgroup NS will be rooted at parent's css set (copy_namespaces precedes cgroup_post_fork). Wouldn't it make better sense if this flags combination resulted in child's NS rooted in its css set? Michal --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAl4V/LkACgkQia1+riC5 qSh7ww/+JtgrB5RnfOwdlpOAFEIzNIFUXCtwsKQCZ+yWH6llH6b4JzLIIjX3S5Eq /99Cm3s9+6TG6Wr534KUcCfml7nToo/efiRjjuf0j0ZAPPR5y9s58s/qqH4oakiD 2j4/FI86+StapFYGv8yJlQ59DZkFoDIYrPu1cYGYVzqcCo0TBSfmIK3kcO6OBA0O Z1aDXQGz0svw5ssVNMpOp/3P74ctvohlNAgYLNELbeMOoR6JFEiVug0kfQh1E8mo pPQUt1wsDNAB81h1i/5JKlkS7uYbIeDsV0i/aRM+2NGs323mDKK9iSm8EBXRhCWX 1Y6+PuBLp7ZRPISsBZT+8jCsAwuBo2y48dw/KORd2BdBpZrxF2yLwRZNC2oRPuWX suMafu+vnI9ompGkrlgs0sFGiYMQiBmM0MtBCYD8MfEiJjPxGn6b17bSBNRxyzOa Jq1SjbPrWGWy/Pz+2CGFJstRJVsISBJbEejmBhDCo9MviK3V+2LDu0mYPvGXzJ/d 2Kgslb9sdTQbSgeIQy+qcn9mWHZAfuyxC5i+7DJ/bE7l4bofN3TmkeFBriq9D4vU NELLJCnhQ7kDFhaTkFzMRrBMbkpG5Och8XfWFQDw4uskjTe8w9nORAsq/HtA/Ldv EHVorBc5qw9PReix/NFxNKD7vQHD0qwqHkG4h9QQbmsrtKB1/lQ= =atMP -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--