From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm64: cpuidle: make arm_cpuidle_suspend() a bit more efficient
Date: Thu, 24 Mar 2016 13:08:50 +0800 [thread overview]
Message-ID: <1458796130-6109-3-git-send-email-jszhang@marvell.com> (raw)
In-Reply-To: <1458796130-6109-1-git-send-email-jszhang@marvell.com>
Currently, we check cpu_ops->cpu_suspend every time when entering a
low-power idle state. But this check could be avoided in this hot path
by moving it into arm_cpuidle_init() to reduce arm_cpuidle_suspend()
overhead a bit.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
arch/arm64/kernel/cpuidle.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c
index bd57c59..e11857f 100644
--- a/arch/arm64/kernel/cpuidle.c
+++ b/arch/arm64/kernel/cpuidle.c
@@ -19,7 +19,8 @@ int __init arm_cpuidle_init(unsigned int cpu)
{
int ret = -EOPNOTSUPP;
- if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_init_idle)
+ if (cpu_ops[cpu] && cpu_ops[cpu]->cpu_suspend &&
+ cpu_ops[cpu]->cpu_init_idle)
ret = cpu_ops[cpu]->cpu_init_idle(cpu);
return ret;
@@ -36,10 +37,5 @@ int arm_cpuidle_suspend(int index)
{
int cpu = smp_processor_id();
- /*
- * If suspend has not been initialized, cpu_suspend call fails early.
- */
- if (!cpu_ops[cpu]->cpu_suspend)
- return -EOPNOTSUPP;
return cpu_ops[cpu]->cpu_suspend(index);
}
--
2.8.0.rc3
next prev parent reply other threads:[~2016-03-24 5:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 5:08 [PATCH 0/2] arm64: cpuidle: make arm_cpuidle_suspend() more efficient Jisheng Zhang
2016-03-24 5:08 ` [PATCH 1/2] arm64: cpuidle: remove cpu_ops check from arm_cpuidle_suspend() Jisheng Zhang
2016-03-24 5:08 ` Jisheng Zhang [this message]
[not found] ` <20160324111507.GB9323@arm.com>
2016-03-24 13:18 ` [PATCH 0/2] arm64: cpuidle: make arm_cpuidle_suspend() more efficient Jisheng Zhang
2016-03-24 16:44 ` Lorenzo Pieralisi
2016-03-25 2:40 ` Jisheng Zhang
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=1458796130-6109-3-git-send-email-jszhang@marvell.com \
--to=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).