Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp168147imu; Wed, 7 Nov 2018 14:59:46 -0800 (PST) X-Google-Smtp-Source: AJdET5dZV9+iYH1dqxamj/afZgYvg2pVK4YxOn4T2bX7gwvvb5knIJXYiKe5IGFh+NhvOir450nZ X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr2215613plb.294.1541631586242; Wed, 07 Nov 2018 14:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541631586; cv=none; d=google.com; s=arc-20160816; b=mIqE1AejErD+ayc/vgo7dc3CayCJdAwOZ2fhQgFDtm+zkIzqvCIu8LiivyR5tnJV7K BXyqCStLxAidnkp4Rf75cfQ/h4nwPVgsLX6vSJSDdKwZcyQ0mh4oUAfyKgBWfLFX1LWM JBTkxa0QpcRUXED0OHjineSsZwVree7m1im33iuqIuLHqbbOk4IKZRnGVRn96o1lxbRE vAYDB47JlHgNtX01jrXZCLJFSh9T9Bfyox40EQ/V5vPsUDAU4kNP9Hx6xcYIqkvIxxBq /mgwP3BbNiw/nO6vtmfivsykrQ6F4eoDhS1PR7CqpHhahbZ4GsYQXX/iW/J5pEzKKtoI H/nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=Aiwguuk6z3WuTxAmCpUzmPVhfuHFfWB0zfyw1VGJPlY=; b=WnHggowhSodR//0hmnisZBTtvN3xAz2LzyDG0YElGvcXi03DfANJ1Xg9qwg+XvTQMl GrbuCuGqIrgP6PeoTfFsH7ghtnsn+7CnwCbMhdmdvqIFYPbCdPC5wpSNXdOZe0a0Tylq K/ofI4ul1je6mZ2TDq9nL+Ktym1Zn4q0Vkzpj2JuTVKpL7Yz9wnombtMmwi7+9ppYL9r otYbOW22LKJcaJVXScClMwvGRk8amIRzKgYoBJATQqr11QxZqlt6xL/oL37m/rd8GOfe 5elZOFw144jCCnusNx9FpCsRVhBe5+Sy7I2Zs3SewOa8ku22ctRlyu8Jshr4ByUT1HEE l5fw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34si1610423pgb.458.2018.11.07.14.59.29; Wed, 07 Nov 2018 14:59:46 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbeKHIbk (ORCPT + 99 others); Thu, 8 Nov 2018 03:31:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27663 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbeKHIbk (ORCPT ); Thu, 8 Nov 2018 03:31:40 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D060804E0; Wed, 7 Nov 2018 22:59:06 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-55.bos.redhat.com [10.18.17.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F91219481; Wed, 7 Nov 2018 22:58:59 +0000 (UTC) Subject: Re: [PATCH v14 10/12] cpuset: Add documentation about the new "cpuset.sched.partition" flag To: Peter Zijlstra 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 , Patrick Bellasi , Tom Hromatka References: <1539635377-22335-1-git-send-email-longman@redhat.com> <1539635377-22335-11-git-send-email-longman@redhat.com> <20181106115045.GO22431@hirez.programming.kicks-ass.net> From: Waiman Long Openpgp: preference=signencrypt Autocrypt: addr=longman@redhat.com; prefer-encrypt=mutual; keydata= xsFNBFgsZGsBEAC3l/RVYISY3M0SznCZOv8aWc/bsAgif1H8h0WPDrHnwt1jfFTB26EzhRea XQKAJiZbjnTotxXq1JVaWxJcNJL7crruYeFdv7WUJqJzFgHnNM/upZuGsDIJHyqBHWK5X9ZO jRyfqV/i3Ll7VIZobcRLbTfEJgyLTAHn2Ipcpt8mRg2cck2sC9+RMi45Epweu7pKjfrF8JUY r71uif2ThpN8vGpn+FKbERFt4hW2dV/3awVckxxHXNrQYIB3I/G6mUdEZ9yrVrAfLw5M3fVU CRnC6fbroC6/ztD40lyTQWbCqGERVEwHFYYoxrcGa8AzMXN9CN7bleHmKZrGxDFWbg4877zX 0YaLRypme4K0ULbnNVRQcSZ9UalTvAzjpyWnlnXCLnFjzhV7qsjozloLTkZjyHimSc3yllH7 VvP/lGHnqUk7xDymgRHNNn0wWPuOpR97J/r7V1mSMZlni/FVTQTRu87aQRYu3nKhcNJ47TGY evz/U0ltaZEU41t7WGBnC7RlxYtdXziEn5fC8b1JfqiP0OJVQfdIMVIbEw1turVouTovUA39 Qqa6Pd1oYTw+Bdm1tkx7di73qB3x4pJoC8ZRfEmPqSpmu42sijWSBUgYJwsziTW2SBi4hRjU h/Tm0NuU1/R1bgv/EzoXjgOM4ZlSu6Pv7ICpELdWSrvkXJIuIwARAQABzR9Mb25nbWFuIExv b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v7anSgIkL+doXDaG21DgCYTD wGA5uquIgb8p3/ENgYpDPrsZ72CxVC2NEJjJwwnRBStjJOGQX4lV1uhN1XsZjBbRHdKF2W9g weim8xU= Organization: Red Hat Message-ID: <7f71f746-582b-42d0-11f1-e690ab4d94b0@redhat.com> Date: Wed, 7 Nov 2018 17:58:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181106115045.GO22431@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 07 Nov 2018 22:59:06 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/06/2018 06:50 AM, Peter Zijlstra wrote: > On Mon, Oct 15, 2018 at 04:29:35PM -0400, Waiman Long wrote: >> The cgroup-v2.rst file is updated to document the purpose of the new >> "cpuset.sched.partition" flag and how its usage. >> >> Signed-off-by: Waiman Long >> --- >> Documentation/admin-guide/cgroup-v2.rst | 66 +++++++++++++++++++++++++ >> 1 file changed, 66 insertions(+) >> >> diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst >> index 533e85cb851b..178cda473a26 100644 >> --- a/Documentation/admin-guide/cgroup-v2.rst >> +++ b/Documentation/admin-guide/cgroup-v2.rst >> @@ -1686,6 +1686,72 @@ Cpuset Interface Files >> >> Its value will be affected by memory nodes hotplug events. >> >> + cpuset.sched.partition >> + A read-write single value file which exists on non-root >> + cpuset-enabled cgroups. It accepts either "0" (off) or "1" >> + (on) when written to. >> + This flag is set and owned by the >> + parent cgroup. > What does that mean? The parent cgroup doesn't 'set' anything at all. > The user will. > >> + >> + If set, it indicates that the current cgroup is the root of a >> + new partition or scheduling domain that comprises itself and >> + all its descendants except those that are separate partition >> + roots themselves and their descendants. The root cgroup is >> + always a partition root. >> + >> + 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 "cpuset.cpus" is not empty and the list of CPUs are >> + exclusive, i.e. they are not shared by any of its siblings. >> + 2) The parent cgroup is a partition root. >> + 3) The "cpuset.cpus" is also a proper subset of the parent's >> + "cpuset.cpus.effective". >> + 4) There is no child cgroups with cpuset enabled. This is for >> + eliminating corner cases that have to be handled if such a >> + condition is allowed. >> + >> + 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. >> + >> + A parent partition cannot distribute all its CPUs to its >> + child partitions. There must be at least one cpu left in the >> + parent partition. >> + >> + Once becoming a partition root, changes to "cpuset.cpus" is >> + generally allowed as long as the first condition above is true, >> + the change will not take away all the CPUs from the parent >> + partition and the new "cpuset.cpus" value is a superset of its >> + children's "cpuset.cpus" values. >> + Sometimes, external factors like changes to ancestors' >> + "cpuset.cpus" or cpu hotplug can cause the state of the partition >> + root to change. On read, the "cpuset.sched.partition" file >> + can show the following values. > Are those the only conditions under which that -1 can happen? Parent > taking away CPUs it previously granted and hotplug? Yes, if none of the cpus are available. It will become invalid. It still remains a partition (a partial one) if at least one cpu is allocated to that partition. >> + >> + "0" Not a partition root >> + "1" Partition root >> + "-1" Erroneous partition root >> + >> + It is a partition root if the first 2 partition root conditions >> + above are true and at least one CPU from "cpuset.cpus" is >> + granted by the parent cgroup. >> + >> + A partition root can become an erroneous partition root if none >> + of CPUs requested in "cpuset.cpus" can be granted by the parent >> + cgroup or the parent cgroup is no longer a partition root. >> + In this case, it is not a real partition even though the >> + restriction of the first partition root condition above will >> + still apply. All the tasks in the cgroup will be migrated to >> + the nearest ancestor partition. > Effectively or actual? Actual migrating tasks out of the cgroup is > irreversible. I am not talking about actual migration to a different cgroup. I am talking moving to a different partition. When a partition become invalid, it will inherent the partition parent's effective cpumask. >> + An erroneous partition root can be transitioned back to a real >> + partition root if at least one of the requested CPUs can now be >> + granted by its parent. In this case, the tasks will be migrated >> + back to the newly created partition. Clearing the partition >> + flag of an erroneous partition root is always allowed even if >> + child cpusets are present. > So you need to clarify the above point (I think it is effectively), > because otherwise you don't know which tasks to put back. I will clarify that. Thanks, Longman