On 09/01/2007 06:07 AM, Andi Kleen wrote:I did find this after some digging: In the vdso code: static inline long vgetns(void) { cycles_t (*vread)(void); vread = gtod->clock.vread; return ((vread() - gtod->clock.cycle_last) * gtod->clock.mult) >> gtod->clock.shift; } Looks like an open-coded version of this in the kernel timekeeping code: static inline s64 __get_nsec_offset(void) { cycle_t cycle_now, cycle_delta; s64 ns_offset; /* read clocksource: */ cycle_now = clocksource_read(clock); /* calculate the delta since the last update_wall_time: */ cycle_delta = (cycle_now - clock->cycle_last) & clock->mask; /* convert to nanoseconds: */ ns_offset = cyc2ns(clock, cycle_delta); return ns_offset; } But the vdso version isn't doing any masking. And the mask is different for different clocksources, so it has to track the underlying kernel's clocksource when it gets changed. -
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Linus Torvalds | Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.. |
| Paul Jackson | Re: cpuset-remove-sched-domain-hooks-from-cpusets |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Linus Torvalds | Re: [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [klibc] [patch] import socket defines |
