mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Chuyi Zhou <zhouchuyi@bytedance.com>,
	tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com,
	ridong.chen@linux.dev
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/4] cgroup/cpuset: Drop cpusets_overlap()
Date: Mon, 30 Nov 2026 13:03:09 -0500	[thread overview]
Message-ID: <9309294e-50f4-41d8-9814-2e3aae0602fd@redhat.com> (raw)
In-Reply-To: <ccdf18901e44c405ff5f42475dd901688ecf6f17.1796039668.git.zhouchuyi@bytedance.com>


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 <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);
>   		}
>   	}
Waiman Long <longman@redhat.com>


  reply	other threads:[~2026-11-30 18:03 UTC|newest]

Thread overview: 11+ 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 [this message]
2026-11-30 18:11     ` Waiman Long
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

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=9309294e-50f4-41d8-9814-2e3aae0602fd@redhat.com \
    --to=longman@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=ridong.chen@linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®