time: dynamic irq affinity
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 12 repliesIn review
- v14 patches 18 repliesSuperseded
Changes in v2 from the cover letter
* 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
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | time : pass broadcast parameterkernel/ | +5 | 0 replies | |
| 2/4 | time : set broadcast irq affinityinclude/ kernel/ | +38 | 7 replies | |
| 3/4 | ARM: nomadik: add dynamic irq flag to the timerdrivers/ | +2 | 0 replies | |
| 3/4 | ARM: nomadik: add dynamic irq flag to the timer | +0 | 3 replies | |
| 4/4 | ARM: timer-sp: Set dynamic irq affinityarch/ | +2 | 2 replies |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Vincent Guittot | Rickard Andersson | Russell King | Arnd Bergmann | Linus Walleij |
|---|---|---|---|---|---|
| 1/4 | |||||
| 2/4 | A-b | ||||
| 3/4 | R-b | A-b | A-b | ||
| 3/4 | R-b | A-b | A-b | ||
| 4/4 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [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(-)
Signature · 1 line
1.7.9.5