From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.110 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796457194; b=wydyuCWz9Po03fh3GEEuJLP/2hr18IInuiZQmD5xprO/2ToV7CoHmyFlbQ7h94vuULhU rNOVj811QbS6qUyLF8eeczmt5rKOBoae7RB4yMUN+WFc9IqtsbAlVQwEgVWGOvEKxEbV0 4tdq0szOoLc5QbNDEQ2RIxpsK5UsQYXp6I2jodYgFbqpzPiZwEH8qB/oYhJMOZ4L6X4/7 qU0S53biQEcLYb3b5SsvS1CqJV/qK256JJEaD36sgr9VqeC9KoSTbgGn7C0ityWnPCrMb inX1H6NbvNfE44oBK/dXQhMrZ5yiJr8Vnvkha8fV/1CglClow9Wk7wzQgg6Q65ZB7yw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796457194; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Yt9xQFwC/W7tF5IcojHnL6QBa/IOLcS8p15l+8DDLmM=; b=WiebP+tDovvfblmJVE5rK4jI+O9RoeHzieqKKQTE0UmBU8Vin4ISYy0c7X9KPOJxmvXk h2po6Xs/BMmON3cEApRXZx2TkduyfuALz7m3u0kYQTsSLZMO9Pm9qwSkcprwaXHsG1ztN LIeUG5qO4sHd1osWiNpAJtg3JCQq2MTn7lHgYjk1xwJFmL8HOTWQjYxbBzRDio/ep6rLJ UjIARqvjk9FfBBYyOraTecvvcKNiB964pwxvoSgVYmlaSJRSYEZtFsuEKu3rNpgPm8ns7 TR2+SOzjnzij6fjLYwIuoyGBFxZLAQ3MNxJcG4uOZp0SCij17q3Ne9EVPOt9cQX7Evw== 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=fRm9Hey8; arc=none smtp.remote-ip=91.218.175.110 Received: from mta0.migadu.com (out-110.mta0.migadu.com [91.218.175.110]) (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 320F1606A32F for ; Sat, 5 Dec 2026 07:53:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 320F1606A32F 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=fRm9Hey8 X-Envelope-To: cgroups@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=SUfATSi7H2xduKsCF5+ewwHT7hc21FBZK4k1iLgm+II=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796457192; v=1; x=1797061992; b=fRm9Hey8KiTd4fQZ6LquBI2kAnjF9XwBLB0TMlG65uknSxy0/CoTWioJdT2Lmv/rI1KMCxjL txyH/6fi244TiF4KhTX3u9e3M27rdGvgmGFP1DNlNPzV0hwkPewNYs51G9KTut3UGxG3gn33ebD fNvIgV6d9ML28OnImHFgjMX0= X-Envelope-To: cgroups@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 210022cc151c6221; Sat, 05 Dec 2026 07:53:11 +0000 X-Mizu-Trace-ID: 210022cc151c6221 X-Migadu-Flow: FLOW_OUT Message-ID: <61d43e87-f788-4b84-a3fb-496c7fce02dc@linux.dev> Date: Sat, 5 Dec 2026 15:53:05 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 09/12] cpuset: use partition_disable() for local partition disablement To: Ridong Chen , Waiman Long , Tejun Heo , Johannes Weiner , =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Ridong Chen References: <20261129024431.2485721-1-ridong.chen@linux.dev> <20261129024431.2485721-10-ridong.chen@linux.dev> Content-Language: en-US From: Guopeng Zhang In-Reply-To: <20261129024431.2485721-10-ridong.chen@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在 2026/11/29 10:44, Ridong Chen 写道: > 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. Reviewed-by: Guopeng Zhang Thanks, Guopeng