On Friday 29 September 2006 15:43, John Zavgren wrote: > Greetings: > > I have a very unusual situation. I am simulating wireless networks by > using a User Mode Linux -based testbed. There are two factors that are > challenging: 1.) the networks can be large; 2.) in some circumstances, > I need very accurate time resolution, because I may be simulating MAC > layer protocols, which need sub-microsecond accuracy. > > The first factor can cause excessive loading on the host that hosts the > UML instances. > The second factor seems to be beyond the capabilities of the native > Linux time management system, which counts clock ticks, that arrive (at > the least) every millisecond. When one accounts for schedule slippage, > one microsecond scheduling is probably pollyannishly unrealistic. Hmm, HRT (HighResolutionTimers) exist for that, even if I doubt you can use them (no HRT implementation for UML exists or is planned).
> My approach has been to slow down time on the UML instances so their > clocks advance at a rate that is slower than the clock rate of the host > Linux machine. I have done this by modifying the do_timer() routine so > that it increments the jiffy counter modulo some integer. If this > integer is set to, say, 10, then the time keeping mechanism of the give > UML instance will run at 10% of the normal rate. > So, how does one disable this cheating? I've followed sys_gettimeofday up to arch/um/os-Linux/time.c:os_nsecs, where the call to gettimeofday is done. You must also record the startup moment and use it - the virtual and the real timelines should likely match at that moment, so you should return (at a first look) 10 * (current_time-boot_time ) + boot_time. -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ User-mode-linux-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
