lkml.org 
[lkml]   [2014]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 54/55] timekeeping: Provide fast and NMI safe access to CLOCK_MONOTONIC[_RAW]
On Fri, 11 Jul 2014, Mathieu Desnoyers wrote:

> ----- Original Message -----
> > From: "Thomas Gleixner" <tglx@linutronix.de>
> > To: "LKML" <linux-kernel@vger.kernel.org>
> > Cc: "John Stultz" <john.stultz@linaro.org>, "Peter Zijlstra" <peterz@infradead.org>, "Steven Rostedt"
> > <rostedt@goodmis.org>, "Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>
> > Sent: Friday, July 11, 2014 9:45:19 AM
> > Subject: [patch 54/55] timekeeping: Provide fast and NMI safe access to CLOCK_MONOTONIC[_RAW]
> > On the update side:
> >
> > tkf->seq++;
> > smp_wmb();
> > update(tkf->base[0], tk;
>
> missing ")"

:)

> Any reason why the updater wouldn't do:
>
> tkf->seq++;
> smp_wmb();
> update(tkf->base[1 - (tkf->seq & 0x01)], tk);
>
> instead of updating both array entries each time ?

base[0]; <- Current active
seq++; -> Makes base[1] the active one for readers
update(base[0]);

So readers are always one update cycle behind. Probably not an issue
most of the time, but think about fast wrapping clocksources and
NOHZ....

Thanks,

tglx




\
 
 \ /
  Last update: 2014-07-12 10:41    [W:0.633 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site