Re: [KVM timekeeping 17/35] Implement getnsboottime kernel API

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Zachary Amsden
Date: Friday, August 27, 2010 - 4:48 pm

On 08/27/2010 08:05 AM, Jan Kiszka wrote:

Yes, we should probably change the name before making this an actual 
kernel API, John made some better suggestions.

For kvm-kmod, the following conversion should work:

static inline u64 get_kernel_ns(void)
{
     struct timespec ts;

     WARN_ON(preemptible());
     ktime_get_ts(&ts);
     monotonic_to_bootbased(&ts);
     return timespec_to_ns(&ts);
}

The only real point to getnsboottime is to stop the unnecessary 
conversions, but looking at it now, it doesn't appear to actually save 
any, does it?  Maybe it is better to just drop the thing all-together.

Zach
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[KVM timekeeping 17/35] Implement getnsboottime kernel API, Zachary Amsden, (Fri Aug 20, 1:07 am)
Re: [KVM timekeeping 17/35] Implement getnsboottime kernel API, Zachary Amsden, (Fri Aug 27, 4:48 pm)