[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1231322037.11687.178.camel@twins>
Date: Wed, 07 Jan 2009 10:53:57 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Robin Holt <holt@....com>
Cc: Nick Piggin <npiggin@...e.de>, "Luck, Tony" <tony.luck@...el.com>,
Dimitri Sivanich <sivanich@....com>,
"linux-ia64@...r.kernel.org" <linux-ia64@...r.kernel.org>,
Greg KH <greg@...ah.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Gregory Haskins <ghaskins@...ell.com>,
Tony Luck <tony.luck@...il.com>
Subject: Re: [PATCH] configure HAVE_UNSTABLE_SCHED_CLOCK for SGI_SN systems
On Wed, 2009-01-07 at 03:43 -0600, Robin Holt wrote:
> On Wed, Jan 07, 2009 at 08:28:09AM +0100, Peter Zijlstra wrote:
> > That's basically what the HAVE_UNSTABLE_SCHED_CLOCK code does. It takes
> > a tick timestamp and tries to improve on that by using strict per cpu
> > sched_clock() deltas.
> >
> > What we do to obtain remote time, is basically calculate local time and
> > pull remote time fwd if that was behind.
>
> But what happens when the remote clock then takes a single tick and
> pulls forward a different remote clock by both your tick and its tick.
> Multiply that by 4096 and I am starting to feel that time is likely to
> go racing forward in a really random fashion.
I'm having trouble parsing that...
Clock state is kept per-cpu, and locked with a spinlock. When we request
a remote time-stamp we lock both our local and the remote clock state,
compute our local time, and set both the remote and local clock to the
max of local,remote clock.
An interrupt on the remote cpu will spin for its clock state lock before
doing anything - also, the tick interrupt will never bother with remote
clock state.
So I'm not exactly seeing what could go wrong here.
Please read kernel/sched_clock.c, its only 266 lines and could use an
extra eyeball, I'd be glad to answer any questions.
--
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