From: Ridong Chen <ridong.chen@linux.dev>
To: Chuyi Zhou <zhouchuyi@bytedance.com>,
longman@redhat.com, tj@kernel.org, hannes@cmpxchg.org,
mkoutny@suse.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] cgroup/cpuset: Drop cpusets_overlap()
Date: Tue, 1 Dec 2026 09:24:04 +0800 [thread overview]
Message-ID: <60542c18-0231-4473-aa3f-067477f2e945@linux.dev> (raw)
In-Reply-To: <ccdf18901e44c405ff5f42475dd901688ecf6f17.1796039668.git.zhouchuyi@bytedance.com>
On 11/30/2026 8:04 PM, 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 <ridong.chen@linux.dev>
> Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
> ---
> 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);
> }
> }
Reviewed-by: Ridong Chen <ridong.chen@linux.dev>
Thanks.
--
Best regards
Ridong
next prev parent reply other threads:[~2026-12-01 1:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 12:04 [PATCH v2 0/4] cgroup/cpuset: Speed up v2 mask updates and domain rebuilds Chuyi Zhou
2026-11-30 12:04 ` [PATCH v2 1/4] cgroup/cpuset: Skip the sched domain attribute allocation on v2 Chuyi Zhou
2026-11-30 17:32 ` Waiman Long
2026-11-30 12:04 ` [PATCH v2 2/4] cgroup/cpuset: Check v2 partition overlap in a single pass Chuyi Zhou
2026-11-30 18:02 ` Waiman Long
2026-11-30 18:04 ` Waiman Long
2026-11-30 12:04 ` [PATCH v2 3/4] cgroup/cpuset: Drop cpusets_overlap() Chuyi Zhou
2026-11-30 18:03 ` Waiman Long
2026-11-30 18:11 ` Waiman Long
2026-12-01 1:24 ` Ridong Chen [this message]
2026-11-30 12:04 ` [PATCH v2 4/4] cgroup/cpuset: Skip sibling checks for v2 members without exclusive CPUs Chuyi Zhou
2026-11-30 18:04 ` Waiman Long
2026-12-01 1:49 ` Ridong Chen
2026-12-01 2:44 ` Chuyi Zhou
2026-12-01 2:58 ` Ridong Chen
2026-12-01 1:25 ` [PATCH v2 0/4] cgroup/cpuset: Speed up v2 mask updates and domain rebuilds Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60542c18-0231-4473-aa3f-067477f2e945@linux.dev \
--to=ridong.chen@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mkoutny@suse.com \
--cc=tj@kernel.org \
--cc=zhouchuyi@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.