lkml.org 
[lkml]   [2016]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/4] kernel/time/clockevents: compensate for monotonic clock's dynamic frequency
On Mon, 11 Jul 2016, Nicolai Stange wrote:
> > + raw = ((u64)interval >> 32) * raw_mult; /* Upper half of interval */
> > + if (raw >> 32)
> > + return KTIME_MAX;
> > + raw <<= 32;
> > + tmp = ((u64)interval & U32_MAX) * raw_mult; /* Lower half of interval */
> > + if (U64_MAX - raw < tmp)
> > + return KTIME_MAX;
> > + raw += tmp;
> > +
> > + /* Finally, do raw /= mono_mult with proper rounding. */
> > + if (U64_MAX - raw < mono_mult / 2)
> > + return KTIME_MAX;
> > + raw += mono_mult / 2;
> > + do_div(raw, mono_mult);
> > +
> > + return (s64)raw;

That's a complete insanity. No way that we are going to do all this math in
the CE programming path.

If you want to address the issue, then you need to find a way to adjust the
mult/shift factors of the clock event device occasionally.

Thanks,

tglx

\
 
 \ /
  Last update: 2016-07-11 11:21    [W:0.071 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site