cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonardo Bras <leobras@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Leonardo Bras <leobras@redhat.com>,
	Yury Norov <yury.norov@gmail.com>,
	anna-maria@linutronix.de, bristot@redhat.com, bsegall@google.com,
	cgroups@vger.kernel.org, dietmar.eggemann@arm.com,
	frederic@kernel.org, gregkh@linuxfoundation.org,
	hannes@cmpxchg.org, imran.f.khan@oracle.com,
	juri.lelli@redhat.com, linux-kernel@vger.kernel.org,
	lizefan.x@bytedance.com, longman@redhat.com, mgorman@suse.de,
	mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org,
	rafael@kernel.org, riel@surriel.com, rostedt@goodmis.org,
	tglx@linutronix.de, tj@kernel.org, vincent.guittot@linaro.org,
	vschneid@redhat.com
Subject: Re: [PATCH 2/6] sched/topology: optimize topology_span_sane()
Date: Wed, 31 Jul 2024 16:52:05 -0300	[thread overview]
Message-ID: <ZqqV5OxZPHUgjhag@LeoBras> (raw)
In-Reply-To: <9fb7adfc-701b-427c-a08e-a007e3159601@wanadoo.fr>

On Tue, May 14, 2024 at 10:53:00PM +0200, Christophe JAILLET wrote:
> Le 14/05/2024 à 00:01, Yury Norov a écrit :
> > The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i),
> > even though cpu != i. In such case, cpumask_equal() would always return
> > true, and we can proceed to the next CPU immediately.
> > 
> > Signed-off-by: Yury Norov <yury.norov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > ---
> >   kernel/sched/topology.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> > index 99ea5986038c..eb9eb17b0efa 100644
> > --- a/kernel/sched/topology.c
> > +++ b/kernel/sched/topology.c
> > @@ -2360,7 +2360,7 @@ static bool topology_span_sane(struct sched_domain_topology_level *tl,
> >   	 * breaks the linking done for an earlier span.
> >   	 */
> >   	for_each_cpu(i, cpu_map) {
> > -		if (i == cpu)
> > +		if (i == cpu || tl->mask(cpu) == tl->mask(i))
> >   			continue;
> >   		/*
> >   		 * We should 'and' all those masks with 'cpu_map' to exactly
> 
> Hi,
> 
> does it make sense to pre-compute tl->mask(cpu) outside the for_each_cpu()?

Looks like a good idea to me.

Leo 

> 
> CJ
> 


  reply	other threads:[~2024-07-31 19:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 22:01 [PATCH 0/6] bitmap: optimize API usage Yury Norov
2024-05-13 22:01 ` [PATCH 1/6] smp: optimize smp_call_function_many_cond() Yury Norov
2024-05-13 22:01 ` [PATCH 2/6] sched/topology: optimize topology_span_sane() Yury Norov
2024-05-14 20:53   ` Christophe JAILLET
2024-07-31 19:52     ` Leonardo Bras [this message]
2024-05-13 22:01 ` [PATCH 3/6] driver core: cpu: optimize print_cpus_isolated() Yury Norov
2024-05-14 21:02   ` Thomas Gleixner
2024-05-13 22:01 ` [PATCH 4/6] genirq: optimize irq_do_set_affinity() Yury Norov
2024-05-14 12:51   ` Jinjie Ruan
2024-05-14 16:16     ` Yury Norov
2024-05-13 22:01 ` [PATCH 5/6] cgroup/cpuset: optimize cpuset_mems_allowed_intersects() Yury Norov
2024-05-14 16:47   ` Waiman Long
2024-05-14 16:50     ` Tejun Heo
2024-05-14 16:55       ` Waiman Long
2024-05-13 22:01 ` [PATCH 6/6] tick/common: optimize cpumask_equal() usage Yury Norov
2024-05-14  8:31   ` Thomas Gleixner
2024-05-14  8:42     ` Thomas Gleixner
2024-05-14 16:47       ` Yury Norov
2024-05-14 20:47         ` Thomas Gleixner

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=ZqqV5OxZPHUgjhag@LeoBras \
    --to=leobras@redhat.com \
    --cc=anna-maria@linutronix.de \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=imran.f.khan@oracle.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=longman@redhat.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=riel@surriel.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yury.norov@gmail.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;
as well as URLs for NNTP newsgroup(s).