From: Peter Zijlstra <peterz@infradead.org>
To: Zhongqiu Han <quic_zhonhan@quicinc.com>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
vschneid@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] sched: idle: Optimize the generic idle loop by removing needless memory barrier
Date: Wed, 9 Oct 2024 15:05:30 +0200 [thread overview]
Message-ID: <20241009130530.GO17263@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241009093745.9504-1-quic_zhonhan@quicinc.com>
On Wed, Oct 09, 2024 at 05:37:45PM +0800, Zhongqiu Han wrote:
> The memory barrier rmb() in generic idle loop do_idle() function is not
> needed, it doesn't order any load instruction, just remove it as needless
> rmb() can cause performance impact.
>
> The rmb() was introduced by the tglx/history.git commit f2f1b44c75c4
> ("[PATCH] Remove RCU abuse in cpu_idle()") to order the loads between
> cpu_idle_map and pm_idle. It pairs with wmb() in function cpu_idle_wait().
>
> And then with the removal of cpu_idle_state in function cpu_idle() and
> wmb() in function cpu_idle_wait() in commit 783e391b7b5b ("x86: Simplify
> cpu_idle_wait"), rmb() no longer has a reason to exist.
>
> After that, commit d16699123434 ("idle: Implement generic idle function")
> implemented a generic idle function cpu_idle_loop() which resembles the
> functionality found in arch/. And it retained the rmb() in generic idle
> loop in file kernel/cpu/idle.c.
>
> And at last, commit cf37b6b48428 ("sched/idle: Move cpu/idle.c to
> sched/idle.c") moved cpu/idle.c to sched/idle.c. And commit c1de45ca831a
> ("sched/idle: Add support for tasks that inject idle") renamed function
> cpu_idle_loop() to do_idle().
>
> Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
> History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git
Thanks!
next prev parent reply other threads:[~2024-10-09 13:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 9:37 Zhongqiu Han
2024-10-09 13:05 ` Peter Zijlstra [this message]
2024-10-18 7:07 ` [tip: sched/core] " tip-bot2 for Zhongqiu Han
-- strict thread matches above, loose matches on Subject: below --
2024-08-16 10:06 [PATCH RESEND] " Zhongqiu Han
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=20241009130530.GO17263@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=quic_zhonhan@quicinc.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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
Powered by JetHome