Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp715029ybt; Fri, 26 Jun 2020 09:47:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUTVe2eycT5v0Jj9MZ2CikowpCPIwCtgHmV/1CoDp6PmpMkT5va2vNY3MjUefOGxbSeDvu X-Received: by 2002:a17:906:7751:: with SMTP id o17mr3535753ejn.111.1593190039029; Fri, 26 Jun 2020 09:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593190039; cv=none; d=google.com; s=arc-20160816; b=vUDQBZfO3uGaSOPADZOqMj9S0B0Df8H+C0BVatoi4XdHlo9F1xaro0FEsTy89jmc7V 4K9yYNuaqvNgmUYd6j0XiXMjR1UCUdRUCoR0KgyedEnXZjRh0ktCDggwHCUe7WifCxK3 JnRtiwFPQQK2fO8N+0P7j1CQlRhRcS1kLd0va68B01mJYJx+WMF3lhEmtPF1dklYlUME KWVZIaE5kO48QYOdmtBPDZv4u1IXquI4kKzwuyehGOt7uw/38bjfUHG7HnpY1xMa5D+v fhKj8D0wltC6F9nkonzW/qyrLhKWNYtdKiCktWDVBZ2evHcsqFtWu5fqge7KR8oS+kca Cz3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=w0d0ra3sJ96rLFrLdCwHW0H4TXaneWfgpYrRd+GYtQ0=; b=A2xaFbgnQS4k0ZtnQ8EsYvNCoREk00lEqh6MpFy1QCUkmfIXzrzT47O90zmfSmndrY 3miK6qJA7Ok9Nz9C9u0RnjNCdQghvpFZUycvCUKZXAvIWuR2kmO79cEyfgb7hQf2bBKE G5bxY+vTM8ME4BHApCzbxNB2ZsbCU3LK2UFK92i6XzL8OfL2DT4XVyj4c44h8I2X4RVN BeBEUuIYULFFVhazRvoRdNb/oYpKXwUk81oY6RI6PLEff57AcZOueu63sgfN9I+OQtvR OOSkN8F5lh5GtbKLPn2fxIA9qjbh5xjVit02NgIkp+9CqBU/jwwH2ymI284L3go5MF2O oe5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=bYgkeN4b; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si16589628ejf.178.2020.06.26.09.46.56; Fri, 26 Jun 2020 09:47:19 -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=@joelfernandes.org header.s=google header.b=bYgkeN4b; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbgFZPMO (ORCPT + 99 others); Fri, 26 Jun 2020 11:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbgFZPMO (ORCPT ); Fri, 26 Jun 2020 11:12:14 -0400 Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC518C03E979 for ; Fri, 26 Jun 2020 08:12:13 -0700 (PDT) Received: by mail-qv1-xf41.google.com with SMTP id dm12so4622580qvb.9 for ; Fri, 26 Jun 2020 08:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=w0d0ra3sJ96rLFrLdCwHW0H4TXaneWfgpYrRd+GYtQ0=; b=bYgkeN4bgJMhPi+9XbTnHztKox2tVeRhmvw+sdW17XFhS0YCSx/FiIbmvZuPcPlCbD HuDgZphCj48dHe50SZ5Oj0EFyj2rAMMBe1XKoowHQ4aNHbYfgC/TkeNO/eRhf2HiyZuo Oo8tp7FL06tBDj9dartS4NUqaszksIAK9Z228= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w0d0ra3sJ96rLFrLdCwHW0H4TXaneWfgpYrRd+GYtQ0=; b=RGDOCRtlumQ4KILYCaHCi3S9MmrOLMiUDNN8ns5r0cNwj/40/6Tl0aMdFn/i/goO9+ 23azoOMf0R4FrG8+sBnlyE21N+i1CZp6A2MzpLl6FiTa/+5O34XZaGGANy5Sp7FMBe1n IJFJi6uLw63kZ/QZUhTACEhiZyEMEWhGbAYECqnUOobfWNNZ/kiN2XU5g9hT5UD8ZUEc 8vPYXec5d5XJO6BGzleoFe25/jDlIsWATZ2jhgXTEzMChQhX9kp225NrgdWzddJt35SG f2n1V5AafFOgwsRXsBp0g5c7iifBT52Itu3Oyf8ppzVMeD9/e0bLvybYILSjCqOWe7sM KxKA== X-Gm-Message-State: AOAM530udfXvq9tlqlgoUj43y3JjhjOGFmVRmDxKAflzcfjfQiDqBBYb TZ9bF0bGDwBzNvwSSBmqdTElvg== X-Received: by 2002:a05:6214:8f4:: with SMTP id dr20mr3408915qvb.228.1593184332717; Fri, 26 Jun 2020 08:12:12 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id 130sm6513329qkn.82.2020.06.26.08.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 08:12:12 -0700 (PDT) Date: Fri, 26 Jun 2020 11:12:11 -0400 From: Joel Fernandes To: Vineeth Remanan Pillai , tj@kernel.org Cc: Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , Tim Chen , Linus Torvalds , Linux List Kernel Mailing , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Ingo Molnar , Kees Cook , Thomas Gleixner , Greg Kerr , Phil Auld , Aaron Lu , Aubrey Li , "Li, Aubrey" , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , Paul Turner Subject: Re: [RFC PATCH 00/13] Core scheduling v5 Message-ID: <20200626151211.GB538235@google.com> References: <20200626151028.GA538235@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200626151028.GA538235@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 11:10:28AM -0400, Joel Fernandes wrote: > On Fri, Jun 26, 2020 at 10:36:01AM -0400, Vineeth Remanan Pillai wrote: > > On Thu, Jun 25, 2020 at 9:47 PM Joel Fernandes wrote: > > > > > > On Thu, Jun 25, 2020 at 4:12 PM Vineeth Remanan Pillai > > > wrote: > > > [...] > > > > TODO lists: > > > > > > > > - Interface discussions could not come to a conclusion in v5 and hence would > > > > like to restart the discussion and reach a consensus on it. > > > > - https://lwn.net/ml/linux-kernel/20200520222642.70679-1-joel@joelfernandes.org > > > > > > Thanks Vineeth, just want to add: I have a revised implementation of > > > prctl(2) where you only pass a TID of a task you'd like to share a > > > core with (credit to Peter for the idea [1]) so we can make use of > > > ptrace_may_access() checks. I am currently finishing writing of > > > kselftests for this and post it all once it is ready. > > > > > Thinking more about it, using TID/PID for prctl(2) and internally > > using a task identifier to identify coresched group may have > > limitations. A coresched group can exist longer than the lifetime > > of a task and then there is a chance for that identifier to be > > reused by a newer task which may or maynot be a part of the same > > coresched group. > > True, for the prctl(2) tagging (a task wanting to share core with > another) we will need some way of internally identifying groups which does > not depend on any value that can be reused for another purpose. > > [..] > > What do you think about having a separate cgroup for coresched? > > Both coresched cgroup and prctl() could co-exist where prctl could > > be used to isolate individual process or task and coresched cgroup > > to group trusted processes. > > This sounds like a fine idea to me. I wonder how Tejun and Peter feel about > having a new attribute-less CGroup controller for core-scheduling and just > use that for tagging. (No need to even have a tag file, just adding/removing > to/from CGroup will tag). +Tejun thanks, - Joel > > > However a question: If using the prctl(2) on a CGroup tagged task, we > > > discussed in previous threads [2] to override the CGroup cookie such > > > that the task may not share a core with any of the tasks in its CGroup > > > anymore and I think Peter and Phil are Ok with. My question though is > > > - would that not be confusing for anyone looking at the CGroup > > > filesystem's "tag" and "tasks" files? > > > > > Having a dedicated cgroup for coresched could solve this problem > > as well. "coresched.tasks" inside the cgroup hierarchy would list all > > the taskx in the group and prctl can override this and take it out > > of the group. > > We don't even need coresched.tasks, just the existing 'tasks' of CGroups can > be used. > > > > To resolve this, I am proposing to add a new CGroup file > > > 'tasks.coresched' to the CGroup, and this will only contain tasks that > > > were assigned cookies due to their CGroup residency. As soon as one > > > prctl(2)'s the task, it will stop showing up in the CGroup's > > > "tasks.coresched" file (unless of course it was requesting to > > > prctl-share a core with someone in its CGroup itself). Are folks Ok > > > with this solution? > > > > > As I mentioned above, IMHO cpu cgroups should not be used to account > > for core scheduling as well. Cpu cgroups serve a different purpose > > and overloading it with core scheduling would not be flexible and > > scalable. But if there is a consensus to move forward with cpu cgroups, > > adding this new file seems to be okay with me. > > Yes, this is the problem. Many people use CPU controller CGroups already for > other purposes. In that case, tagging a CGroup would make all the entities in > the group be able to share a core, which may not always make sense. May be a > new CGroup controller is the answer (?). > > thanks, > > - Joel >