2013-03-02 10:10:15

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 0/4][V2] time: dynamic irq affinity

When a cpu goes to a deep idle state where its local timer is shutdown,
it notifies the time framework to use the broadcast timer instead.

Unfortunately, the broadcast device could wake up any CPU, including an
idle one which is not concerned by the wake up at all.

This implies, in the worst case, an idle CPU will wake up to send an IPI
to another idle cpu.

This patch solves this by setting the irq affinity to the cpu concerned
by the nearest timer event, by this way, the CPU which is wake up is
guarantee to be the one concerned by the next event and we are safe with
unnecessary wakeup for another idle CPU.

As the irq affinity is not supported by all the archs, a flag is needed
to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ.

Tested on a u8500 board with a test program doing indefinitely usleep 10000
wired on each CPU.

With dynamic irq affinity:
Log is 10.042298 secs long with 4190 events
cpu0/state0, 24 hits, total 2718.00us, avg 113.25us, min 0.00us, max 854.00us
cpu0/state1, 994 hits, total 9874827.00us, avg 9934.43us, min 30.00us, max 10346.00us
cpu1/state0, 73 hits, total 17001.00us, avg 232.89us, min 0.00us, max 10040.00us
cpu1/state1, 1002 hits, total 9883840.00us, avg 9864.11us, min 0.00us, max 10742.00us
cluster/state0, 0 hits, total 0.00us, avg 0.00us, min 0.00us, max 0.00us
cluster/state1, 1931 hits, total 9762328.00us, avg 5055.58us, min 30.00us, max 9308.00us

Without dynamic irq affinity:
Log is 10.036834 secs long with 6574 events
cpu0/state0, 114 hits, total 20107.00us, avg 176.38us, min 0.00us, max 7233.00us
cpu0/state1, 1951 hits, total 9833836.00us, avg 5040.41us, min 0.00us, max 9217.00us
cpu1/state0, 223 hits, total 21140.00us, avg 94.80us, min 0.00us, max 2960.00us
cpu1/state1, 997 hits, total 9879748.00us, avg 9909.48us, min 0.00us, max 10346.00us
cluster/state0, 5 hits, total 5462.00us, avg 1092.40us, min 580.00us, max 2899.00us
cluster/state1, 2298 hits, total 9740988.00us, avg 4238.90us, min 30.00us, max 9217.00us

Results for the specific test case 'usleep 10000'
* reduced by 40% the number of wake up on the system
* reduced by 49% the number of wake up for CPU0
* increased by factor two idle time for CPU0
* increase by 16% package idle hits + 16% average package idle time

Changelog:

V2 :
* mentioned CLOCK_EVT_FEAT_DYNIRQ flag name in patch description
* added comments for CLOCK_EVT_FEAT_DYNIRQ
* replaced tick_broadcast_set_affinity parameter to use a cpumask

V1 : initial post

Daniel Lezcano (3):
time : pass broadcast parameter
time : set broadcast irq affinity
ARM: nomadik: add dynamic irq flag to the timer

Viresh Kumar (1):
ARM: timer-sp: Set dynamic irq affinity

arch/arm/common/timer-sp.c | 3 ++-
drivers/clocksource/nomadik-mtu.c | 3 ++-
include/linux/clockchips.h | 5 +++++
kernel/time/tick-broadcast.c | 41 +++++++++++++++++++++++++++++--------
4 files changed, 42 insertions(+), 10 deletions(-)

--
1.7.9.5


2013-03-02 10:10:23

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 2/4][V2] time : set broadcast irq affinity

When a cpu goes to a deep idle state where its local timer is shutdown,
it notifies the time frame work to use the broadcast timer instead.

Unfortunately, the broadcast device could wake up any CPU, including an
idle one which is not concerned by the wake up at all.

This implies, in the worst case, an idle CPU will wake up to send an IPI
to another idle cpu.

This patch solves this by setting the irq affinity to the cpu concerned
by the nearest timer event, by this way, the CPU which is wake up is
guarantee to be the one concerned by the next event and we are safe with
unnecessary wakeup for another idle CPU.

As the irq affinity is not supported by all the archs, a flag is needed
to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ

Signed-off-by: Daniel Lezcano <[email protected]>
---
include/linux/clockchips.h | 5 +++++
kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 6634652..c93e2a6 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -55,6 +55,11 @@ enum clock_event_nofitiers {
#define CLOCK_EVT_FEAT_C3STOP 0x000008
#define CLOCK_EVT_FEAT_DUMMY 0x000010

+/*
+ * Clock event device can set its irq affinity dynamically
+ */
+#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
+
/**
* struct clock_event_device - clock event device descriptor
* @event_handler: Assigned by the framework to be called by the low
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 6197ac0..9ca8ff5 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
return to_cpumask(tick_broadcast_oneshot_mask);
}

-static int tick_broadcast_set_event(struct clock_event_device *bc,
+/*
+ * Set broadcast interrupt affinity
+ */
+static void tick_broadcast_set_affinity(struct clock_event_device *bc,
+ const struct cpumask *cpumask)
+{
+ if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
+ return;
+
+ if (cpumask_equal(bc->cpumask, cpumask))
+ return;
+
+ bc->cpumask = cpumask;
+ irq_set_affinity(bc->irq, bc->cpumask);
+}
+
+static int tick_broadcast_set_event(struct clock_event_device *bc, int cpu,
ktime_t expires, int force)
{
+ int ret;
+
if (bc->mode != CLOCK_EVT_MODE_ONESHOT)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);

- return clockevents_program_event(bc, expires, force);
+ ret = clockevents_program_event(bc, expires, force);
+ if (ret)
+ return ret;
+
+ tick_broadcast_set_affinity(bc, cpumask_of(cpu));
+
+ return 0;
}

int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
@@ -441,7 +465,7 @@ static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
{
struct tick_device *td;
ktime_t now, next_event;
- int cpu;
+ int cpu, next_cpu;

raw_spin_lock(&tick_broadcast_lock);
again:
@@ -454,8 +478,10 @@ again:
td = &per_cpu(tick_cpu_device, cpu);
if (td->evtdev->next_event.tv64 <= now.tv64)
cpumask_set_cpu(cpu, to_cpumask(tmpmask));
- else if (td->evtdev->next_event.tv64 < next_event.tv64)
+ else if (td->evtdev->next_event.tv64 < next_event.tv64) {
next_event.tv64 = td->evtdev->next_event.tv64;
+ next_cpu = cpu;
+ }
}

/*
@@ -478,7 +504,7 @@ again:
* Rearm the broadcast device. If event expired,
* repeat the above
*/
- if (tick_broadcast_set_event(dev, next_event, 0))
+ if (tick_broadcast_set_event(dev, next_cpu, next_event, 0))
goto again;
}
raw_spin_unlock(&tick_broadcast_lock);
@@ -521,7 +547,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
cpumask_set_cpu(cpu, tick_get_broadcast_oneshot_mask());
clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
if (dev->next_event.tv64 < bc->next_event.tv64)
- tick_broadcast_set_event(bc, dev->next_event, 1);
+ tick_broadcast_set_event(bc, cpu, dev->next_event, 1);
}
} else {
if (cpumask_test_cpu(cpu, tick_get_broadcast_oneshot_mask())) {
@@ -590,7 +616,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
tick_broadcast_init_next_event(to_cpumask(tmpmask),
tick_next_period);
- tick_broadcast_set_event(bc, tick_next_period, 1);
+ tick_broadcast_set_event(bc, cpu, tick_next_period, 1);
} else
bc->next_event.tv64 = KTIME_MAX;
} else {
--
1.7.9.5

2013-03-02 10:10:21

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 3/4][V2] ARM: nomadik: add dynamic irq flag to the timer

Add the dynamic irq affinity feature to the timer clock device.

Signed-off-by: Daniel Lezcano <[email protected]>
Reviewed-by: Vincent Guittot <[email protected]>
Acked-by: Rickard Andersson <[email protected]>
---
drivers/clocksource/nomadik-mtu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c
index 7cbcaa0..73dc540 100644
--- a/drivers/clocksource/nomadik-mtu.c
+++ b/drivers/clocksource/nomadik-mtu.c
@@ -136,7 +136,8 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,

static struct clock_event_device nmdk_clkevt = {
.name = "mtu_1",
- .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
+ .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC |
+ CLOCK_EVT_FEAT_DYNIRQ,
.rating = 200,
.set_mode = nmdk_clkevt_mode,
.set_next_event = nmdk_clkevt_next,
--
1.7.9.5

2013-03-02 10:10:48

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 4/4][V2] ARM: timer-sp: Set dynamic irq affinity

From: Viresh Kumar <[email protected]>

When a cpu goes to a deep idle state where its local timer is shutdown, it
notifies the time frame work to use the broadcast timer instead.

Unfortunately, the broadcast device could wake up any CPU, including an idle one
which is not concerned by the wake up at all.

This implies, in the worst case, an idle CPU will wake up to send an IPI to
another idle cpu.

This patch fixes this for ARM platforms using timer-sp, by setting
CLOCK_EVT_FEAT_DYNIRQ feature.

Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
---
arch/arm/common/timer-sp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 9d2d3ba..ae3c0f9 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -158,7 +158,8 @@ static int sp804_set_next_event(unsigned long next,
}

static struct clock_event_device sp804_clockevent = {
- .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+ .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
+ CLOCK_EVT_FEAT_DYNIRQ,
.set_mode = sp804_set_mode,
.set_next_event = sp804_set_next_event,
.rating = 300,
--
1.7.9.5

2013-03-02 10:11:06

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 1/4][V2] time : pass broadcast parameter

The broadcast timer could be passed as parameter to the function
instead of using again tick_broadcast_device.evtdev which was
previously used in the caller function.

Signed-off-by: Daniel Lezcano <[email protected]>
---
kernel/time/tick-broadcast.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 2fb8cb8..6197ac0 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -406,10 +406,9 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
return to_cpumask(tick_broadcast_oneshot_mask);
}

-static int tick_broadcast_set_event(ktime_t expires, int force)
+static int tick_broadcast_set_event(struct clock_event_device *bc,
+ ktime_t expires, int force)
{
- struct clock_event_device *bc = tick_broadcast_device.evtdev;
-
if (bc->mode != CLOCK_EVT_MODE_ONESHOT)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);

@@ -479,7 +478,7 @@ again:
* Rearm the broadcast device. If event expired,
* repeat the above
*/
- if (tick_broadcast_set_event(next_event, 0))
+ if (tick_broadcast_set_event(dev, next_event, 0))
goto again;
}
raw_spin_unlock(&tick_broadcast_lock);
@@ -522,7 +521,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
cpumask_set_cpu(cpu, tick_get_broadcast_oneshot_mask());
clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
if (dev->next_event.tv64 < bc->next_event.tv64)
- tick_broadcast_set_event(dev->next_event, 1);
+ tick_broadcast_set_event(bc, dev->next_event, 1);
}
} else {
if (cpumask_test_cpu(cpu, tick_get_broadcast_oneshot_mask())) {
@@ -591,7 +590,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
tick_broadcast_init_next_event(to_cpumask(tmpmask),
tick_next_period);
- tick_broadcast_set_event(tick_next_period, 1);
+ tick_broadcast_set_event(bc, tick_next_period, 1);
} else
bc->next_event.tv64 = KTIME_MAX;
} else {
--
1.7.9.5

2013-03-05 20:40:24

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On Sat, 2 Mar 2013, Daniel Lezcano wrote:
> When a cpu goes to a deep idle state where its local timer is shutdown,
> it notifies the time frame work to use the broadcast timer instead.
>
> Unfortunately, the broadcast device could wake up any CPU, including an
> idle one which is not concerned by the wake up at all.
>
> This implies, in the worst case, an idle CPU will wake up to send an IPI
> to another idle cpu.
>
> This patch solves this by setting the irq affinity to the cpu concerned
> by the nearest timer event, by this way, the CPU which is wake up is
> guarantee to be the one concerned by the next event and we are safe with
> unnecessary wakeup for another idle CPU.
>
> As the irq affinity is not supported by all the archs, a flag is needed
> to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ
>
> Signed-off-by: Daniel Lezcano <[email protected]>
> ---
> include/linux/clockchips.h | 5 +++++
> kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
> 2 files changed, 38 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
> index 6634652..c93e2a6 100644
> --- a/include/linux/clockchips.h
> +++ b/include/linux/clockchips.h
> @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
> #define CLOCK_EVT_FEAT_C3STOP 0x000008
> #define CLOCK_EVT_FEAT_DUMMY 0x000010
>
> +/*
> + * Clock event device can set its irq affinity dynamically
> + */
> +#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
> +
> /**
> * struct clock_event_device - clock event device descriptor
> * @event_handler: Assigned by the framework to be called by the low
> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
> index 6197ac0..9ca8ff5 100644
> --- a/kernel/time/tick-broadcast.c
> +++ b/kernel/time/tick-broadcast.c
> @@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
> return to_cpumask(tick_broadcast_oneshot_mask);
> }
>
> -static int tick_broadcast_set_event(struct clock_event_device *bc,
> +/*
> + * Set broadcast interrupt affinity
> + */
> +static void tick_broadcast_set_affinity(struct clock_event_device *bc,
> + const struct cpumask *cpumask)
> +{
> + if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
> + return;
> +
> + if (cpumask_equal(bc->cpumask, cpumask))
> + return;
> +
> + bc->cpumask = cpumask;

This breaks with CONFIG_CPUMASK_OFFSTACK=y. cpumask_copy() is your friend!

Thanks,

tglx

2013-03-06 09:27:47

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On 03/05/2013 09:40 PM, Thomas Gleixner wrote:
> On Sat, 2 Mar 2013, Daniel Lezcano wrote:
>> When a cpu goes to a deep idle state where its local timer is shutdown,
>> it notifies the time frame work to use the broadcast timer instead.
>>
>> Unfortunately, the broadcast device could wake up any CPU, including an
>> idle one which is not concerned by the wake up at all.
>>
>> This implies, in the worst case, an idle CPU will wake up to send an IPI
>> to another idle cpu.
>>
>> This patch solves this by setting the irq affinity to the cpu concerned
>> by the nearest timer event, by this way, the CPU which is wake up is
>> guarantee to be the one concerned by the next event and we are safe with
>> unnecessary wakeup for another idle CPU.
>>
>> As the irq affinity is not supported by all the archs, a flag is needed
>> to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ
>>
>> Signed-off-by: Daniel Lezcano <[email protected]>
>> ---
>> include/linux/clockchips.h | 5 +++++
>> kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
>> 2 files changed, 38 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
>> index 6634652..c93e2a6 100644
>> --- a/include/linux/clockchips.h
>> +++ b/include/linux/clockchips.h
>> @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
>> #define CLOCK_EVT_FEAT_C3STOP 0x000008
>> #define CLOCK_EVT_FEAT_DUMMY 0x000010
>>
>> +/*
>> + * Clock event device can set its irq affinity dynamically
>> + */
>> +#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
>> +
>> /**
>> * struct clock_event_device - clock event device descriptor
>> * @event_handler: Assigned by the framework to be called by the low
>> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
>> index 6197ac0..9ca8ff5 100644
>> --- a/kernel/time/tick-broadcast.c
>> +++ b/kernel/time/tick-broadcast.c
>> @@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
>> return to_cpumask(tick_broadcast_oneshot_mask);
>> }
>>
>> -static int tick_broadcast_set_event(struct clock_event_device *bc,
>> +/*
>> + * Set broadcast interrupt affinity
>> + */
>> +static void tick_broadcast_set_affinity(struct clock_event_device *bc,
>> + const struct cpumask *cpumask)
>> +{
>> + if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
>> + return;
>> +
>> + if (cpumask_equal(bc->cpumask, cpumask))
>> + return;
>> +
>> + bc->cpumask = cpumask;
>
> This breaks with CONFIG_CPUMASK_OFFSTACK=y. cpumask_copy() is your friend!

This instruction copies the pointer, not the cpumask content.

bc->cpumask is defined as a const struct cpumask * and is used to copy a
cpumask pointer not the content.

The cpumask parameter is a pointer to a global cpumask provided by the
cpumask_of macro.

But to be in the safe side, I compiled tested with
CONFIG_CPUMASK_OFFSTACK=y without problem.

Did I missed something ?

Thanks
-- Daniel

> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2013-03-06 09:48:20

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On Wed, 6 Mar 2013, Daniel Lezcano wrote:
> On 03/05/2013 09:40 PM, Thomas Gleixner wrote:
> > On Sat, 2 Mar 2013, Daniel Lezcano wrote:
> >> When a cpu goes to a deep idle state where its local timer is shutdown,
> >> it notifies the time frame work to use the broadcast timer instead.
> >>
> >> Unfortunately, the broadcast device could wake up any CPU, including an
> >> idle one which is not concerned by the wake up at all.
> >>
> >> This implies, in the worst case, an idle CPU will wake up to send an IPI
> >> to another idle cpu.
> >>
> >> This patch solves this by setting the irq affinity to the cpu concerned
> >> by the nearest timer event, by this way, the CPU which is wake up is
> >> guarantee to be the one concerned by the next event and we are safe with
> >> unnecessary wakeup for another idle CPU.
> >>
> >> As the irq affinity is not supported by all the archs, a flag is needed
> >> to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ
> >>
> >> Signed-off-by: Daniel Lezcano <[email protected]>
> >> ---
> >> include/linux/clockchips.h | 5 +++++
> >> kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
> >> 2 files changed, 38 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
> >> index 6634652..c93e2a6 100644
> >> --- a/include/linux/clockchips.h
> >> +++ b/include/linux/clockchips.h
> >> @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
> >> #define CLOCK_EVT_FEAT_C3STOP 0x000008
> >> #define CLOCK_EVT_FEAT_DUMMY 0x000010
> >>
> >> +/*
> >> + * Clock event device can set its irq affinity dynamically
> >> + */
> >> +#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
> >> +
> >> /**
> >> * struct clock_event_device - clock event device descriptor
> >> * @event_handler: Assigned by the framework to be called by the low
> >> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
> >> index 6197ac0..9ca8ff5 100644
> >> --- a/kernel/time/tick-broadcast.c
> >> +++ b/kernel/time/tick-broadcast.c
> >> @@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
> >> return to_cpumask(tick_broadcast_oneshot_mask);
> >> }
> >>
> >> -static int tick_broadcast_set_event(struct clock_event_device *bc,
> >> +/*
> >> + * Set broadcast interrupt affinity
> >> + */
> >> +static void tick_broadcast_set_affinity(struct clock_event_device *bc,
> >> + const struct cpumask *cpumask)
> >> +{
> >> + if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
> >> + return;
> >> +
> >> + if (cpumask_equal(bc->cpumask, cpumask))
> >> + return;
> >> +
> >> + bc->cpumask = cpumask;
> >
> > This breaks with CONFIG_CPUMASK_OFFSTACK=y. cpumask_copy() is your friend!
>
> This instruction copies the pointer, not the cpumask content.
>
> bc->cpumask is defined as a const struct cpumask * and is used to copy a
> cpumask pointer not the content.
>
> The cpumask parameter is a pointer to a global cpumask provided by the
> cpumask_of macro.
>
> But to be in the safe side, I compiled tested with
> CONFIG_CPUMASK_OFFSTACK=y without problem.
>
> Did I missed something ?

No, I misinterpreted the patch. Assigning a pointer is safe.

Thanks,

tglx

2013-03-06 12:35:17

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On 03/06/2013 10:48 AM, Thomas Gleixner wrote:
> On Wed, 6 Mar 2013, Daniel Lezcano wrote:
>> On 03/05/2013 09:40 PM, Thomas Gleixner wrote:
>>> On Sat, 2 Mar 2013, Daniel Lezcano wrote:
>>>> When a cpu goes to a deep idle state where its local timer is shutdown,
>>>> it notifies the time frame work to use the broadcast timer instead.
>>>>
>>>> Unfortunately, the broadcast device could wake up any CPU, including an
>>>> idle one which is not concerned by the wake up at all.
>>>>
>>>> This implies, in the worst case, an idle CPU will wake up to send an IPI
>>>> to another idle cpu.
>>>>
>>>> This patch solves this by setting the irq affinity to the cpu concerned
>>>> by the nearest timer event, by this way, the CPU which is wake up is
>>>> guarantee to be the one concerned by the next event and we are safe with
>>>> unnecessary wakeup for another idle CPU.
>>>>
>>>> As the irq affinity is not supported by all the archs, a flag is needed
>>>> to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ
>>>>
>>>> Signed-off-by: Daniel Lezcano <[email protected]>
>>>> ---
>>>> include/linux/clockchips.h | 5 +++++
>>>> kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
>>>> 2 files changed, 38 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
>>>> index 6634652..c93e2a6 100644
>>>> --- a/include/linux/clockchips.h
>>>> +++ b/include/linux/clockchips.h
>>>> @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
>>>> #define CLOCK_EVT_FEAT_C3STOP 0x000008
>>>> #define CLOCK_EVT_FEAT_DUMMY 0x000010
>>>>
>>>> +/*
>>>> + * Clock event device can set its irq affinity dynamically
>>>> + */
>>>> +#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
>>>> +
>>>> /**
>>>> * struct clock_event_device - clock event device descriptor
>>>> * @event_handler: Assigned by the framework to be called by the low
>>>> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
>>>> index 6197ac0..9ca8ff5 100644
>>>> --- a/kernel/time/tick-broadcast.c
>>>> +++ b/kernel/time/tick-broadcast.c
>>>> @@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
>>>> return to_cpumask(tick_broadcast_oneshot_mask);
>>>> }
>>>>
>>>> -static int tick_broadcast_set_event(struct clock_event_device *bc,
>>>> +/*
>>>> + * Set broadcast interrupt affinity
>>>> + */
>>>> +static void tick_broadcast_set_affinity(struct clock_event_device *bc,
>>>> + const struct cpumask *cpumask)
>>>> +{
>>>> + if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
>>>> + return;
>>>> +
>>>> + if (cpumask_equal(bc->cpumask, cpumask))
>>>> + return;
>>>> +
>>>> + bc->cpumask = cpumask;
>>>
>>> This breaks with CONFIG_CPUMASK_OFFSTACK=y. cpumask_copy() is your friend!
>>
>> This instruction copies the pointer, not the cpumask content.
>>
>> bc->cpumask is defined as a const struct cpumask * and is used to copy a
>> cpumask pointer not the content.
>>
>> The cpumask parameter is a pointer to a global cpumask provided by the
>> cpumask_of macro.
>>
>> But to be in the safe side, I compiled tested with
>> CONFIG_CPUMASK_OFFSTACK=y without problem.
>>
>> Did I missed something ?
>
> No, I misinterpreted the patch. Assigning a pointer is safe.

Ok, thanks anyway for reviewing the patch.

Do you think it is acceptable for upstreaming ?

-- Daniel

<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Subject: [tip:timers/core] tick: Pass broadcast device to tick_broadcast_set_event()

Commit-ID: f9ae39d04ccdec8d8ecf532191b7056c279a22c0
Gitweb: http://git.kernel.org/tip/f9ae39d04ccdec8d8ecf532191b7056c279a22c0
Author: Daniel Lezcano <[email protected]>
AuthorDate: Sat, 2 Mar 2013 11:10:10 +0100
Committer: Thomas Gleixner <[email protected]>
CommitDate: Thu, 7 Mar 2013 16:13:26 +0100

tick: Pass broadcast device to tick_broadcast_set_event()

Pass the broadcast timer to tick_broadcast_set_event() instead of
reevaluating tick_broadcast_device.evtdev.

[ tglx: Massaged changelog ]

Signed-off-by: Daniel Lezcano <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
---
kernel/time/tick-broadcast.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 35b8875..70dd98c 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -401,10 +401,9 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
return tick_broadcast_oneshot_mask;
}

-static int tick_broadcast_set_event(ktime_t expires, int force)
+static int tick_broadcast_set_event(struct clock_event_device *bc,
+ ktime_t expires, int force)
{
- struct clock_event_device *bc = tick_broadcast_device.evtdev;
-
if (bc->mode != CLOCK_EVT_MODE_ONESHOT)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);

@@ -474,7 +473,7 @@ again:
* Rearm the broadcast device. If event expired,
* repeat the above
*/
- if (tick_broadcast_set_event(next_event, 0))
+ if (tick_broadcast_set_event(dev, next_event, 0))
goto again;
}
raw_spin_unlock(&tick_broadcast_lock);
@@ -516,7 +515,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_oneshot_mask)) {
clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
if (dev->next_event.tv64 < bc->next_event.tv64)
- tick_broadcast_set_event(dev->next_event, 1);
+ tick_broadcast_set_event(bc, dev->next_event, 1);
}
} else {
if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) {
@@ -582,7 +581,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
tick_broadcast_init_next_event(tmpmask,
tick_next_period);
- tick_broadcast_set_event(tick_next_period, 1);
+ tick_broadcast_set_event(bc, tick_next_period, 1);
} else
bc->next_event.tv64 = KTIME_MAX;
} else {

Subject: [tip:timers/core] tick: Dynamically set broadcast irq affinity

Commit-ID: d2348fb6fdc6d671ad45b62db237f76c8c115603
Gitweb: http://git.kernel.org/tip/d2348fb6fdc6d671ad45b62db237f76c8c115603
Author: Daniel Lezcano <[email protected]>
AuthorDate: Sat, 2 Mar 2013 11:10:11 +0100
Committer: Thomas Gleixner <[email protected]>
CommitDate: Thu, 7 Mar 2013 16:13:26 +0100

tick: Dynamically set broadcast irq affinity

When a cpu goes to a deep idle state where its local timer is
shutdown, it notifies the time frame work to use the broadcast timer
instead. Unfortunately, the broadcast device could wake up any CPU,
including an idle one which is not concerned by the wake up at all. So
in the worst case an idle CPU will wake up to send an IPI to the CPU
whose timer expired.

Provide an opt-in feature CLOCK_EVT_FEAT_DYNIRQ which tells the core
that is should set the interrupt affinity of the broadcast interrupt
to the cpu which has the earliest expiry time. This avoids unnecessary
spurious wakeups and IPIs.

[ tglx: Adopted to cpumask rework, silenced an uninitialized warning,
massaged changelog ]

Signed-off-by: Daniel Lezcano <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
---
include/linux/clockchips.h | 5 +++++
kernel/time/tick-broadcast.c | 39 +++++++++++++++++++++++++++++++--------
2 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 6634652..494d33e 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -55,6 +55,11 @@ enum clock_event_nofitiers {
#define CLOCK_EVT_FEAT_C3STOP 0x000008
#define CLOCK_EVT_FEAT_DUMMY 0x000010

+/*
+ * Core shall set the interrupt affinity dynamically in broadcast mode
+ */
+#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
+
/**
* struct clock_event_device - clock event device descriptor
* @event_handler: Assigned by the framework to be called by the low
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 70dd98c..380910d 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -401,13 +401,34 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
return tick_broadcast_oneshot_mask;
}

-static int tick_broadcast_set_event(struct clock_event_device *bc,
+/*
+ * Set broadcast interrupt affinity
+ */
+static void tick_broadcast_set_affinity(struct clock_event_device *bc,
+ const struct cpumask *cpumask)
+{
+ if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
+ return;
+
+ if (cpumask_equal(bc->cpumask, cpumask))
+ return;
+
+ bc->cpumask = cpumask;
+ irq_set_affinity(bc->irq, bc->cpumask);
+}
+
+static int tick_broadcast_set_event(struct clock_event_device *bc, int cpu,
ktime_t expires, int force)
{
+ int ret;
+
if (bc->mode != CLOCK_EVT_MODE_ONESHOT)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);

- return clockevents_program_event(bc, expires, force);
+ ret = clockevents_program_event(bc, expires, force);
+ if (!ret)
+ tick_broadcast_set_affinity(bc, cpumask_of(cpu));
+ return ret;
}

int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
@@ -436,7 +457,7 @@ static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
{
struct tick_device *td;
ktime_t now, next_event;
- int cpu;
+ int cpu, next_cpu = 0;

raw_spin_lock(&tick_broadcast_lock);
again:
@@ -447,10 +468,12 @@ again:
/* Find all expired events */
for_each_cpu(cpu, tick_broadcast_oneshot_mask) {
td = &per_cpu(tick_cpu_device, cpu);
- if (td->evtdev->next_event.tv64 <= now.tv64)
+ if (td->evtdev->next_event.tv64 <= now.tv64) {
cpumask_set_cpu(cpu, tmpmask);
- else if (td->evtdev->next_event.tv64 < next_event.tv64)
+ } else if (td->evtdev->next_event.tv64 < next_event.tv64) {
next_event.tv64 = td->evtdev->next_event.tv64;
+ next_cpu = cpu;
+ }
}

/*
@@ -473,7 +496,7 @@ again:
* Rearm the broadcast device. If event expired,
* repeat the above
*/
- if (tick_broadcast_set_event(dev, next_event, 0))
+ if (tick_broadcast_set_event(dev, next_cpu, next_event, 0))
goto again;
}
raw_spin_unlock(&tick_broadcast_lock);
@@ -515,7 +538,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
if (!cpumask_test_and_set_cpu(cpu, tick_broadcast_oneshot_mask)) {
clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN);
if (dev->next_event.tv64 < bc->next_event.tv64)
- tick_broadcast_set_event(bc, dev->next_event, 1);
+ tick_broadcast_set_event(bc, cpu, dev->next_event, 1);
}
} else {
if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) {
@@ -581,7 +604,7 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
tick_broadcast_init_next_event(tmpmask,
tick_next_period);
- tick_broadcast_set_event(bc, tick_next_period, 1);
+ tick_broadcast_set_event(bc, cpu, tick_next_period, 1);
} else
bc->next_event.tv64 = KTIME_MAX;
} else {

2013-03-08 04:38:26

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On 03/06/2013 10:48 AM, Thomas Gleixner wrote:
> On Wed, 6 Mar 2013, Daniel Lezcano wrote:
>> On 03/05/2013 09:40 PM, Thomas Gleixner wrote:
>>> On Sat, 2 Mar 2013, Daniel Lezcano wrote:
>>>> When a cpu goes to a deep idle state where its local timer is shutdown,
>>>> it notifies the time frame work to use the broadcast timer instead.
>>>>
>>>> Unfortunately, the broadcast device could wake up any CPU, including an
>>>> idle one which is not concerned by the wake up at all.
>>>>
>>>> This implies, in the worst case, an idle CPU will wake up to send an IPI
>>>> to another idle cpu.
>>>>
>>>> This patch solves this by setting the irq affinity to the cpu concerned
>>>> by the nearest timer event, by this way, the CPU which is wake up is
>>>> guarantee to be the one concerned by the next event and we are safe with
>>>> unnecessary wakeup for another idle CPU.
>>>>
>>>> As the irq affinity is not supported by all the archs, a flag is needed
>>>> to specify which clocksource can handle it : CLOCK_EVT_FEAT_DYNIRQ
>>>>
>>>> Signed-off-by: Daniel Lezcano <[email protected]>
>>>> ---
>>>> include/linux/clockchips.h | 5 +++++
>>>> kernel/time/tick-broadcast.c | 40 +++++++++++++++++++++++++++++++++-------
>>>> 2 files changed, 38 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
>>>> index 6634652..c93e2a6 100644
>>>> --- a/include/linux/clockchips.h
>>>> +++ b/include/linux/clockchips.h
>>>> @@ -55,6 +55,11 @@ enum clock_event_nofitiers {
>>>> #define CLOCK_EVT_FEAT_C3STOP 0x000008
>>>> #define CLOCK_EVT_FEAT_DUMMY 0x000010
>>>>
>>>> +/*
>>>> + * Clock event device can set its irq affinity dynamically
>>>> + */
>>>> +#define CLOCK_EVT_FEAT_DYNIRQ 0x000020
>>>> +
>>>> /**
>>>> * struct clock_event_device - clock event device descriptor
>>>> * @event_handler: Assigned by the framework to be called by the low
>>>> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
>>>> index 6197ac0..9ca8ff5 100644
>>>> --- a/kernel/time/tick-broadcast.c
>>>> +++ b/kernel/time/tick-broadcast.c
>>>> @@ -406,13 +406,37 @@ struct cpumask *tick_get_broadcast_oneshot_mask(void)
>>>> return to_cpumask(tick_broadcast_oneshot_mask);
>>>> }
>>>>
>>>> -static int tick_broadcast_set_event(struct clock_event_device *bc,
>>>> +/*
>>>> + * Set broadcast interrupt affinity
>>>> + */
>>>> +static void tick_broadcast_set_affinity(struct clock_event_device *bc,
>>>> + const struct cpumask *cpumask)
>>>> +{
>>>> + if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ))
>>>> + return;
>>>> +
>>>> + if (cpumask_equal(bc->cpumask, cpumask))
>>>> + return;
>>>> +
>>>> + bc->cpumask = cpumask;
>>>
>>> This breaks with CONFIG_CPUMASK_OFFSTACK=y. cpumask_copy() is your friend!
>>
>> This instruction copies the pointer, not the cpumask content.
>>
>> bc->cpumask is defined as a const struct cpumask * and is used to copy a
>> cpumask pointer not the content.
>>
>> The cpumask parameter is a pointer to a global cpumask provided by the
>> cpumask_of macro.
>>
>> But to be in the safe side, I compiled tested with
>> CONFIG_CPUMASK_OFFSTACK=y without problem.


Hi Thomas,

thanks for merging the patch 1 and 2.

I was wondering if it would be possible to take the 3/4 and 4/4
otherwise the flag dependency will prevent to send those to the
maintainer's tree until they gain visibility on it.


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2013-03-08 07:20:42

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On Fri, 8 Mar 2013, Daniel Lezcano wrote:
> On 03/06/2013 10:48 AM, Thomas Gleixner wrote:
> I was wondering if it would be possible to take the 3/4 and 4/4
> otherwise the flag dependency will prevent to send those to the
> maintainer's tree until they gain visibility on it.

I can take them with the ack of arm soc folks.

Thanks,

tglx

2013-03-08 15:17:38

by Daniel Lezcano

[permalink] [raw]
Subject: [PATCH 3/4][V2] ARM: nomadik: add dynamic irq flag to the timer

> Add the dynamic irq affinity feature to the timer clock device.
>
> Signed-off-by: Daniel Lezcano <[email protected]>
> Reviewed-by: Vincent Guittot <[email protected]>
> Acked-by: Rickard Andersson <[email protected]>
> ---

Hi Linus,

AFAIU, you are ok with this patch, Rickard acked it and Vincent reviewed it.

Thomas agreed to merge it into its tree as I requested because we will
need to wait for your tree to gain visibility to this new flag before
submitting this patch, which can take awhile.

Could you please ack it if it is ok for you ?

Thanks
-- Daniel

>
>
> drivers/clocksource/nomadik-mtu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c
> index 7cbcaa0..73dc540 100644
> --- a/drivers/clocksource/nomadik-mtu.c
> +++ b/drivers/clocksource/nomadik-mtu.c
> @@ -136,7 +136,8 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
> static struct clock_event_device nmdk_clkevt = {
> .name = "mtu_1",
> - .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
> + .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC |
> + CLOCK_EVT_FEAT_DYNIRQ,
> .rating = 200,
> .set_mode = nmdk_clkevt_mode,
> .set_next_event = nmdk_clkevt_next,
> --
> 1.7.9.5


Attachments:
Attached Message Part (0.00 B)

2013-03-08 15:29:03

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 4/4][V2] ARM: timer-sp: Set dynamic irq affinity

On 03/02/2013 11:10 AM, Daniel Lezcano wrote:
> From: Viresh Kumar <[email protected]>
>
> When a cpu goes to a deep idle state where its local timer is shutdown, it
> notifies the time frame work to use the broadcast timer instead.
>
> Unfortunately, the broadcast device could wake up any CPU, including an idle one
> which is not concerned by the wake up at all.
>
> This implies, in the worst case, an idle CPU will wake up to send an IPI to
> another idle cpu.
>
> This patch fixes this for ARM platforms using timer-sp, by setting
> CLOCK_EVT_FEAT_DYNIRQ feature.
>
> Signed-off-by: Viresh Kumar <[email protected]>
> Signed-off-by: Daniel Lezcano <[email protected]>
> ---

Hi Russell,

I asked Thomas if he could take this patch in its tree but it falls
under your umbrella. Thomas agreed to take it if you ack this patch.

Is this patch acceptable for you ?

Thanks in advance
-- Daniel


> arch/arm/common/timer-sp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
> index 9d2d3ba..ae3c0f9 100644
> --- a/arch/arm/common/timer-sp.c
> +++ b/arch/arm/common/timer-sp.c
> @@ -158,7 +158,8 @@ static int sp804_set_next_event(unsigned long next,
> }
>
> static struct clock_event_device sp804_clockevent = {
> - .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
> + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
> + CLOCK_EVT_FEAT_DYNIRQ,
> .set_mode = sp804_set_mode,
> .set_next_event = sp804_set_next_event,
> .rating = 300,
>


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

2013-03-08 16:04:00

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 3/4][V2] ARM: nomadik: add dynamic irq flag to the timer

On Fri, 8 Mar 2013, Daniel Lezcano wrote:

> > Add the dynamic irq affinity feature to the timer clock device.
> >
> > Signed-off-by: Daniel Lezcano <[email protected]>
> > Reviewed-by: Vincent Guittot <[email protected]>
> > Acked-by: Rickard Andersson <[email protected]>
> > ---
>
> Hi Linus,
>
> AFAIU, you are ok with this patch, Rickard acked it and Vincent reviewed it.
>
> Thomas agreed to merge it into its tree as I requested because we will
> need to wait for your tree to gain visibility to this new flag before
> submitting this patch, which can take awhile.
>
> Could you please ack it if it is ok for you ?

I can provide a for-arm tree to pull as well. Either way fine with me.

Thanks,

tglx

2013-03-11 16:29:32

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 4/4][V2] ARM: timer-sp: Set dynamic irq affinity

On Fri, Mar 08, 2013 at 04:28:55PM +0100, Daniel Lezcano wrote:
> On 03/02/2013 11:10 AM, Daniel Lezcano wrote:
> > From: Viresh Kumar <[email protected]>
> >
> > When a cpu goes to a deep idle state where its local timer is shutdown, it
> > notifies the time frame work to use the broadcast timer instead.
> >
> > Unfortunately, the broadcast device could wake up any CPU, including an idle one
> > which is not concerned by the wake up at all.
> >
> > This implies, in the worst case, an idle CPU will wake up to send an IPI to
> > another idle cpu.
> >
> > This patch fixes this for ARM platforms using timer-sp, by setting
> > CLOCK_EVT_FEAT_DYNIRQ feature.
> >
> > Signed-off-by: Viresh Kumar <[email protected]>
> > Signed-off-by: Daniel Lezcano <[email protected]>
> > ---
>
> Hi Russell,
>
> I asked Thomas if he could take this patch in its tree but it falls
> under your umbrella. Thomas agreed to take it if you ack this patch.
>
> Is this patch acceptable for you ?

It's simple enough.

Acked-by: Russell King <[email protected]>

2013-03-11 21:00:57

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 2/4][V2] time : set broadcast irq affinity

On Friday 08 March 2013, Thomas Gleixner wrote:
> On Fri, 8 Mar 2013, Daniel Lezcano wrote:
> > On 03/06/2013 10:48 AM, Thomas Gleixner wrote:
> > I was wondering if it would be possible to take the 3/4 and 4/4
> > otherwise the flag dependency will prevent to send those to the
> > maintainer's tree until they gain visibility on it.
>
> I can take them with the ack of arm soc folks.

Sounds good,

Acked-by: Arnd Bergmann <[email protected]>

2013-03-12 11:38:16

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 3/4][V2] ARM: nomadik: add dynamic irq flag to the timer

On Fri, Mar 8, 2013 at 4:17 PM, Daniel Lezcano
<[email protected]> wrote:
>> Add the dynamic irq affinity feature to the timer clock device.
>>
>> Signed-off-by: Daniel Lezcano <[email protected]>
>> Reviewed-by: Vincent Guittot <[email protected]>
>> Acked-by: Rickard Andersson <[email protected]>
>> ---
>
> Hi Linus,
>
> AFAIU, you are ok with this patch, Rickard acked it and Vincent reviewed it.
>
> Thomas agreed to merge it into its tree as I requested because we will
> need to wait for your tree to gain visibility to this new flag before
> submitting this patch, which can take awhile.
>
> Could you please ack it if it is ok for you ?

Oh of course!
Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2013-03-19 11:42:37

by Daniel Lezcano

[permalink] [raw]
Subject: Re: [PATCH 3/4][V2] ARM: nomadik: add dynamic irq flag to the timer

On 03/08/2013 05:03 PM, Thomas Gleixner wrote:
> On Fri, 8 Mar 2013, Daniel Lezcano wrote:
>
>>> Add the dynamic irq affinity feature to the timer clock device.
>>>
>>> Signed-off-by: Daniel Lezcano <[email protected]>
>>> Reviewed-by: Vincent Guittot <[email protected]>
>>> Acked-by: Rickard Andersson <[email protected]>
>>> ---
>>
>> Hi Linus,
>>
>> AFAIU, you are ok with this patch, Rickard acked it and Vincent reviewed it.
>>
>> Thomas agreed to merge it into its tree as I requested because we will
>> need to wait for your tree to gain visibility to this new flag before
>> submitting this patch, which can take awhile.
>>
>> Could you please ack it if it is ok for you ?
>
> I can provide a for-arm tree to pull as well. Either way fine with me.

Hi Thomas,

the patch 3/4 and 4/4 have been acked-by the different maintainers.

I saw you created a 'for-arm' branch (thanks), but the patches 3/4 and
4/4 aren't there. Did I missed something ?

Thanks
-- Daniel


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog