Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2450888pxb; Mon, 23 Aug 2021 22:37:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZHSOM0hbCZ10POJvYDYx99UjajQZx9LqIBcMtuUnsBGderbDVQuRRDMx2nNWlO+ataevi X-Received: by 2002:a17:906:fcda:: with SMTP id qx26mr17653566ejb.121.1629783451978; Mon, 23 Aug 2021 22:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629783451; cv=none; d=google.com; s=arc-20160816; b=OrzlEI8aMi3HUPHbl5Yfba2cOIpcN8/jHJ5GjMZBnXvM5wSEQCVDpi98ReLjeErP3H zA6F5hpgubEMWXFRHlcbcgu2HiKwq9Yk+h49yGvn7oKE1HokgkRz9JeJU+HEiyzIQQvH kR6gLdQ7iMINuSptTsJARNn0W/tGD2TVDR2JlplYmgBmCIk1m2yPIOBXuJotNypXf6Ca i8c7mulJrh/HUw5BnGmAbapTmOYjYokIJ6uF7NzC/nvphyWB1n+RQWb5LQYz1xwL+KfL ZnITnrzscljna3TVOjzR6lgbY4r+VYHONadDBQ+9XgrJg1elEb+E82jBacYWgVhwaJBF kK+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=hMA9he3KzhIpa9VL4u2RVLcuo/UfXEbjSwWCQUOA21E=; b=EldEtkZQtmDn9gX2g3cLFlPnIvN3Oh5tdjeGzSQJw8GBuVbgfOwfLwItXMgDSvANyG 09AqXtg/F17ilzYx7Bui/rS7HdtsQURr/a0MkVa+R01SOh2Z/W2mXMAXOlFgO82VpVHg jsHnesS1z5Fy4WTucKE07nQaSCHksnNGp+oIwl9mfAK4/xM9gGyzZ2V9Vwgg5rcYA3eA ZUcboLymCG4b+b3ItXGYLpmUBmCt94yJBxAmR+V8ecQWwvvOwfrFKA3mz5I+euG3kDMe sglPyUt5dw86LvNh287bdmAgwGEGuOe0tpY2WAAK/yndQcLwngiWoExsrPEgttU+xeES /79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WgDL5RAr; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si11415016eds.318.2021.08.23.22.37.09; Mon, 23 Aug 2021 22:37:31 -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=@redhat.com header.s=mimecast20190719 header.b=WgDL5RAr; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbhHXFg0 (ORCPT + 99 others); Tue, 24 Aug 2021 01:36:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45009 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbhHXFgZ (ORCPT ); Tue, 24 Aug 2021 01:36:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629783341; 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=hMA9he3KzhIpa9VL4u2RVLcuo/UfXEbjSwWCQUOA21E=; b=WgDL5RAr5yB0fi43/gnecn6/MeMX5arENvJof06wKM4PD/1EcrVq2wZqOlPjS1Rjlk6qCc jtTwFuD9MACpZEWG6ABs2SQNVmTJThJM6c2Tw4I4MrpmnqmOdgzkk6UnGRD8FP1o/h9VnJ u64z7AsJKfm6MUmj7NcC0oLQr3mwv9k= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-R08ZocZKNWKLjHcVqpvPoQ-1; Tue, 24 Aug 2021 01:35:40 -0400 X-MC-Unique: R08ZocZKNWKLjHcVqpvPoQ-1 Received: by mail-qv1-f70.google.com with SMTP id gg8-20020a056214252800b00363a9ba9f52so12718172qvb.4 for ; Mon, 23 Aug 2021 22:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=hMA9he3KzhIpa9VL4u2RVLcuo/UfXEbjSwWCQUOA21E=; b=mGYlI3mfW0g6HhgFSdHV2PwFYkdcrH3DtsqyOwzmaARxGp7cYoU2DPlizsNtY6SzuU +Vyi19RcqBzjweJdies1Qj3MnzB5snhLA+E7UQTX1KrcQ4oP5XMrtcwcXoye1yzXPriW M6tYLvin/pnEiqFjKer3/DuKBcB/KLcZYUOub+pKkl8aWabehf2dH78c24Gxy29LYDhG za9F7PywqTsunUCrF7EeMxyWZIfXUADklSP+LckuRiJ5z4oyBovqMnEH8vXefmTRlqmg bTgZNZwV02o7J9f5KG9jLOnMlG2h8RLe1J84FU3uNDlYZUxNBpNqYv23ozv+6akLzy8T X20w== X-Gm-Message-State: AOAM531Nq3F8NlMnJ+jkGBfQOEaEgBTNZ609VH5JXLiStFA4e7JnOgn2 LOQ0oP9ZbJTWHn7tNs9+/6D83bXXtxve67D3Hh7mn+5p+UHtDMEvtmFfjp0L19kRmBP76v0fMCe eL/A5O8d+l5I5j2wRl91+h6TR X-Received: by 2002:a05:6214:e4e:: with SMTP id o14mr36773984qvc.46.1629783339520; Mon, 23 Aug 2021 22:35:39 -0700 (PDT) X-Received: by 2002:a05:6214:e4e:: with SMTP id o14mr36773974qvc.46.1629783339316; Mon, 23 Aug 2021 22:35:39 -0700 (PDT) Received: from llong.remote.csb ([50.238.61.194]) by smtp.gmail.com with ESMTPSA id i67sm10155762qkd.90.2021.08.23.22.35.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Aug 2021 22:35:38 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH v6 5/6] cgroup/cpuset: Update description of cpuset.cpus.partition in cgroup-v2.rst To: Tejun Heo Cc: Zefan Li , Johannes Weiner , Jonathan Corbet , Shuah Khan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Andrew Morton , Roman Gushchin , Phil Auld , Peter Zijlstra , Juri Lelli , Frederic Weisbecker , Marcelo Tosatti , =?UTF-8?Q?Michal_Koutn=c3=bd?= References: <20210814205743.3039-1-longman@redhat.com> <20210814205743.3039-6-longman@redhat.com> Message-ID: <95b72d36-32a9-8356-05b7-2829e4cc29ad@redhat.com> Date: Tue, 24 Aug 2021 01:35:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/21 1:08 PM, Tejun Heo wrote: > On Sat, Aug 14, 2021 at 04:57:42PM -0400, Waiman Long wrote: >> + A parent partition may distribute all its CPUs to its child >> + partitions as long as it is not the root cgroup and there is no >> + task directly associated with that parent partition. Otherwise, > "there is not task directly associated with the parent partition" isn't > necessary, right? That's already enforced by the cgroup hierarchy itself. Sorry for the late reply as I was on vacation last week. Yes, that is true. I should have de-emphasized that the fact that parent partition must have no task. > >> + there must be at least one cpu left in the parent partition. >> + A new task cannot be moved to a partition root with no effective >> + cpu. >> + >> + Once becoming a partition root, changes to "cpuset.cpus" >> + is generally allowed as long as the first condition above >> + (cpu exclusivity rule) is true. > All the above ultimately says is that "a new task cannot be moved to a > partition root with no effective cpu", but I don't understand why this would > be a separate rule. Shouldn't the partition just stop being a partition when > it doesn't have any exclusive cpu? What's the benefit of having multiple its > own failure mode? A partition with 0 cpu can be considered as a special partition type for spawning child partitions. This can be temporary as the cpus will be given back when a child partition is destroyed. > >> + Sometimes, changes to "cpuset.cpus" or cpu hotplug may cause >> + the state of the partition root to become invalid when the >> + other constraints of partition root are violated. Therefore, >> + it is recommended that users should always set "cpuset.cpus" >> + to the proper value first before enabling partition. In case >> + "cpuset.cpus" has to be modified after partition is enabled, >> + users should check the state of "cpuset.cpus.partition" after >> + making change to it to make sure that the partition is still >> + valid. > So, idk why the this doesn't cover the one above it. Also, this really > should be worded a lot stronger. It's not just recommended - confirming and > monitoring the transitions is an integral and essential part of using > cpuset. Sure, I will reword it to remove any mention of recommendation > ... >> + An invalid partition is not a real partition even though the >> + restriction of the cpu exclusivity rule will still apply. > Is there a reason we can't bring this in line with other failure behaviors? The internal flags are kept so that we can easily recover and become a valid partition again when the cpus become available. Otherwise, we can guarantee that the partition status can be restored even when the cpus become available. > >> + In the special case of a parent partition competing with a child >> + partition for the only CPU left, the parent partition wins and >> + the child partition becomes invalid. > Given that parent partitions are *always* empty, this rule doesn't seem to > make sense. You are right. I will update the wording. > > So, I think this definitely is a step in the right direction but still seems > to be neither here or there. Before, we pretended that we could police the > input when we couldn't. Now, we're changing the interface so that it > includes configuration failures as an integral part; however, we're still > policing some particular inputs while letting other inputs pass through and > trigger failures and why one is handled one way while the other differently > seems rather arbitrary. > The cpu_exclusive and load_balance flags are attributes associated directly with the partition type. They are not affected by cpu availability or changing of cpu list. That is why they are kept even when the partition become invalid. If we have to remove them, it will be equivalent to changing partition back to member and we may not need an invalid partition type at all. Also, we will not be able to revert back to partition again when the cpus becomes available. Cheers, Longman