From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.151 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796446258; b=ERX9RrlOr6znAcCiA3k27RzM1Rx5N+RFz52xITRqkCdVn/8x0yzdSqAdfxvA6fboqzH8 zsIMb4T/Cu/tu8v35fO6wsiRiy9CCI/JuBqopgOr/R1w8UX3A4pUhbQMmoXcXJImcUZVl 3OVggiVyX0gn5/p9qXKb1dwJVr49UpVdy4sfeIXdH5waYFVuUV09HjUf5S4GJfLdElIA8 WXrmCRcwyJJMFOV/nIQ27e7ConycoyQdK1uuV49/JiQCHebO/79rFV92b8rZhOT9yBCAG CRSF8B74w/LYpzB7vvRC6GY2XPsUdr5l6MS7ZtYzJlplfeEBg0UNZuupvh21RDqh5fA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796446258; 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=EfY8i4pNrodtg2DzNUz1AOZVZefjis0sAC6HhKjyTt8=; b=SqMKpjT28ONM2KYaro/vB0hQ/jeXswQ06VYWNC3v9vFKTTfk4/BdWzeATkTnqCtHLDT3 q9+x4bMiH4lsOcRxyBH+fTyQdgpXfBXlciDHJ+IyoEoU76odQW30txATfd+1d/PVIzgYg jXSDIgb/zIbixY63FOsFDWIFd2ab0zF6I05PTGehWP96hrP1HBxKhBzl8kOG+p2fvD9Xx lJd7OprAslZ+lwSsVC2sp4gp8ABoL9FzlTYRW8a1umJ9ZKtAoD1pqS2QcCXyEvNqrH9zA oy0K5Wico503wET2kdLlEgyOEaFn81jcljrk8xKnpep/QqbFYbjd7ehVA7A25L22S0w== 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=uJVUHpKs; arc=none smtp.remote-ip=91.218.175.151 Received: from mta0.migadu.com (out-151.mta0.migadu.com [91.218.175.151]) (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 9DDC5606A32D for ; Sat, 5 Dec 2026 04:50:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9DDC5606A32D 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=uJVUHpKs X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=0kFiuEA/A8hgD7WxatIV5pZguOIJFbJIBLnsjRRqxWw=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796446255; v=1; x=1797051055; b=uJVUHpKs6pdva2AQYuvT53OG4dgCmDZwbSjTkeugrMqvpPQ3o4lCTXGrNoIQvjF2L64f/NNv GY1MDNBRwh9dI5DB4cBot7Q3PXeE9oGrO3BKqwCXhFaFzTJbW1VYvmfq7N7w42emfzxUHDJ5Z+v LxWAjZdlemKVlI4wQgZ0Um4o= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id df317e10e0fe01de; Sat, 05 Dec 2026 04:50:55 +0000 X-Mizu-Trace-ID: df317e10e0fe01de X-Migadu-Flow: FLOW_OUT Message-ID: Date: Sat, 5 Dec 2026 12:50:47 +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 06/12] cpuset: use partition_update() for remote partition update 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-7-ridong.chen@linux.dev> Content-Language: en-US From: Guopeng Zhang In-Reply-To: <20261129024431.2485721-7-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 > > Now that the partition_update() helper is available, use it to replace > the existing remote partition update logic. This unifies the update > path through a single centralized function. > > Signed-off-by: Ridong Chen > --- > kernel/cgroup/cpuset.c | 28 ++++++---------------------- > 1 file changed, 6 insertions(+), 22 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index f31512de9667..39d5b56f14b0 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -1837,8 +1837,8 @@ static void partition_disable(struct cpuset *cs, int new_prs, > * partition, and the CPUs in tmp->delmask are given back to it. If that > * parent is top_cpuset, subpartitions_cpus is updated accordingly. > */ > -static void __maybe_unused partition_update(struct cpuset *cs, int prs, struct cpumask *xcpus, > - struct cpumask *excpus, struct tmpmasks *tmp) > +static void partition_update(struct cpuset *cs, int prs, struct cpumask *xcpus, > + struct cpumask *excpus, struct tmpmasks *tmp) > { > struct cpuset *parent; > > @@ -1940,7 +1940,6 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs, > static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus, > struct cpumask *excpus, struct tmpmasks *tmp) > { > - bool adding, deleting; > int prs = cs->partition_root_state; > > if (WARN_ON_ONCE(!is_remote_partition(cs))) > @@ -1953,15 +1952,15 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus, > goto invalidate; > } > > - adding = cpumask_andnot(tmp->addmask, excpus, cs->effective_xcpus); > - deleting = cpumask_andnot(tmp->delmask, cs->effective_xcpus, excpus); > + cpumask_andnot(tmp->addmask, excpus, cs->effective_xcpus); > + cpumask_andnot(tmp->delmask, cs->effective_xcpus, excpus); > > /* > * Additions of remote CPUs is only allowed if those CPUs are > * not allocated to other partitions and there are effective_cpus > * left in the top cpuset. > */ > - if (adding) { > + if (!cpumask_empty(tmp->addmask)) { > enum prs_errcode err = prstate_housekeeping_conflict(prs, PRS_ROOT, > excpus, tmp->delmask); > > @@ -1977,22 +1976,7 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *xcpus, > } > > cs->remote_partition_updating = true; > - spin_lock_irq(&callback_lock); > - if (adding) > - partition_xcpus_add(prs, NULL, tmp->addmask); > - if (deleting) > - partition_xcpus_del(prs, NULL, tmp->delmask); > - /* > - * Need to update effective_xcpus and exclusive_cpus now as > - * update_sibling_cpumasks() below may iterate back to the same cs. > - */ > - cpumask_copy(cs->effective_xcpus, excpus); > - if (xcpus) > - cpumask_copy(cs->exclusive_cpus, xcpus); > - spin_unlock_irq(&callback_lock); > - if (adding || deleting) > - cpuset_force_rebuild(); > - > + partition_update(cs, prs, xcpus, excpus, tmp); > /* > * Propagate changes in top_cpuset's effective_cpus down the hierarchy. > */ Reviewed-by: Guopeng Zhang Thanks, Guopeng