[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200707201714.16811.ak@suse.de>
Date: Fri, 20 Jul 2007 17:14:16 +0200
From: Andi Kleen <ak@...e.de>
To: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
Cc: patches@...-64.org, linux-kernel@...r.kernel.org,
Daniel Walker <dwalker@...sta.com>
Subject: Re: [PATCH] [15/58] i386: Rewrite sched_clock
> So if, after this, we run tsc_sched_clock() with an unstable TSC, we
> read a last_val containing the interrupt's MSB and the last_val LSB. It
> can particularity hurt if we are around a 32 bits overflow, because time
> could "jump" forward of about 1.43 seconds on a 3 GHz system.
>
> So I guess we need synchronization on the fast path, and therefore using
> cmpxchg_local on x86_64
On x86-64 the 64bit write is atomic against interrupts.
You're right 32bit has a problem though. I'm not too happy about
cmpxchg though because that wouldn't work on some CPUs.
I wonder if we can just get away with using a 32bit value on i386.
Just for the purpose of keeping the value monotonic it should be good
enough. Will think about it.
Thanks for the review.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists