From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.17 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793962568; b=Kv2HFCRQ2YFQHQhml5U2eltx88+JeVURuVdhPvxAW/7+H3GcN2/tQ3FBNGSs5r1Lp7xZ VUm84TZKEP9nET9K9OkzRHVZPnWR/vmpz6Fr/KuuXPTLyvPuGP+1M9rSeO0n0jazltTiv R6xC8I427SxEHGwwMVJiGIpfs8xMcKT/BioOJZ+iHNEr05dbdupremIo1GIaUVmZOBZmH /lZ2X+RBIb0Tgm2aquFruixh1nZrAAnzYnUGvnOzk2+e26OKWH4+daT2tj32QNrDvCQzW QT8edT0yr94s+n0khpbvUer+Ebigb3abQ86nbWPQH7kOrPu+gDGaSABJzWvor9NY9ig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793962568; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-Id: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=9rHwkPMwxdMgha3QVXCkmngbsNTxtZexOOuCRv+XpNE=; b=T+QRYtwjBEvVgePXiwHlqgsjQcRDWc267k4s+1ytt+Wo2wSAX1VaIwmhSN5cEeqSBkT5 nX7EVQZmedSnAvals1uYCOhuhrLz2c1ePpk5HeDBvkc4paB8vp/lSwVAOe20uzRJjkFxW iKEDhMBQl1/FCQrqVP3fzTVDb+QepJr0IguqdvBjKhKkJu04ixK7nVYOJtK71RyEFZ/m4 sWhSsplgXwkDbZB665LBM3ila0MZNkaP5z9IpVT14VgoGnQn+7mF47rjG2yoasgG8M+cN M/gzPICaeVkUFrE51qhcyTDUWf1jBxAS956nAQ4gj119TBFAOucoTaKTWrPR4dQhFwg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=none smtp.remote-ip=91.218.175.17 Received: from mta0.migadu.com (out-17.mta0.migadu.com [91.218.175.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2C65606A326 for ; Fri, 6 Nov 2026 10:56:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B2C65606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=PP1vC/2Py1tmxSvMadYBueWiOL9MqDxc72g6D5btaPo=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793962558; v=1; x=1794567358; b=Bcoy02Y/s24WwhNg4as3UCM+R6eoOYRjrJztOhDkgiUVp2EB2L+X5GLizj6M/kqBRuO4gacD pko8ZQSsnvqHG21Lu5xgJjZVAteOSVijhyvU0BbZ6IfmG9014AXqsPZTNYk5FPrrLfwdBi+86qJ sMs/76KfTt67j2bGFtr7MAWI= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id da0bf48ede6c7b6a; Fri, 06 Nov 2026 10:55:58 +0000 X-Mizu-Trace-ID: da0bf48ede6c7b6a X-Migadu-Flow: FLOW_OUT From: Ridong Chen To: Waiman Long , Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= , Shuah Khan Cc: Ridong Chen , Chen Ridong , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Sashiko , Guopeng Zhang , Ridong Chen Subject: [PATCH v2 0/4] cpuset: preparatory fixes and cleanups for partition rework Date: Fri, 6 Nov 2026 18:55:34 +0800 Message-Id: <20261106105538.2915492-1-ridong.chen@linux.dev> X-Mailer: git-send-email 2.34.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ridong Chen This is the first part of the cpuset local partition rework posted as RFC v4 [1]. The rework is split into three parts to make it easier to review and merge: 1) fixes and preparatory cleanups (this series); 2) introduce partition_enable/disable/update() and rework the local partition code on top of them; 3) clean up the remaining partition state handling outside these helpers. Patch 1 is a fix for an existing bug, found while looking into a review comment on RFC v4: when cpuset.cpus.exclusive of an already invalid partition root is cleared, its effective_xcpus is not reset, so its former exclusive CPUs can't be claimed by a sibling. A test case is added for it. Patches 2-4 are the first three patches of RFC v4, rebased onto next-20261104: 2) add an early empty cpumask check in partition_xcpus_add/del(), so callers don't need to check it; 3) settle the isolation state of CPUs given back to the parent in partition_xcpus_del(), so isolated_cpus_release() can be removed; 4) generalize validate_partition() so it can be used for both local and remote partitions. All patches build on their own, and test_cpuset_prs.sh passes with this series applied. [1] https://lore.kernel.org/all/20261101114206.2434398-1-ridong.chen@linux.dev/ Changes in v2: - Patch 1: force update_cpumasks_hier() after reset_partition_data(), so that the descendants don't keep the released exclusive CPUs, and add a test case for it (Sashiko). - Patch 1: fix the Fixes tags (Sashiko). - Link to v1: https://lore.kernel.org/all/20261105125215.2205892-1-ridong.chen@linux.dev/ Changes since RFC v4: - New patch 1 to fix the invalid partition effective_xcpus reset. - Patch 3: only settle the isolation state of the CPUs still owned by the parent when invalidating a child partition in compute_partition_effective_cpumask(), as the parent may be shrunk and not updated yet. This code is removed later in the rework. - Rebase onto next-20261104, which includes commit 362212853cd0 ("cgroup/cpuset: Fix incorrect CPU accounting with parent's effective_xcpus expansion"). Chen Ridong (2): cpuset: add early empty cpumask check in partition_xcpus_add/del cpuset: generalize the validate_partition() interface Ridong Chen (2): cgroup/cpuset: Reset partition data when an invalid partition stays invalid cpuset: settle isolation state when CPUs are given back to parent kernel/cgroup/cpuset.c | 217 ++++++++---------- .../selftests/cgroup/test_cpuset_prs.sh | 6 + 2 files changed, 97 insertions(+), 126 deletions(-) base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4 -- 2.34.1