On Thu, Jan 02, 2014 at 05:08:07PM +0100, Peter Lieven wrote: > > Not using irq disable/enable pairs. The subtraction is not dependant on > > any particular time. > > > > local_irq_disable(); > > now_ns = get_kernel_ns(); > > local_irq_enable(); > > delta = user_ns.clock - now_ns; > > > > Any interrupt that would affect the value of get_kernel_ns(), would > > have a similar effect before the interrupts are disabled. So the > > disable/enable pair achieves nothing in practice. It was copied from > > kvm_guest_time_update. > > > > > > Thanks for clarifying. What about get_kernel_ns() can't this be interrupted? > > Peter
It can handle interrupts. Disabling interrupts there is used when a {rdtsc, system_time=get_kernel_ns()} tuple is wanted, to reduce the physical time difference between execution of rdtsc and get_kernel_ns(). -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html