Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp445820pxf; Thu, 8 Apr 2021 06:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwggzhd/9GHWd0W+OzynWagqOK9pOhwDCfLdmWbvxwWBViqjrjMQctAiXJsVkpi7Y6Lajzh X-Received: by 2002:a50:fc94:: with SMTP id f20mr11416069edq.77.1617888453826; Thu, 08 Apr 2021 06:27:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617888453; cv=none; d=google.com; s=arc-20160816; b=nJIPrkNsQUazytaFnroJMW9xIqDzXDrSY5ClRM0pG7esm/cDFbZDBm+xVa9J/Oep7w qtuBL/u+GOeUZy0EDoEXjKrBfGJFPL37J/2zfeqQMYVsao5kb2Mb5ND9s0Ods+wrZTrQ eq4HdqxICUSxuI8ekDOz9Il419Ujjlm8csFTXz65VjhzkjHgOAHN5Pvwz7rvSrKGSAnU cod8OKX3HLg2YKXzkD2X+MadEAAS5h919MFDU+ZliwTpY1SUyp+uUgQ7hAmrF7fpPI7O ATd8CuufTiDLqDrWktIFay/NBn/EWPXRpe3yXHJE0FT3m/W1MrILyrGr32wak6ZAFk9H knug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oIIF8FD1kZZIB8sp9PsI8R0MlTFlHz4DJ70lsk8+TS4=; b=QQ8GhsqQ7H85t4ZZ+Amc5vKLJtpgd4ha66TuNOm5lUPveJWYpOKZcTOMt6a1ApljjR LprwhKNkgvIJGk9tWrnJzws5JY1e5UVRJGkzTNYTq329C0IMNGPGSXp3GcezPl17c3/x LagGZXEvTv2u438Uilv0jVQShnVA8g4foQqEPFe7sbf9ua805Hkt4C2JyzqOBg9jnH16 sej14zprfm/58e/N4NbyeQUCl6sXaG+nqStBokDJYigKP6Gv+PNFnvYhp5xLd1u3y3X8 i40PVZ70cXwr/iy0PoF9dnet9a73j3IIz6FVrxAkgQS9fS2aoEkOA2+OilZNxC0O9l4V BuHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mmBcZDeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si1364171edc.122.2021.04.08.06.27.10; Thu, 08 Apr 2021 06:27:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=mmBcZDeb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbhDHN0J (ORCPT + 99 others); Thu, 8 Apr 2021 09:26:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:39930 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231534AbhDHN0H (ORCPT ); Thu, 8 Apr 2021 09:26:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1617888355; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oIIF8FD1kZZIB8sp9PsI8R0MlTFlHz4DJ70lsk8+TS4=; b=mmBcZDebG+g16icAUL4Df7wTFv9K20Pp6OM2SN4YD5Uf+Ii4lwcQGF8u0k0wXWd3lKWlIh ct4anMYn+wfvrdF68BEkJeARpH5T3e+RuIaYDoMYlFAV/yzdPe09ugfMLE+Xksk0IWZAm4 9429MawBPqpA8D3EzgaJXaSTgKg5uxY= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EDCBDB032; Thu, 8 Apr 2021 13:25:54 +0000 (UTC) Date: Thu, 8 Apr 2021 15:25:52 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Peter Zijlstra Cc: Tejun Heo , joel@joelfernandes.org, chris.hyser@oracle.com, joshdon@google.com, mingo@kernel.org, vincent.guittot@linaro.org, valentin.schneider@arm.com, mgorman@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, Christian Brauner , Zefan Li Subject: Re: [PATCH 0/9] sched: Core scheduling interfaces Message-ID: References: <20210401131012.395311786@infradead.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0QoOOnHI+Sdl8AiX" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0QoOOnHI+Sdl8AiX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 07, 2021 at 08:34:24PM +0200, Peter Zijlstra wrote: > IMO as long as cgroups have that tasks file, you get to support people > using it. That means that tasks joining your cgroup need to 'inherit' > cgroup properties. The tasks file is consequence of binding this to cgroups, I'm one step back. Why to make "core isolation" a cgroup property? (I understand this could help "visualize" what the common domains are if cgroups were the only API but with prctl the structure can be arbitrarily modified anyway.) > Given something like: >=20 > R > / \ > A B > / \ > C D Thanks for the example.=20 > B group can set core_sched=3D1 and then all its (and its decendants) tasks > get to have the same (group) cookie and cannot share with others. The same could be achieved with the first task of group B allocating its new cookie which would be inherited in its descednants. > If however B is a delegate and has a subgroup D that is security > sensitive and must not share core resources with the rest of B, then it > can also set D.core_sched=3D1, such that D (and its decendants) will have > another (group) cookie. If there is such a sensitive descendant task, it could allocate a new cookie (same way as the first one in B did). > On top of this, say C has a Real-Time tasks, that wants to limit SMT > interference, then it can set a (task/prctl) cookie on itself, such that > it will not share the core with the rest of the tasks of B. (IIUC, in this particular example it'd be redundant if B had no inner tasks since D isolated itself already.) Yes, so this is again the same pattern as the tasks above have done. > In that scenario the D subtree is a restriction (doesn't share) with the > B subtree. This implies D's isolation from everything else too, not just B's members, no? > And all of B is a restriction on all its tasks, including the Real-Time > task that set a task cookie, in that none of them can share with tasks > outside of B (including system tasks which are in R), irrespective of > what they do with their task cookie. IIUC, the equivalent restriction could be achieved with the PTRACE-like check in the prctl API too (with respectively divided uids). I'm curious whether the cgroup API actually simplifies things that are possible with the clone/prctl API or allows anything that wouldn't be otherwise possible. Regards, Michal --0QoOOnHI+Sdl8AiX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEEoQaUCWq8F2Id1tNia1+riC5qSgFAmBvBFwACgkQia1+riC5 qShwjw/+Nz+8PN51hIJ3F6xocWess7ngZINL0fPJ3n716L0sXdbZJGOeHHMpI+GK uPGNTznUkdPAQ0jXX6XyuUpmG4Mk92KnXFtL9DCbjPEHeOBluoSPLw8piKW+gElO ATASP84QOw9EUpJ/7FjUrYEk75ucMjsmV1yD/9NEeW6k9rnovPdUh+7UoqfYepd4 GQxudcGYmobBoNF4/iIHr3BDxLzrr0+w7CBVAvEBGsF38JgaSNUGm+p74CIkYV1U cUlF8FhfHdqufsDAq9+cyQMvAB1CJt7efSoLwpjiXheFODcyylMLc/0qiR0QYxOL ZviKP1CoSoVj9RtsJYRVubJFqHIwI9i6iehZU2bhyAN+S7eCHe01KXS+XfpF33Mc G5ZWU8MLU4E902V0EKOwHecRPIitKX9+xwyQ+26Pz5FrmAxhF7iP8//5BYrNP6Mx D7gWLX6Cj692i2mSHsxqaVQil6IpcwgKaLQK3u2cwyHl3GRmSBy6yLRK8G2Y1hCo fD/YD5S8/6jfsNBWrojwlsJdKx9YMMnLipiYGw+qLmqStPwCuGpd9PQkwCliO0OQ 6yYuRTHY3X2IqVh9wGdpG08Ae54LekJEunKoBW137Q9rtp1q7U//j4qtXcKHPIl0 Y/Og5zdCtdVS5PzeQTzlzyKUgLKDjXRoI8LaFpwJM/7/eR9L/iU= =oV8A -----END PGP SIGNATURE----- --0QoOOnHI+Sdl8AiX--