Re: [PATCH] simplify update_times (avoid jiffies/jiffies_64aliasing problem)

From: Atsushi Nemoto
Date: Fri Mar 03 2006 - 11:29:34 EST


akpm> I'm not sure how to resolve this, really. Worried. Have you
akpm> socialised those changes with architecture maintainers? If so,
akpm> what was the feedback?

For a short term fix, barrier() might be a safe option.


Add an optimization barrier to prevent prefetching jiffies before
incrementing jiffies_64.

Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>

diff --git a/kernel/timer.c b/kernel/timer.c
index fc6646f..fdd12a5 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -925,6 +925,7 @@ static inline void update_times(void)
void do_timer(struct pt_regs *regs)
{
jiffies_64++;
+ barrier();
update_times();
softlockup_tick(regs);
}
-
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/