Thread (10 messages) 10 messages, 4 authors, 2013-09-18
STALE4675d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 1/2] tick: broadcast: Deny per-cpu clockevents from being broadcast sources

From: Soren Brinkmann <hidden>
Date: 2013-09-12 16:51:18
Also in: linux-devicetree, lkml
Subsystem: nohz, dynticks support, the rest · Maintainers: Anna-Maria Behnsen, Frederic Weisbecker, Ingo Molnar, Thomas Gleixner, Linus Torvalds

From: Stephen Boyd <redacted>

On most ARM systems the per-cpu clockevents are truly per-cpu in
the sense that they can't be controlled on any other CPU besides
the CPU that they interrupt. If one of these clockevents were to
become a broadcast source we will run into a lot of trouble
because the broadcast source is enabled on the first CPU to go
into deep idle (if that CPU suffers from FEAT_C3_STOP) and that
could be a different CPU than what the clockevent is interrupting
(or even worse the CPU that the clockevent interrupts could be
offline).

Theoretically it's possible to support per-cpu clockevents as the
broadcast source but so far we haven't needed this and supporting
it is rather complicated. Let's just deny the possibility for now
until this becomes a reality (let's hope it never does!).

Reported-by: S?ren Brinkmann <redacted>
Signed-off-by: Stephen Boyd <redacted>
---
 kernel/time/tick-broadcast.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 218bcb5..d3539e5 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -77,6 +77,9 @@ static bool tick_check_broadcast_device(struct clock_event_device *curdev,
 	    !(newdev->features & CLOCK_EVT_FEAT_ONESHOT))
 		return false;
 
+	if (cpumask_equal(newdev->cpumask, cpumask_of(smp_processor_id())))
+		return false;
+
 	return !curdev || newdev->rating > curdev->rating;
 }
 
-- 
1.8.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help