From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.226 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795920319; b=3lSuhPBqORcFaqqTbuzKAPPNpavTF1VpcFQhpjQgodJZGCIkelYuElyEJCYk6lT9LCFu rs7TwXE5hBnmWYIePieYaQDfgaTaZWqvpNS0ImIPf15hkjth8HMjYgEqqmdYff1bAlpOS bAzO4LION5YzqFYdjWDW6y8Xg2JxA0TSEb5VRdm6BUinBBRhjDdCagwHSv00PesR4QOEj 0mAfmSw4zqXrJnVkqKTEBQ3t8a6/J2FIWKfV8sfEw3kYnmHbQRmzmGg6EpI6k/BAY+Tu2 RA16dZ0TDHuXLH86TsAFmULjOxlpKCdLMMTwLpDhKaItzfKzX5QCjlA1pFe2XAJP4KA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795920319; 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:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=LMldHzowxLSGys6KNft+Nn6XzgTNXRw6LQT+kEGs3Ps=; b=Qjq2gYClabo+f5vbcGwURwO3sTsZ8ylsv0dKjkOYtBo0CyN0MtShP68hXBPHsvGJo7Ni AtdeeWYDjnD2XhgQDUeipuO2hQEm3rn1NdplotJUF1mgtgzWbSA0Azk+i3CRJ/BdCPhV6 iEVoP2hXZlSXHBpSHCYrAfL76ONVVD3yJtxN1dXXzJlojdM0dAcGzhr+bjoWxIW6YCdFg 7UeK7XLn9vT33XcRSugrmZHmN4Q/N9mlTpZUDHyHRuZnXY743zVCSlLArDzF+6daAxOpl a3VHdiLXf+dIVLDpOdeqmIg99cvY0Lt58jLm0D4TTC91Ln3zFklHqXwE7X+ipk++w7A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=i0WFWzsT; arc=none smtp.remote-ip=91.218.175.226 Received: from mta0.migadu.com (out-226.mta0.migadu.com [91.218.175.226]) (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 A76EA606A32F for ; Sun, 29 Nov 2026 02:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A76EA606A32F 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=i0WFWzsT X-Envelope-To: cgroups@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=X2qPva/+avzptAUC1ZvIOOJwfiU14BW0qk2bGrpsDvk=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795920316; v=1; x=1796525116; b=i0WFWzsTb+fb+CVHVujKC35JYbLDKm/XuqZownHstYekz/kBvHezfxdeakd/cJ2+OESMYLcT mhmJwWaNZQQcj+/fLcmCvvB87Qh3HIA1C9VF5yt5rD84Q7sTDkGytrikOBw9JWe1dTg0vvodLAN vEt7UxLmUYZytZmxGMjVufO4= X-Envelope-To: cgroups@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 54d18bbdab44f772; Sun, 29 Nov 2026 02:45:15 +0000 X-Mizu-Trace-ID: 54d18bbdab44f772 X-Migadu-Flow: FLOW_OUT From: Ridong Chen To: Waiman Long , Tejun Heo , Johannes Weiner , =?UTF-8?q?Michal=20Koutn=C3=BD?= Cc: Ridong Chen , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Ridong Chen Subject: [PATCH v6 09/12] cpuset: use partition_disable() for local partition disablement Date: Sun, 29 Nov 2026 10:44:28 +0800 Message-Id: <20261129024431.2485721-10-ridong.chen@linux.dev> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261129024431.2485721-1-ridong.chen@linux.dev> References: <20261129024431.2485721-1-ridong.chen@linux.dev> X-Mailing-List: cgroups@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 Replace the partcmd_disable handling of update_parent_effective_cpumask() with partition_disable(), the same as for remote partition disablement. partition_disable() gives the CPUs of a valid partition back to its parent and propagates the change of the parent's effective_cpus to the tasks and the other children of the parent. An invalid partition has already given back its CPUs, so update_prstate() only calls partition_disable() for a valid partition and keeps setting the state of an invalid one itself. Signed-off-by: Ridong Chen --- kernel/cgroup/cpuset.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index ea5fcf583444..e226d89004fe 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -2188,18 +2188,7 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd, nocpu = tasks_nocpu_error(parent, cs, tmp->delmask); } - if (cmd == partcmd_disable) { - /* - * May need to add cpus back to parent's effective_cpus - * (and maybe removed from subpartitions_cpus/isolated_cpus) - * for valid partition root. - */ - if (is_partition_valid(cs)) { - cpumask_copy(tmp->addmask, cs->effective_xcpus); - adding = true; - } - new_prs = PRS_MEMBER; - } else if (newmask) { + if (newmask) { /* * Empty cpumask is not allowed */ @@ -3220,12 +3209,8 @@ static int update_prstate(struct cpuset *cs, int new_prs) } if (disable_partition) { - if (is_remote_partition(cs)) + if (is_partition_valid(cs)) partition_disable(cs, PRS_MEMBER, PERR_NONE, &tmpmask); - else - update_parent_effective_cpumask(cs, partcmd_disable, - NULL, &tmpmask); - /* * Invalidation of child partitions will be done in * update_cpumasks_hier() below. -- 2.34.1