From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A4F9C433ED for ; Wed, 7 Apr 2021 18:41:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3021661245 for ; Wed, 7 Apr 2021 18:41:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236443AbhDGSlU (ORCPT ); Wed, 7 Apr 2021 14:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbhDGSlM (ORCPT ); Wed, 7 Apr 2021 14:41:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16A5AC061760 for ; Wed, 7 Apr 2021 11:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TevWoQq5Glq6ytD9AXpDyqi4WvX3U1InyNLnaDshZWg=; b=AHWVjJW9sXMfdWd06nX21+YP7H 7IdMnbmvoOgZ+ECTL1Grbnkrp4mqzmanNEMnx5cxhvnMz+RlgMAGM9aejmpl3NywWL7IT4iRko3ZS oQEJI0JtN1XUy37VT0sIISDanaPeYhtMwLPB2zIKtHrLrU53dMzuqANprqPrhJG4UW3Xir88vW37P j1Vg4X/pZ7u7RQ9uXk5RXYclwsNTxKj/GI9qZuAUbsHgtQNVtw6UK3xVkEaNpleBW+orp+U1K5X24 I5FtXYE5UT4Qx12rygEncgNdNGJaT1AMpQ1aoRPcdidsOS3SAvCwYTys8umi7yaoQ6i0WPJ33Gd7W hxA0vuOA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lUD5Z-00EvH0-Op; Wed, 07 Apr 2021 18:39:49 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1ED3D3001FB; Wed, 7 Apr 2021 20:39:40 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DA4B62BC07BB4; Wed, 7 Apr 2021 20:39:40 +0200 (CEST) Date: Wed, 7 Apr 2021 20:39:40 +0200 From: Peter Zijlstra To: Tejun Heo Cc: 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, Michal =?iso-8859-1?Q?Koutn=FD?= , 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 12:08:50PM -0400, Tejun Heo wrote: > I see. Yeah, if we really need it, I'm not sure it fits in cgroup interface > proper. As I wrote elsewhere, these things are usually implemented on the > originating subsystem interface with cgroup ID as a parameter. This would be something like: prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_FROM, cgroup-fd, PIDTYPE_CGROUP, NULL); right? Where we assign to self the cookie from the cgroup. The problem I see with this is that a task can trivially undo/circumvent this by calling PR_SCHED_CORE_CLEAR on itself, at which point it can share with system tasks again. Also, it doesn't really transfer well to the group/tasks thing. When a task joins a cgroup, it doesn't automagically gain the cgroup properties. Whoever does the transition will then also have to prctl() this, which nobody will do.