From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.32 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796302468; b=D5YR21YLUz60rizbkfsGWqmcvmQDxRtG4r67RiGM0Y+XZZge1RS6+cda+raoLOJ1dHuN tgJQsCNioDKZTERKNi2BEWRmxQsQjFJj5Xmt+QNWqDLi/exnrdzdZ10SA7fbPSzvPuayw VLbj7rezhBvaFistwX8i73ZqEzjmEtLWpxeTQ40AukimhA11FJWWYtI7ZHGMRLHKLDNWD q0ow1cy5r8WVXx/pbPq2lnzMf7ecURQcZw9nARjpah7px4S33uB+BN6kL1K3teV1EzDPh 3J6airUlz4OMtFYAZ3nqTJjYmSqgkWHovAHX3AOwlRvfP08WZzNETASfUJ+Wv6dgQwg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796302468; 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:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=x0LD2vqqQeewdq4u2/0qne/utZ1vKFFAZW0OSo6Bl2A=; b=AYsUDtrid3zI27ilGle3W9i8mdzENdaMzSoobE1EL+ZiQ8otzieH+L3XTPrgKij/JBgp WVaYVnTXrSjV/Le/T4csLUsc9NBXM/b5VfUww9WeH0uItDuKzYYi0rMPMK3OY+Aq7437/ pk2c1+OvXFJxin4nX2M1qrgOcHhw1E9yYmwi41QAKD7PPrnJW6sxewj+ZpgTn/iM9YHbA bVbH0Y8001NN51bO5klo8lmjsyKbLEVVf+vseZjC36Y4eUFZYmYtn2VthhUkPi1Z3mDL9 3S/gf9Iny3vF+Eb+rU+zwxQi9qTYboQ4ChmZCIHIoVodZdg9bu2o2pOaR5tL/lfnw3g== 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=uVRkE6UX; arc=none smtp.remote-ip=91.218.175.32 Received: from mta0.migadu.com (out-32.mta0.migadu.com [91.218.175.32]) (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 D4FC0606A322 for ; Thu, 3 Dec 2026 12:54:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4FC0606A322 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=uVRkE6UX X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=0V7R9DyQdd6z8/Kbxt74NcUBdaZt+KBWbuIz0Yzd71Q=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796302464; v=1; x=1796907264; b=uVRkE6UXiAtlvSSgp9ETNL6vEYBdmIHtqiTaADFUxi2F7KCC0SKSsoyZCFmY/xs2RMhM0Q5Y 5JXYZnM+nfxkxYELhoDl+aVp2jN4Uqi/N6dhpeq70PUE9zOyL2ZyT1SqGlcLX6t61UOPlIRYXKq gmn0W4p2QqDGCGTB31DSQr/s= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id e93b3e21806c017c; Thu, 03 Dec 2026 12:54:24 +0000 X-Mizu-Trace-ID: e93b3e21806c017c X-Migadu-Flow: FLOW_OUT Message-ID: Date: Thu, 3 Dec 2026 20:54:14 +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 1/2] cgroup/cpuset: Skip v2 sibling checks with an empty exclusive CPU mask To: Chuyi Zhou , longman@redhat.com, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com Cc: linux-kernel@vger.kernel.org References: From: Ridong Chen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/2/2026 6:44 PM, Chuyi Zhou wrote: > validate_change() skips the sibling walk on v2 only for members whose > exclusive CPU mask stays empty. It still scans siblings when a partition > root has no explicit exclusive CPUs or when a cpuset clears its mask. > > An empty exclusive CPU mask can neither intersect a sibling's exclusive > CPUs nor contain a sibling's nonempty allowed CPU mask. Only the top > cpuset is memory-exclusive on v2, and it has no siblings. > > Skip the walk whenever the trial exclusive CPU mask is empty. For a > partition root, compute_trialcs_excpus() still accounts for CPUs held > by siblings when computing the effective exclusive mask. > > Suggested-by: Ridong Chen > Link: https://lore.kernel.org/r/825c0c94-8565-4c4c-82c7-9c0f5872e6a9@linux.dev > Signed-off-by: Chuyi Zhou > --- > kernel/cgroup/cpuset.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c > index fb6359d72b68..d2337f817568 100644 > --- a/kernel/cgroup/cpuset.c > +++ b/kernel/cgroup/cpuset.c > @@ -805,14 +805,11 @@ int validate_change(struct cpuset *cur, struct cpuset *trial) > !cpuset_cpumask_can_shrink(cur->effective_cpus, user_xcpus(trial))) > goto out; > > - xcpus_changed = !cpumask_equal(cur->exclusive_cpus, trial->exclusive_cpus); > - > /* > - * On v2 an unchanged, empty exclusive CPU mask cannot conflict with > + * On v2 an empty exclusive CPU mask cannot conflict with > * a sibling's CPU masks. Only the top cpuset is memory-exclusive. > */ > - if (cpuset_v2() && cs_is_member(cur) && !xcpus_changed && > - cpumask_empty(trial->exclusive_cpus)) > + if (cpuset_v2() && cpumask_empty(trial->exclusive_cpus)) > goto valid; > > /* > @@ -820,6 +817,7 @@ int validate_change(struct cpuset *cur, struct cpuset *trial) > * overlap. exclusive_cpus cannot overlap with each other if set. > */ > ret = -EINVAL; > + xcpus_changed = !cpumask_equal(cur->exclusive_cpus, trial->exclusive_cpus); > cpuset_for_each_child(c, css, par) { > if (c == cur) > continue; Hi Chuyi, Thank you for patches. I don't think this should be a separate patch. I know Tejun has already accepted patch 4 of your previous series, but if he can update or drop it, a cleaner way would be to do patch 2 of this series first, and then filter out the cpumask_empty(trial->exclusive_cpus) case on top of it. That would make the changes easier to follow. -- Best regards Ridong