[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1402061655560.21991@ionos.tec.linutronix.de>
Date: Thu, 6 Feb 2014 17:03:45 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Preeti U Murthy <preeti@...ux.vnet.ibm.com>
cc: rafael.j.wysocki@...el.com, linux-pm@...r.kernel.org,
peterz@...radead.org, fweisbec@...il.com,
daniel.lezcano@...aro.org, linux-kernel@...r.kernel.org,
paulus@...ba.org, benh@...nel.crashing.org,
linuxppc-dev@...ts.ozlabs.org, mingo@...nel.org,
deepthi@...ux.vnet.ibm.com, paulmck@...ux.vnet.ibm.com,
svaidy@...ux.vnet.ibm.com, srivatsa.bhat@...ux.vnet.ibm.com
Subject: Re: [PATCH V3 2/3] tick/cpuidle: Initialize hrtimer mode of
broadcast
On Thu, 6 Feb 2014, Preeti U Murthy wrote:
Compiler warnings are not so important, right?
kernel/time/tick-broadcast.c: In function ‘tick_broadcast_oneshot_control’:
kernel/time/tick-broadcast.c:700:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
kernel/time/tick-broadcast.c:711:3: warning: ‘return’ with no value, in function returning non-void [-Wreturn-type]
> + /*
> + * If the current CPU owns the hrtimer broadcast
> + * mechanism, it cannot go deep idle.
> + */
> + ret = broadcast_needs_cpu(bc, cpu);
So we leave the CPU in the broadcast mask, just to force another call
to the notify code right away to remove it again. Wouldn't it be more
clever to clear the flag right away? That would make the changes to
the cpuidle code simpler. Delta patch below.
Thanks,
tglx
---
--- tip.orig/kernel/time/tick-broadcast.c
+++ tip/kernel/time/tick-broadcast.c
@@ -697,7 +697,7 @@ int tick_broadcast_oneshot_control(unsig
* states
*/
if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC)
- return;
+ return 0;
/*
* We are called with preemtion disabled from the depth of the
@@ -708,7 +708,7 @@ int tick_broadcast_oneshot_control(unsig
dev = td->evtdev;
if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))
- return;
+ return 0;
bc = tick_broadcast_device.evtdev;
@@ -731,9 +731,14 @@ int tick_broadcast_oneshot_control(unsig
}
/*
* If the current CPU owns the hrtimer broadcast
- * mechanism, it cannot go deep idle.
+ * mechanism, it cannot go deep idle and we remove the
+ * CPU from the broadcast mask. We don't have to go
+ * through the EXIT path as the local timer is not
+ * shutdown.
*/
ret = broadcast_needs_cpu(bc, cpu);
+ if (ret)
+ cpumask_clear_cpu(cpu, tick_broadcast_oneshot_mask);
} else {
if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) {
clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
Powered by blists - more mailing lists