From: Josh Don <joshdon@google.com>
To: Abel Wu <wuyun.abel@bytedance.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Mel Gorman <mgorman@suse.de>,
Vincent Guittot <vincent.guittot@linaro.org>,
Chen Yu <yu.c.chen@intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
"Gautham R . Shenoy" <gautham.shenoy@amd.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 4/7] sched/fair: remove useless check in select_idle_core
Date: Tue, 28 Jun 2022 17:41:06 -0700 [thread overview]
Message-ID: <CABk29Ns8C6iQJHkJNAhNOm2=CVjApicK5Y5teUSMjb2ncEx4_w@mail.gmail.com> (raw)
In-Reply-To: <73ab0143-b518-c0b5-328e-c8f3ec7013ed@bytedance.com>
On Mon, Jun 27, 2022 at 8:51 PM Abel Wu <wuyun.abel@bytedance.com> wrote:
>
>
> On 6/28/22 7:42 AM, Josh Don Wrote:
> > On Sun, Jun 19, 2022 at 5:05 AM Abel Wu <wuyun.abel@bytedance.com> wrote:
> >>
> >> The function only gets called when sds->has_idle_cores is true which can
> >> be possible only when sched_smt_present is enabled.
> >>
> >> Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>
> >> ---
> >> kernel/sched/fair.c | 3 ---
> >> 1 file changed, 3 deletions(-)
> >>
> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> >> index aba1dad19574..1cc86e76e38e 100644
> >> --- a/kernel/sched/fair.c
> >> +++ b/kernel/sched/fair.c
> >> @@ -6256,9 +6256,6 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu
> >> bool idle = true;
> >> int cpu;
> >>
> >> - if (!static_branch_likely(&sched_smt_present))
> >> - return __select_idle_cpu(core, p);
> >> -
> >
> > The static branch is basically free; although you're right that we
> > currently don't take !smt_present branch direction here, it doesn't
> > seem harmful to leave this check in case assumptions change about when
> > we call select_idle_core().
>
> I was thinking that it would be better to align with select_idle_smt
> that the caller do the check if necessary.
The difference there though is that select_idle_smt() is called
directly under the sched_smt_active() check, whereas the
select_idle_core() is a few nested function calls away (and relies on
has_idle_core rather than sched_smt_active() directly). So it is a bit
harder to codify this expectation. Since we're using a static_branch
here, I don't see a strong reason to remove it.
> >
> >> for_each_cpu(cpu, cpu_smt_mask(core)) {
> >> if (!available_idle_cpu(cpu)) {
> >> idle = false;
> >> --
> >> 2.31.1
> >>
next prev parent reply other threads:[~2022-06-29 0:41 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-19 12:04 [PATCH v4 0/7] sched/fair: improve scan efficiency of SIS Abel Wu
2022-06-19 12:04 ` [PATCH v4 1/7] sched/fair: default to false in test_idle_cores Abel Wu
2022-06-27 22:53 ` Josh Don
2022-06-28 3:39 ` Abel Wu
2022-06-19 12:04 ` [PATCH v4 2/7] sched/fair: remove redundant check in select_idle_smt Abel Wu
2022-06-27 23:17 ` Josh Don
2022-06-19 12:04 ` [PATCH v4 3/7] sched/fair: avoid double search on same cpu Abel Wu
2022-06-27 23:24 ` Josh Don
2022-06-19 12:04 ` [PATCH v4 4/7] sched/fair: remove useless check in select_idle_core Abel Wu
2022-06-27 23:42 ` Josh Don
2022-06-28 3:51 ` Abel Wu
2022-06-29 0:41 ` Josh Don [this message]
2022-06-19 12:04 ` [PATCH v4 5/7] sched/fair: skip SIS domain search if fully busy Abel Wu
2022-06-28 0:28 ` Josh Don
2022-06-28 6:53 ` Abel Wu
2022-06-29 1:11 ` Josh Don
2022-06-29 7:05 ` Abel Wu
2022-07-20 15:34 ` Gautham R. Shenoy
2022-08-15 9:49 ` Abel Wu
2022-06-19 12:04 ` [PATCH v4 6/7] sched/fair: skip busy cores in SIS search Abel Wu
2022-06-21 18:14 ` Chen Yu
2022-06-22 3:52 ` [External] " Abel Wu
2022-06-24 3:30 ` Chen Yu
2022-06-27 10:13 ` Abel Wu
2022-06-28 7:58 ` Abel Wu
2022-06-30 4:16 ` Chen Yu
2022-06-30 10:46 ` Abel Wu
2022-07-09 8:55 ` Chen Yu
2022-07-09 15:56 ` Abel Wu
2022-07-11 12:02 ` Chen Yu
2022-07-13 10:25 ` Abel Wu
2022-06-22 4:03 ` Abel Wu
2022-07-20 16:16 ` Gautham R. Shenoy
2022-08-15 9:49 ` Abel Wu
2022-06-19 12:04 ` [PATCH v4 7/7] sched/fair: de-entropy for SIS filter Abel Wu
2022-06-21 18:23 ` Chen Yu
2022-06-22 4:01 ` Abel Wu
2022-06-30 7:46 ` Abel Wu
2022-07-09 14:42 ` [sched/fair] 32fe13cd7a: phoronix-test-suite.fio.SequentialWrite.IO_uring.Yes.No.4KB.DefaultTestDirectory.mb_s -11.7% regression kernel test robot
2022-07-09 16:14 ` Abel Wu
2022-07-20 17:08 ` [PATCH v4 7/7] sched/fair: de-entropy for SIS filter Gautham R. Shenoy
2022-08-15 9:49 ` Abel Wu
2022-07-06 9:51 ` [PATCH v4 0/7] sched/fair: improve scan efficiency of SIS Abel Wu
2022-07-18 11:00 ` K Prateek Nayak
2022-08-15 13:59 ` Abel Wu
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='CABk29Ns8C6iQJHkJNAhNOm2=CVjApicK5Y5teUSMjb2ncEx4_w@mail.gmail.com' \
--to=joshdon@google.com \
--cc=gautham.shenoy@amd.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=peterz@infradead.org \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=wuyun.abel@bytedance.com \
--cc=yu.c.chen@intel.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).