Linus,
Please pull the latest timers-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git timers-fixes-for-linus
The patches fix hard to trigger bugs in the CPU offline code of
hrtimers which were noticed by Paul McKenney recently. In the worst
case they can leave migrated hrtimers in a stale state.
Thanks,
tglx
------------------>
Thomas Gleixner (4):
hrtimer: migrate pending list on cpu offline
hrtimer: fix migration of CB_IRQSAFE_NO_SOFTIRQ hrtimers
hrtimer: mark migration state
hrtimer: prevent migration of per CPU hrtimers
include/linux/hrtimer.h | 18 ++++++--
kernel/hrtimer.c | 95 +++++++++++++++++++++++++++++++++++++----
kernel/sched.c | 4 +-
kernel/time/tick-sched.c | 2 +-
kernel/trace/trace_sysprof.c | 2 +-
5 files changed, 103 insertions(+), 18 deletions(-)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6d93dce..2f245fe 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -47,14 +47,22 @@ enum hrtimer_restart {
* HRTIMER_CB_IRQSAFE: Callback may run in hardirq context
* HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and
* does not restart the timer
- * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context
- * Special mode for tick emultation
+ * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context
+ * Special mode for tick emulation and
+ * scheduler timer. Such timers are per
+ * cpu and not allowed to be migrated on
+ * cpu unplug.
+ * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context
+ * with timer->base lock unlocked
+ * used for timers which call wakeup to
+ * avoid lock order problems with rq->lock
*/
enum hrtimer_cb_mode {
HRTIMER_CB_SOFTIRQ,
HRTIMER_CB_IRQSAFE,
...Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> --
Ah, so we found and fixed these ? Linus, those bugs are actually a regression from when we didn't use the new timer code (which isn't that long ago). It would be nice to have the fixes in .27 (and thus in the various distros that will derive from it) but I would understand if the size of the patch made you choke that late in the -rc cycle... In which case we'll be in for more backports :-) Cheers, Ben. --
For "we" == Thomas, yes. ;-) --
One other thing -- these bugs affect x86 as well as Power. Just takes more stress for x86 to see the bugs in some cases. --
Did you forget to push? The tip of that branch is still commit 1eda81495a49a4ee91d8863b0a441a624375efea ("x86: prevent stale state of c1e_mask ...") which I already pulled last week. Linus --
hm, i just re-ran the pushout script - see below.
Ingo
--------->
Linus,
Please pull the latest timers-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git timers-fixes-for-linus
Thanks,
Ingo
------------------>
Thomas Gleixner (4):
hrtimer: migrate pending list on cpu offline
hrtimer: fix migration of CB_IRQSAFE_NO_SOFTIRQ hrtimers
hrtimer: mark migration state
hrtimer: prevent migration of per CPU hrtimers
include/linux/hrtimer.h | 18 ++++++--
kernel/hrtimer.c | 95 +++++++++++++++++++++++++++++++++++++----
kernel/sched.c | 4 +-
kernel/time/tick-sched.c | 2 +-
kernel/trace/trace_sysprof.c | 2 +-
5 files changed, 103 insertions(+), 18 deletions(-)
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 6d93dce..2f245fe 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -47,14 +47,22 @@ enum hrtimer_restart {
* HRTIMER_CB_IRQSAFE: Callback may run in hardirq context
* HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and
* does not restart the timer
- * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context
- * Special mode for tick emultation
+ * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context
+ * Special mode for tick emulation and
+ * scheduler timer. Such timers are per
+ * cpu and not allowed to be migrated on
+ * cpu unplug.
+ * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context
+ * with timer->base lock unlocked
+ * used for timers which call wakeup to
+ * avoid lock order problems with rq->lock
*/
enum hrtimer_cb_mode {
HRTIMER_CB_SOFTIRQ,
HRTIMER_CB_IRQSAFE,
HRTIMER_CB_IRQSAFE_NO_RESTART,
- HRTIMER_CB_IRQSAFE_NO_SOFTIRQ,
+ HRTIMER_CB_IRQSAFE_PERCPU,
+ HRTIMER_CB_IRQSAFE_UNLOCKED,
};
/*
@@ -67,9 +75,10 @@ enum hrtimer_cb_mode {
* 0x02 callback ...