Messages in this thread | | | Date | Mon, 6 Jul 2009 16:15:35 +0200 | From | Martin Schwidefsky <> | Subject | Re: [PATCH] optimized ktime_get[_ts] for GENERIC_TIME=y |
| |
On Mon, 06 Jul 2009 16:07:22 +0200 Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > diff -urpN linux-2.5/kernel/time/timekeeping.c linux-2.5-patched/kernel/time/timekeeping.c > > --- linux-2.5/kernel/time/timekeeping.c 2009-07-03 10:46:07.000000000 +0200 > > +++ linux-2.5-patched/kernel/time/timekeeping.c 2009-07-03 10:46:23.000000000 +0200 > > @@ -118,6 +118,69 @@ void getnstimeofday(struct timespec *ts) > > > > EXPORT_SYMBOL(getnstimeofday); > > > > +ktime_t ktime_get(void) > > +{ > > + cycle_t cycle_now, cycle_delta; > > + struct timespec time; > > + unsigned long seq; > > + s64 nsecs; > > + > > + do { > > + seq = read_seqbegin(&xtime_lock); > > minor nit : read_seqbegin() returns an "unsigned int", not an "unsigned long"
Hmm, just cut-copy-pasted the seq-loop. Seems like a job for the janitor .. But I will update my patch.
-- blue skies, Martin.
"Reality continues to ruin my life." - Calvin.
| |