Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2934761imm; Thu, 24 May 2018 19:22:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrIi6xN1BVy8lK4/UV6lTShvSmB5UBqBAdLRHv4GojMXEcUiihoVxLgxBEkDqRntV0i3jb3 X-Received: by 2002:a62:9099:: with SMTP id q25-v6mr562818pfk.66.1527214972680; Thu, 24 May 2018 19:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214972; cv=none; d=google.com; s=arc-20160816; b=ZsSNpB8SwB7R/rDLrhD7dNgoagwaBiFfW7h4wNg2gqcjhDIfmozlWwJKF8fVHUgNnc YtRGXnZEpYB2hrC9uNURranPdxkVZiTptMxfHbgkTQshfSCJ1MypF4A4WtCbzt6daO8g Lqiwxu3rTYSSbkePsPVxBIL/iX7bKBIVsL4gnkLStKl0+FksgT7c+S2i29teAoclonS7 CQOG7Y7fp4d2SeYSvYkjYUpB355OnJ+NpZWmbjU8UGh8aVyizV7oBwEegY6nM+QBxHd+ N6h5SKOJRZJJqKx+tC2KdgBZW1Lmc+G/qpx+OP38yDNlkGhZTsfrZFMHbO5cCNgdvh4v LcsA== 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:dkim-signature:arc-authentication-results; bh=y/8P9Qhg/+MQWekfFBN/IJQwlqOULEmCausPJgGbFKk=; b=bNf8nLIPwwDpv9pHxI/xO2h/X0y+EDotGH/ofUlbPAG/BQOk6JEv+sb5gCjg088xZr hSOJQFMRENPrm41Grpmk/a1To59EZ9QUu2ad9iF6HMnpDJs9nKvW26z8Fpg5ene9J8Hq h6TcOmgA3bT0LJw5k7tAoU23COVzjTuUTtA8kaJjB6alf+D+QB8topsY/ORc838ZEZF1 62bEOPt6r64B1IOOxwX9AgM3GhpulR628ofMa0Lp78d2n4VI2qfiJnBTdmU5CLpZRRt+ hlbfa+Qwb6XFvNMLqZiSDxGKwtHD56S4CLeApBuWZCYP3NZ95hGHcnpBl0HHMB9T97Is JhBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oGDFl9Zv; 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 x11-v6si22457971pln.163.2018.05.24.19.22.38; Thu, 24 May 2018 19:22:52 -0700 (PDT) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oGDFl9Zv; 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 S967941AbeEXPma (ORCPT + 99 others); Thu, 24 May 2018 11:42:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48984 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967710AbeEXPmV (ORCPT ); Thu, 24 May 2018 11:42:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y/8P9Qhg/+MQWekfFBN/IJQwlqOULEmCausPJgGbFKk=; b=oGDFl9Zv9NNT6hOm4/P8l9IP8 vw0JuYSEqklJvNYQR+4bihtJBurwKuWKg07PNH7/auhtl/Tk2RTzKLYjHxPzvF9u+E0cUL8HBae96 7E+pZu5N80Spu/Zxk1zrpXveikU1WKbLimtAeLoFPDtKAYcfgzp5hq/8KlIUBdrj4ARaIXk3J4Rbh EIU5RBVm3EAq8pbA27GYx+01lNCkd7Vl65GkT+6nKgQT1CjYhJKx0tTHrk3GNzyVrMmF15m/87PDy uaosJOUuXUFqhS4s1dWO3gFx7JKCmG3IU2UrKykDfk2RzLMar3UIu1CgSBe/lUqjho5rdfN59Tr6B 9LXmGVPHQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLsNM-0001Wy-J1; Thu, 24 May 2018 15:42:00 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E08B32029F1C3; Thu, 24 May 2018 17:41:56 +0200 (CEST) Date: Thu, 24 May 2018 17:41:56 +0200 From: Peter Zijlstra To: Waiman Long Cc: Tejun Heo , Li Zefan , Johannes Weiner , Ingo Molnar , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, Mike Galbraith , torvalds@linux-foundation.org, Roman Gushchin , Juri Lelli Subject: Re: [PATCH v8 2/6] cpuset: Add new v2 cpuset.sched.domain flag Message-ID: <20180524154156.GI12198@hirez.programming.kicks-ass.net> References: <1526590545-3350-1-git-send-email-longman@redhat.com> <1526590545-3350-3-git-send-email-longman@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526590545-3350-3-git-send-email-longman@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 17, 2018 at 04:55:41PM -0400, Waiman Long wrote: > A new cpuset.sched.domain boolean flag is added to cpuset v2. This new > flag indicates that the CPUs in the current cpuset should be treated > as a separate scheduling domain. The traditional name for this is a partition. > This new flag is owned by the parent > and will cause the CPUs in the cpuset to be removed from the effective > CPUs of its parent. This is a significant departure from existing behaviour, but one I can appreciate. I don't immediately see something terribly wrong with it. > This is implemented internally by adding a new isolated_cpus mask that > holds the CPUs belonging to child scheduling domain cpusets so that: > > isolated_cpus | effective_cpus = cpus_allowed > isolated_cpus & effective_cpus = 0 > > This new flag can only be turned on in a cpuset if its parent is either > root or a scheduling domain itself with non-empty cpu list. The state > of this flag cannot be changed if the cpuset has children. > > Signed-off-by: Waiman Long > --- > Documentation/cgroup-v2.txt | 22 ++++ > kernel/cgroup/cpuset.c | 237 +++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 256 insertions(+), 3 deletions(-) > > diff --git a/Documentation/cgroup-v2.txt b/Documentation/cgroup-v2.txt > index cf7bac6..54d9e22 100644 > --- a/Documentation/cgroup-v2.txt > +++ b/Documentation/cgroup-v2.txt > @@ -1514,6 +1514,28 @@ Cpuset Interface Files > it is a subset of "cpuset.mems". Its value will be affected > by memory nodes hotplug events. > > + cpuset.sched.domain > + A read-write single value file which exists on non-root > + cpuset-enabled cgroups. It is a binary value flag that accepts > + either "0" (off) or a non-zero value (on). I would be conservative and only allow 0/1. > This flag is set > + by the parent and is not delegatable. > + > + If set, it indicates that the CPUs in the current cgroup will > + be the root of a scheduling domain. The root cgroup is always > + a scheduling domain. There are constraints on where this flag > + can be set. It can only be set in a cgroup if all the following > + conditions are true. > + > + 1) The parent cgroup is also a scheduling domain with a non-empty > + cpu list. Ah, so initially I was confused by the requirement for root to have it always set, but you'll allow child domains to steal _all_ CPUs, such that root ends up with an empty effective set? What about the (kernel) threads that cannot be moved out of the root group? > + 2) The list of CPUs are exclusive, i.e. they are not shared by > + any of its siblings. Right. > + 3) There is no child cgroups with cpuset enabled. > + > + Setting this flag will take the CPUs away from the effective > + CPUs of the parent cgroup. Once it is set, this flag cannot be > + cleared if there are any child cgroups with cpuset enabled. This I'm not clear on. Why?