On 08/26/2015 09:13 PM, Vincent Guittot wrote:
Hi Alex,
On 26 August 2015 at 14:26, Alex Shi alex.shi@linaro.org wrote:
Hi, Daniel & Vincent,
Do you like to give a quick testing for this direction on ARM boards? It should be worth have a try. :)
I can give it a try when i will have some spare time
Thanks! Waiting for your good news. :)
Regards Alex
From d095e6ad805576451c1b6396de99f440a66c342d Mon Sep 17 00:00:00 2001 From: Alex Shi alex.shi@linaro.org Date: Wed, 26 Aug 2015 17:39:37 +0800 Subject: [PATCH] sched: find interrupted idle cpu
Currently we just try to find least idle cpu. If we can get the interrupted idle cpu, we can use it to get benefit from both latency and power side, since the interrupted cpu don't need time to wakeup.
I agree to this could save power but i don't agree with latency. We have to wait for the end of interruption which can be far longer than an exit from wfi
That depends on the different cpus. For general type, the exit from wfi is usually several hundreds ms. do you have data for how long time a usual interrupt needed?
Signed-off-by: Alex Shi alex.shi@linaro.org
include/linux/cpuidle.h | 1 + kernel/sched/fair.c | 9 ++++++++- kernel/sched/sched.h | 18 ++++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index d075d34..2a4521a 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -44,6 +44,7 @@ struct cpuidle_state { int power_usage; /* in mW */ unsigned int target_residency; /* in US */ bool disabled; /* disabled on all CPUs */
int in_irq; int (*enter) (struct cpuidle_device *dev, struct cpuidle_driver *drv,
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 6e2e348..094c815 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4740,7 +4740,14 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu) for_each_cpu_and(i, sched_group_cpus(group), tsk_cpus_allowed(p)) { if (idle_cpu(i)) { struct rq *rq = cpu_rq(i);
struct cpuidle_state *idle = idle_get_state(rq);
struct cpuidle_state *idle = idle_get_state(rq, i);
/* TODO: consider the RT and IRQ load? */
if (idle && idle->in_irq) {
shallowest_idle_cpu = i;
break;
}
find_idlest_cpu is mainly used for new task but it's not in the main call path of a waking up task.
Yes, I omitted this point.