From: Mel Gorman <mgorman@suse.de>
To: Yuan ZhaoXiong <yuanzhaoxiong@baidu.com>
Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: Simplify task_numa_find_cpu()
Date: Mon, 1 Nov 2021 11:18:40 +0000 [thread overview]
Message-ID: <20211101111840.GT3891@suse.de> (raw)
In-Reply-To: <1635578759-32343-1-git-send-email-yuanzhaoxiong@baidu.com>
On Sat, Oct 30, 2021 at 03:25:59PM +0800, Yuan ZhaoXiong wrote:
> Combine the 'cpumask_of_node()' with 'env->p->cpus_ptr' and drop the
> cpumask_test_cpu().
>
> Signed-off-by: Yuan ZhaoXiong <yuanzhaoxiong@baidu.com>
This potentially creates of a temporary cpumask variable as noted in the
comment for for_each_cpu_and.
* This saves a temporary CPU mask in many places. It is equivalent to:
* struct cpumask tmp;
* cpumask_and(&tmp, &mask1, &mask2);
* for_each_cpu(cpu, &tmp)
* ...
task_numa_find_cpu() is a relatively deep function. Did you check
the stack usage to make sure it's not pushing too close to the stack
boundary? While there are other users of for_each_cpu_and, they are mostly
shallow although find_energy_efficient_cpu() is a bit questionable and
probably should have used select_idle_mask.
Does the patch have a noticable performance impact?
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2021-11-01 11:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 7:25 [PATCH] sched/fair: Simplify task_numa_find_cpu() Yuan ZhaoXiong
2021-11-01 11:18 ` Mel Gorman [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-09-11 20:31 [PATCH] sched/fair: simplify task_numa_find_cpu() Yury Norov
2025-09-11 21:20 ` Phil Auld
2025-09-12 2:40 ` K Prateek Nayak
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=20211101111840.GT3891@suse.de \
--to=mgorman@suse.de \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=yuanzhaoxiong@baidu.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.