From: Henry N. <hen...@ar...> - 2010-09-06 20:22:45
|
Hello Ron, CONFIG_HZ=100 is in coLinux Kernel config. This are 10 ms per jiffy. It does not matter, how often or in what time diff the function callback_return_jiffies is called on Windows side. The variable "timestamp_diff" will count the jiffies for the time coLinux was not active. An other time base is a free running 100 ms timer (10Hz) for all coLinux daemons on Windows side. This intervall will wake up any sleeping Windows task for coLinux. So, we can guarantee, that coLinux will running all 100 ms in idle or more often in full running action. Henry On 03.09.2010 10:34, Ron Avriel wrote: > Hi Henry, > > Can you please explain why you multiply by 100 in > > timestamp_diff += 100 * (((long long)timestamp.quad) - ((long > long)cmon->timestamp.quad)); /* HZ value */ > > http://colinux.svn.sourceforge.net/viewvc/colinux/branches/devel/src/colinux/os/winnt/kernel/lowlevel/time.c?view=markup#l31 > > If this function is called every 100ms, as you previously wrote, then > you get 10 jiffies per call. Shouldn't it be 1 jiffy per 100ms? > Shouldn't you multiply by 10 instead? > > I guess your calculation is right, but I can't figure it out. > > Thanks, > Ron > > Date: Fri, 3 Sep 2010 00:42:47 +0200 > From: hen...@ar... > To: ra...@ho... > CC: col...@li... > Subject: Re: [coLinux-users] Very large time offset in coLinux > > Hello Ron, > > we don't use RDTSC directly. We use windows API, and that should work > without problems. KeQueryPerformanceCounter is the only function with > smallest time interval. Of curse I also have seen updates for broken > KeQueryPerformanceCounter: http://support.microsoft.com/kb/896256 > > The problem is not to follow the time. If the timediff is more as one > second, for example if you suspend Windows, then we set the time > absolutely. The problem is, from where we can get the exact time > stamp, if KeQueryPerformanceCounter is wrong? > > Here we have the two calculations. One on Windows side, here we > calculate the difference of "jiffies" in callback_return_jiffies: > http://colinux.svn.sourceforge.net/viewvc/colinux/branches/devel/src/colinux/kernel/monitor.c?view=markup#l366 > > co_os_get_timestamp is here: > http://colinux.svn.sourceforge.net/viewvc/colinux/branches/devel/src/colinux/os/winnt/kernel/lowlevel/time.c?view=markup#l31 > > On Linux side we increment teh jiffies and time here in function > co_handle_jiffies: > http://colinux.svn.sourceforge.net/viewvc/colinux/branches/devel/patch/base-2.6.33.diff?view=markup#l2563 > > I will create more debug for cases of "time warps". > > -- > Henry |