From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.142 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796457194; b=GZluTfQCS2Jp+D22KRIP5eQP4axR2deKC3QiLjXZHei2GK1v7ci+WH72JUrEvM87nKs5 EN0G6tkvaF8ojTjkJB3yqhKx8W9mJzierpXj/0CnFuIdpm5tcNHE5EgsteYRO9g7aTras ag6CsJ6KH6Fc5x+5ufSsi+4Vconknctxl67C9O4iUH7eNrDBvXKWPdpRCZTVDJdKSIsuX jKTklqDLWQY2d9xFlf28sJkp67ntzU2oZa9E8nYKJs8RgFfRvcqzKsAjbkfwTjct2E7nT holsVoS95bYbIavhYB6SHERd/j6UzI2PFPPXgvVamwYNj6IQsI193feMA9WMxGgbBdg== 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=4PSCazuEFMCbXNh4Za6uFQg9VRKH5YyADqorOxMSQES+O+FxifTasv4WNqzktTk7TOD6 AZHYX4yBRxhW2rSETGAIb+dBNdpZt13nHnbU7vpZpf5NmYDvJAwH+bAN3+lEID0kE64Th c3LJpuamBPfrXyQyi9MSTeFt02um+1KsW72G20j4WG5QLI10M7Gd0p3M0nO24dyNh2jSK 8cVzs8m8t+Ds84XLsIUWYkPRqSGNuQ2mmptq7ilum9XtdgPizFq6Fw+QVDye4JdKfxO8l bNadT/I9OBjXEYJ8O4CgUaM/+De+5pzMadpvZefiHRnIlG9nrB3+XTenP39BoYQGNqQ== 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=HsfJYGUo; arc=none smtp.remote-ip=95.215.58.142 Received: from mta1.migadu.com (out-142.mta1.migadu.com [95.215.58.142]) (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 82E18606A322 for ; Sat, 5 Dec 2026 07:53:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 82E18606A322 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=HsfJYGUo X-Envelope-To: linux-kernel@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=1796457191; v=1; x=1797061991; b=HsfJYGUo3Q7CBEuqOkY3iyZV5Cbilc/0n7KxEnsUo/lMam4YCd8FE1ah87G9PeMpKKZzfrd5 B42qPBtDOR09RUjI0zJm6LaxkkP+43afkwoei9VzyyLO8qKoZ5mri/Hh2QvgVQjTBYQmnKKQBk4 z4FQxZGN8aB6/i//fApePxI0= X-Envelope-To: linux-kernel@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: linux-kernel@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