[PATCH 02/18] provide xtime_update() which does not require holding xtime_lock like do_timer()

From: Torben Hohn
Date: Fri Jan 21 2011 - 18:08:55 EST


some arch code failed to lock the xtime_lock.
and some code looks like its using the xtime_lock to protect
other stuff.

this prepares the cleanup of this code.

Signed-off-by: Torben Hohn <torbenh@xxxxxx>
---
include/linux/sched.h | 1 +
kernel/time/timekeeping.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index d747f94..9d9a078 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2050,6 +2050,7 @@ extern void release_uids(struct user_namespace *ns);
#include <asm/current.h>

extern void do_timer(unsigned long ticks);
+extern void xtime_update(unsigned long ticks);

extern int wake_up_state(struct task_struct *tsk, unsigned int state);
extern int wake_up_process(struct task_struct *tsk);
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 546d82f..2deef94 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -958,3 +958,12 @@ void do_timer(unsigned long ticks)
update_wall_time();
calc_global_load(ticks);
}
+
+/* xtime_update - updates the timer infrastructure.
+ */
+void xtime_update(unsigned long ticks)
+{
+ write_seqlock(&xtime_lock);
+ do_timer(ticks);
+ write_sequnlock(&xtime_lock);
+}
--
1.7.2.3

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