[PATCH 2/2] timer: use local_bh_enable_force_wake() indel_timer_sync()

From: Yong Zhang
Date: Tue Feb 08 2011 - 07:14:28 EST


From: Yong Zhang <yong.zhang0@xxxxxxxxx>
Subject: [PATCH 2/2] timer: use local_bh_enable_force_wake() in del_timer_sync()

raw_local_irq_save()/raw_local_irq_restore() is also not suitable
here because lockdep will report "possible reason: unannotated irqs-off"

To cure this issue, use local_bh_enable_force_wake() here in case of
we have pending softirq left during this time.

Reported-by: Borislav Petkov <bp@xxxxxxxxx>
Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
---
kernel/timer.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index d53ce66..1654dc1 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -969,14 +969,10 @@ EXPORT_SYMBOL(try_to_del_timer_sync);
int del_timer_sync(struct timer_list *timer)
{
#ifdef CONFIG_LOCKDEP
- unsigned long flags;
-
- raw_local_irq_save(flags);
local_bh_disable();
lock_map_acquire(&timer->lockdep_map);
lock_map_release(&timer->lockdep_map);
- _local_bh_enable();
- raw_local_irq_restore(flags);
+ local_bh_enable_force_wake();
#endif
/*
* don't use it in hardirq context, because it
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/