Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2832044pxf; Sun, 4 Apr 2021 16:48:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHybsd0Iu1Lj5ScdvNKTAJFc80Gp1FrKtIpJ1UydAKJbUNq9t04J6MmTRSeBq8S6IYgDMn X-Received: by 2002:a17:907:7355:: with SMTP id dq21mr24975045ejc.159.1617580105208; Sun, 04 Apr 2021 16:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617580105; cv=none; d=google.com; s=arc-20160816; b=nZvzYR801XhRwIso06vf6+og2DXKEjKedSRILrMqH1QV4YE19Iq3k+ZezErTEVIK5C m9TDzF3FlWxlZf62zqJpzBxuR0R6GS1RDKbojM+oXdLak6CqGvwJ9FZlnvUh1o6DOVGY CaH62YgwGsFbgC6t3P47fxOQkMWqFxXCjiL92SYCQA6glA0qL4rUfu13oxMUdcTPL9sy TfbiqLbCk5G3Y/XKTXNjg4uMD++62QKYqUhb7eNA5CJOgpg/eGt8VCKKELjlhyGFNleo eLQuN7S95J/X15dKOzGzgDvhqKvhrkXtMcu/U8UXKOdZTePJIDuDj8ksVXnjP4kFNj0y OvMQ== 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:sender:dkim-signature; bh=ZmQ6lUbCDIme35q2pCJjSmVR9obrBu1GS0FA+sZ71gE=; b=K0jisWeNwwru0OMUF2dvl8fO8lJg37V5SIo/hBZ6jpL5H4i43/H/bO5CtQGi7c/cqH /krbhiN8Ba1jOvWuUztwhOebYP/B11BEguaGF+abWxWskhtjrWfTkH2j2InDNKGinET/ r6wwx6oSNzEzrCJnrKDkiBEgIV6t5EHoV3jCkuTW9qVEjp1w8lgqONZM9iDObTnIZ5bG F8Q2srsYzIkqFicCT+YwLngjTMEv0VHlE9P/wW+bbIQJCbiwdjsuNOxOF3nVH7QNBkCl W97A02BowMV6PxEMwIyCHLQKZ9uKuQ42Y0+rF4Cm8dyFU70YvIY44a6N+h+Opn03eMCB GtSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Mxc5uUEE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si13750848edd.479.2021.04.04.16.47.41; Sun, 04 Apr 2021 16:48:25 -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=@gmail.com header.s=20161025 header.b=Mxc5uUEE; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231657AbhDDXjN (ORCPT + 99 others); Sun, 4 Apr 2021 19:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbhDDXjK (ORCPT ); Sun, 4 Apr 2021 19:39:10 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85DF3C061756 for ; Sun, 4 Apr 2021 16:39:05 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id j7so7413213qtx.5 for ; Sun, 04 Apr 2021 16:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZmQ6lUbCDIme35q2pCJjSmVR9obrBu1GS0FA+sZ71gE=; b=Mxc5uUEEcQ3Hk+J/GXgw807i2HkPNGdxyWW0jxo9ecUKUwPdyofzTUQSr2nmXC+GTD fTxqc1qs0WecZCjOTs2BazBifn9FvqjgmKSQrTZKo/BmJxQIp7dgV4ZWfBmiq5Gp/m1E b86UZ2fccWmDpoQwfg3cBTEAUTsYP6fhqPGEWKBoM+q+J7yNEkAxDQApclcZ2RU/CCOs 5/YMS3VV8/KjEyH4jDl42pW2iH9sOQz5lAaQUhx+h/IjlkvTLat24HdIBbj7q8oJiEnR irazsDt8Slb0qassMoRGvCWenJY2ux912bOZlPT90EztD6Qji6rTWn48Dj0Dm578mAiX BhMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=ZmQ6lUbCDIme35q2pCJjSmVR9obrBu1GS0FA+sZ71gE=; b=OYZkRE0JPx6zvbEUi5ugHW5Uy35yxETJMWXstEbM/4qTZZV+iPvHNxINYJoS8r2MLR fxoyWhDgkJJbgsDLvtOQyY7liGUt36F2AZ/VQt4/UuIHBS1Abo9klXS1LjnhQi7OaKk7 us/8R+ruO39RPuUlS43qwojobS8hj670ZIhczp218ZSAcyidLoIuRPQMAUKX3S4ZrO+u u6vdz9DeMriTlXIJviayQ/4pCIc6SiIee3B3PN3sPtjvxZN4kvT4+ZR7/0w0z0rGtbHC HWFHnahw8bbK7OkA8ovDu8DWaCkolFCp6kSsGGmQEDd3eeA5+JgZIRoaAP+qggbKwbxe zUCw== X-Gm-Message-State: AOAM530xvQFMoe0zdfY9OERZdCMLSRf4kKjyzND+qxeQowCZ1K3w6KVP Z2srwlNnQVJnd84i3GzvfnM= X-Received: by 2002:ac8:4415:: with SMTP id j21mr20195004qtn.87.1617579544571; Sun, 04 Apr 2021 16:39:04 -0700 (PDT) Received: from localhost (dhcp-6c-ae-f6-dc-d8-61.cpe.echoes.net. [199.96.183.179]) by smtp.gmail.com with ESMTPSA id y14sm10908059qtw.70.2021.04.04.16.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Apr 2021 16:39:04 -0700 (PDT) Sender: Tejun Heo Date: Sun, 4 Apr 2021 19:39:03 -0400 From: Tejun Heo To: Peter Zijlstra 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: <20210401131012.395311786@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cc'ing Michal and Christian who've been spending some time on cgroup interface issues recently and Li Zefan for cpuset. On Thu, Apr 01, 2021 at 03:10:12PM +0200, Peter Zijlstra wrote: > The cgroup interface now uses a 'core_sched' file, which still takes 0,1. It is > however changed such that you can have nested tags. The for any given task, the > first parent with a cookie is the effective one. The rationale is that this way > you can delegate subtrees and still allow them some control over grouping. I find it difficult to like the proposed interface from the name (the term "core" is really confusing given how the word tends to be used internally) to the semantics (it isn't like anything else) and even the functionality (we're gonna have fixed processors at some point, right?). Here are some preliminary thoughts: * Are both prctl and cgroup based interfaces really necessary? I could be being naive but given that we're (hopefully) working around hardware deficiencies which will go away in time, I think there's a strong case for minimizing at least the interface to the bare minimum. Given how cgroups are set up (membership operations happening only for seeding, especially with the new clone interface), it isn't too difficult to synchronize process tree and cgroup hierarchy where it matters - ie. given the right per-process level interface, restricting configuration for a cgroup sub-hierarchy may not need any cgroup involvement at all. This also nicely gets rid of the interaction between prctl and cgroup bits. * If we *have* to have cgroup interface, I wonder whether this would fit a lot better as a part of cpuset. If you squint just right, this can be viewed as some dynamic form of cpuset. Implementation-wise, it probably won't integrate with the rest but I think the feature will be less jarring as a part of cpuset, which already is a bit of kitchensink anyway. > The cgroup thing also '(ab)uses' cgroup_mutex for serialization because it > needs to ensure continuity between ss->can_attach() and ss->attach() for the > memory allocation. If the prctl() were allowed to interleave it might steal the > memory. > > Using cgroup_mutex feels icky, but is not without precedent, > kernel/bpf/cgroup.c does the same thing afaict. > > TJ, can you please have a look at this? Yeah, using cgroup_mutex for stabilizing cgroup hierarchy for consecutive operations is fine. It might be worthwhile to break that out into a proper interface but that's the least of concerns here. Can someone point me to a realistic and concrete usage scenario for this feature? Thanks. -- tejun