lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 0/4] Add support for S3 non-stop TSC support.
On 03/05/2013 12:32 PM, Jason Gunthorpe wrote:
> On Tue, Mar 05, 2013 at 11:53:02AM +0800, Feng Tang wrote:
>
>>> // Drops some small precision along the way but is simple..
>>> static inline u64 cyclecounter_cyc2ns_128(const struct cyclecounter *cc,
>>> cycle_t cycles)
>>> {
>>> u64 max = U64_MAX/cc->mult;
>>> u64 num = cycles/max;
>>> u64 result = num * ((max * cc->mult) >> cc->shift);
>>> return result + cyclecounter_cyc2ns(cc, cycles - num*cc->mult);
>>> }
>> Your way is surely more accurate, if maintainers are ok with adding
>> the new API, I will use it.
> Okay, give it a good look though, I only wrote it out in email, never
> tested it :)
>
Probably want to use clocksource instead of cyclecounter, but I think
Jason's approach sounds ok. I might suggest that you initially make the
function static to the timekeeping code, just so we don't get unexpected
users.

thanks
-john


\
 
 \ /
  Last update: 2013-03-05 07:41    [W:0.045 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site