From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796062326; b=xRnvUz6Y+Wl6I1B5OA4mnyzbH5pBphEHtVDQDPWH0y7zkoJtdgPA3/Zrxckt98SU1aiB KkO9y3f4C3unFYteCXe1xHSWBICJWvcSTtUxlry0p7+PVdZjDD2M0D8dVigkGwB16tHA3 6HqhDOqHHSJ5MDCQVuFur1jkwnu9ECRKqYRFobbKCXP9becmcJ9th6M6r6X9brN82hFCM 8yA9scxU67HOwS82l22eEEP2SAJvRHJUMTBPJ/IsngPaLXrTLNKkIG/3wZo1orO+m76Cy PgnWVHNkjY2r05zO6L7TfPxptr46c6TOSyj4t9BpfIRJWPtLxTLDmduRzpj3q6kGB/Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796062326; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:From:To:Cc:References:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-Scanned-By; bh=8uWj0QMH+h2A6OTmz/KI4/byCjx0b/L8dGXgLDwgRJ0=; b=Hyj5CAln/FpsyyYXycxezcUEOxg0jmWJxHrGRcERj07Gph+p2rDUxr4JkF2mpCQbmn8X XFsFYaSbAbD4rmHq9OOM5psvDKEZ4df+Gj25QA+oxCgdRv0ZcwWx+8qVVJKRwhVG/GKZ5 R35SiYOVNtOZS3xc4gCARumSdOXtO1u71g0DfKEJ94SY6pFrI1ktSX6eCN/1xJcpJzvGs 6W10MFvfVc9oWZhr/L+rpEO1FSNawxdX0kHRKBOgrRyFG0KT2pMwunnKd5Nx4jGLPWapV a51iM2hb7eTha7xvC7kxNkap5c4IfnMdBOngySADy+hqzEwTgdaVUN6jcr59QfXLo1A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yvt6DM6R; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB4D8606A32E for ; Mon, 30 Nov 2026 18:12:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BB4D8606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yvt6DM6R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796062325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8uWj0QMH+h2A6OTmz/KI4/byCjx0b/L8dGXgLDwgRJ0=; b=Yvt6DM6RnjasoUmEHvZC0Afy1NNpbvCe18ePTOO83S02Cnld/fdG52KEb5gHRkpOxo4YlT EtjauM30zqqZipIYR+mATVg36BNj0Qsm1EqpO2ZMb6Ca7dmuVgGHlXb/xvz/Xr6Sj3BNRb 4j2Zo5+EjPJpB5WTr5B2rJ6eiXAUq8Q= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-3i8YYmI5M3aLYEDZru6Xpw-1; Mon, 30 Nov 2026 18:11:59 +0000 X-MC-Unique: 3i8YYmI5M3aLYEDZru6Xpw-1 X-Mimecast-MFC-AGG-ID: 3i8YYmI5M3aLYEDZru6Xpw_1796062317 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6307C195605F; Mon, 30 Nov 2026 18:11:57 +0000 (UTC) Received: from [100.91.18.181] (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 25AE4436; Mon, 30 Nov 2026 18:11:56 +0000 (UTC) Message-ID: Date: Mon, 30 Nov 2026 13:11:55 -0500 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 v2 3/4] cgroup/cpuset: Drop cpusets_overlap() From: Waiman Long To: Chuyi Zhou , tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, ridong.chen@linux.dev Cc: linux-kernel@vger.kernel.org References: <9309294e-50f4-41d8-9814-2e3aae0602fd@redhat.com> Content-Language: en-US In-Reply-To: <9309294e-50f4-41d8-9814-2e3aae0602fd@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 On 11/30/26 1:03 PM, Waiman Long wrote: > > On 11/30/26 7:04 AM, Chuyi Zhou wrote: >> cpuset1_generate_sched_domains() is the only caller of >> cpusets_overlap(). >> Call cpumask_intersects() directly on the two effective CPU masks and >> remove the wrapper from the shared cpuset header. >> >> Suggested-by: Ridong Chen >> Signed-off-by: Chuyi Zhou >> --- >>   kernel/cgroup/cpuset-internal.h | 9 --------- >>   kernel/cgroup/cpuset-v1.c       | 3 ++- >>   2 files changed, 2 insertions(+), 10 deletions(-) >> >> diff --git a/kernel/cgroup/cpuset-internal.h >> b/kernel/cgroup/cpuset-internal.h >> index 5c80f2798825..b1c8f8fc2edf 100644 >> --- a/kernel/cgroup/cpuset-internal.h >> +++ b/kernel/cgroup/cpuset-internal.h >> @@ -257,15 +257,6 @@ static inline int is_spread_slab(const struct >> cpuset *cs) >>       return test_bit(CS_SPREAD_SLAB, &cs->flags); >>   } >>   -/* >> - * Helper routine for cpuset1_generate_sched_domains(). >> - * Do cpusets a, b have overlapping effective cpus_allowed masks? >> - */ >> -static inline int cpusets_overlap(struct cpuset *a, struct cpuset *b) >> -{ >> -    return cpumask_intersects(a->effective_cpus, b->effective_cpus); >> -} >> - >>   static inline int nr_cpusets(void) >>   { >>       /* jump label reference count + the top-level cpuset */ >> diff --git a/kernel/cgroup/cpuset-v1.c b/kernel/cgroup/cpuset-v1.c >> index 7c7f2887dfaf..e64bbf181faf 100644 >> --- a/kernel/cgroup/cpuset-v1.c >> +++ b/kernel/cgroup/cpuset-v1.c >> @@ -756,7 +756,8 @@ int cpuset1_generate_sched_domains(cpumask_var_t >> **domains, >>       /* Merge overlapping cpusets */ >>       for (i = 0; i < csn; i++) { >>           for (j = i + 1; j < csn; j++) { >> -            if (cpusets_overlap(csa[i], csa[j])) >> +            if (cpumask_intersects(csa[i]->effective_cpus, >> +                           csa[j]->effective_cpus)) >>                   uf_union(&csa[i]->node, &csa[j]->node); >>           } >>       } > Waiman Long Reviewed-by: Waiman Long