[GIT pull] timer fixes for .27

Previous thread: [patch 1/2] revert: x86: move prefill_possible_map calling early, fix by Chuck Ebbert on Monday, September 29, 2008 - 6:27 pm. (3 messages)

Next thread: Linux 2.6.27-rc8 by Linus Torvalds on Monday, September 29, 2008 - 6:39 pm. (40 messages)
To: Linus Torvalds <torvalds@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Paul E. McKenney <paulmck@...>
Date: Monday, September 29, 2008 - 6:15 pm

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,
HRTIMER_CB_IRQSAFE_NO_RESTART,
- HRTIMER_CB_IRQSAFE_NO_SOFTIRQ,
+ HRTIMER_CB_IRQSAFE_PE...

To: Thomas Gleixner <tglx@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>, Paul E. McKenney <paulmck@...>
Date: Tuesday, September 30, 2008 - 10:34 am

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
--

To: Linus Torvalds <torvalds@...>
Cc: Thomas Gleixner <tglx@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Paul E. McKenney <paulmck@...>
Date: Tuesday, September 30, 2008 - 11:16 am

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 callbac...

To: Thomas Gleixner <tglx@...>
Cc: Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Monday, September 29, 2008 - 6:44 pm

Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
--

To: <paulmck@...>
Cc: Thomas Gleixner <tglx@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Monday, September 29, 2008 - 11:41 pm

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.

--

To: Benjamin Herrenschmidt <benh@...>
Cc: Thomas Gleixner <tglx@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Monday, September 29, 2008 - 11:54 pm

For "we" == Thomas, yes. ;-)

--

To: Benjamin Herrenschmidt <benh@...>
Cc: Thomas Gleixner <tglx@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Tuesday, September 30, 2008 - 12:02 am

One other thing -- these bugs affect x86 as well as Power. Just takes
more stress for x86 to see the bugs in some cases.

--

Previous thread: [patch 1/2] revert: x86: move prefill_possible_map calling early, fix by Chuck Ebbert on Monday, September 29, 2008 - 6:27 pm. (3 messages)

Next thread: Linux 2.6.27-rc8 by Linus Torvalds on Monday, September 29, 2008 - 6:39 pm. (40 messages)