Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1643562rwo; Wed, 2 Aug 2023 18:45:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlH3qGeJPOUl/ftfu0ZoHXRminRHGENb+HE8I3MihFZPH9qEgW8pUC+jmcau0bQfrLGNq+RP X-Received: by 2002:a05:620a:2492:b0:767:dd2c:9a1 with SMTP id i18-20020a05620a249200b00767dd2c09a1mr25779774qkn.20.1691027150435; Wed, 02 Aug 2023 18:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691027150; cv=none; d=google.com; s=arc-20160816; b=e9vpqTn8tQO4ilunP/GOIR2n3OTFQjsSQ+CmtNNed/YtbhwUA0bwMCDclNJ8cb+Ve1 CM8mkDstQ8n63Bhv4xoSiClCIdIs/6aZju2sjmPPLlemRGFbWvVdLRoCEg58gXOxluaT BOa/Reb7n3bZSR1m1vacRowY7dgsbZjQrvsfIQmcPQqIYh82HmBIX+LS2tUGcfYfQYxb UOdMwGP24pJAw89nul+5nKA5W6tS/2qWFvIyR4kJdOamhkzNCYpro0RZsNEe9aSv9vnY 3KIltB53e2u8r1sjyJ6g+Iq4TB0/eA9Mo+/sYHK0rjuEVoj+dHgFC1mk+JKatYgEWC5U FWng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yNCl3TS6o3J06UrSCjbBrl21cvR06Nfa+qdUrrTWUOw=; fh=aZKrlMByNy+EyCEA9Kc93Vet7bj5FphUyprVRF1Nj7o=; b=Mb4XcBVRkceU3Fotp6Q5J62RP0sMBygdpedPiyqakbM+FUQ2F3Ht92jwviLXCLbvFr dNFbGBqQM7ytWPrfk0F0jojFeoSQg+CFr4+A/KDk2zIUYgkUfHLOEhfbwSMY99JnqGfP aL8usORrO6jOH0flKXsh63T5VPdN4aQidg56Rz0p4/xS+Ugmo4WPofg6np6hDK3hA56x IsLi/lwfcaDge7Ti8RQ57GNpvGeFb+wd1OmBiNKa+yGDt4Nvq0LTeIbAAr2Knk9GK3Fk 8571a+B0UBOZn1VEzcM6L0IMOFKYmCcmfSfmpauU29XpRoPns1Kma4vHUB9UrwZo++di /9SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPBygaoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6385c3000000b0056383a7ddbcsi1718570pgd.103.2023.08.02.18.45.37; Wed, 02 Aug 2023 18:45:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PPBygaoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbjHCBJA (ORCPT + 99 others); Wed, 2 Aug 2023 21:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbjHCBI7 (ORCPT ); Wed, 2 Aug 2023 21:08:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A86C1716 for ; Wed, 2 Aug 2023 18:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691024888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yNCl3TS6o3J06UrSCjbBrl21cvR06Nfa+qdUrrTWUOw=; b=PPBygaoBGIN+RllqEOPGnP5lT+raEyRWb//MAQuh8KsENi8lJkffn8L3VgzOr3Qww13nPg qvJqMaFFukEvPzugBDjhdA77VJ6hGnT5ok/ahgMJw56wolc19NtSzGjG/yxVKLW3mPzphg 6KKbw1tQj5HT8DYKGHsusJfptsqwtCI= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-kT90DbMtPA-AfZ-sdNrgZQ-1; Wed, 02 Aug 2023 21:08:04 -0400 X-MC-Unique: kT90DbMtPA-AfZ-sdNrgZQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A7DC228237CB; Thu, 3 Aug 2023 01:08:03 +0000 (UTC) Received: from [10.22.18.41] (unknown [10.22.18.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C0D7492CA6; Thu, 3 Aug 2023 01:08:01 +0000 (UTC) Message-ID: <0c019181-7e9b-0a19-c477-f8630ea98124@redhat.com> Date: Wed, 2 Aug 2023 21:08:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v5 4/5] cgroup/cpuset: Documentation update for partition Content-Language: en-US To: Tejun Heo Cc: Zefan Li , Johannes Weiner , Christian Brauner , Jonathan Corbet , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Juri Lelli , Dietmar Eggemann , =?UTF-8?Q?Michal_Koutn=c3=bd?= , Giuseppe Scrivano References: <20230713172601.3285847-1-longman@redhat.com> <20230713172601.3285847-5-longman@redhat.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/23 17:01, Tejun Heo wrote: > Hello, Waiman. > > On Thu, Jul 13, 2023 at 01:26:00PM -0400, Waiman Long wrote: > ... >> + When a valid partition is created, the value of this file will >> + be automatically set to the largest subset of "cpuset.cpus" >> + that can be granted for exclusive access from its parent if >> + its value isn't explicitly set before. >> + >> + Users can also manually set it to a value that is different from >> + "cpuset.cpus". In this case, its value becomes invariant and >> + may no longer reflect the effective value that is being used >> + to create a valid partition if some dependent cpuset control >> + files are modified. >> + >> + There are constraints on what values are acceptable to this >> + control file. If a null string is provided, it will invalidate a >> + valid partition root and reset its invariant state. Otherwise, >> + its value must be a subset of the cgroup's "cpuset.cpus" value >> + and the parent cgroup's "cpuset.cpus.exclusive" value. > As I wrote before, the hidden state really bothers me. This is fine when > there is one person configuring the system, but working with automated > management and monitoring tools can be really confusing at scale when there > are hidden states like this as there's no way to determine the current state > by looking at what's visible at the interface level. > > Can't we do something like the following? > > * cpuset.cpus.exclusive can be set to any possible cpus. While I'm not > completely against failing certain writes (e.g. siblings having > overlapping masks is never correct or useful), expanding that to > hierarchical checking quickly gets into trouble around what happens when > an ancestor retracts a CPU. > > I don't think it makes sense to reject writes if the applied rules can't > be invariants for the same reason given for avoiding hidden states - the > system can be managed by multiple agents at different delegation levels. > One layer changing resource configuration shouldn't affect the success or > failure of configuration operations in other layers. > > * cpuset.cpus.exclusive.effective shows what's currently available for > exclusive usage - ie. what'd be used for a partition if the cgroup is to > become a partition at that point. > > This, I think, gets rid of the need for the hidden states. If .exclusive > of a child of a partition is empty, its .exclusive.effective can show all > the CPUs allowed in it. If .exclusive is set then, .exclusive.effective > shows the available subset. > > What do you think? > Sure, I can add cpuset.cpus.exclusive.effective and allow users to set cpuset.cpus.exclusive to whatever they want, just like cpuset.cpus. I will rework the patch series and send out a new version sometimes next week. With the new cpuset.cpus.exclusive.effective file, cpuset.cpus.exclusive will really be invariant and become whatever the users set. cpuset.cpus.exclusive.effective file will only have value if cpuset.cpus.exclusive set or it becomes a local partition. Hopefully this will be the final version. Cheers, Longman