LWN: Comments on "Virtual time" https://lwn.net/Articles/180375/ This is a special feed containing comments posted to the individual LWN article titled "Virtual time". en-us Fri, 17 Oct 2025 22:26:34 +0000 Fri, 17 Oct 2025 22:26:34 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Virtual time https://lwn.net/Articles/181211/ https://lwn.net/Articles/181211/ pm101 From the other side of the equation, I would like to use this for avoiding timeouts. Quite a few applications time out after some time. I've even had free software applications tell me "You're running a version of XXXX, please upgrade." I've also had restricted materials time-out (in one case, a class distributed an educational application that stopped working when the semester ended). Bypassing these seems like a good and noble endeavor. <br> Tue, 25 Apr 2006 02:14:10 +0000 gettimeofday() --- Move the system call into userspace https://lwn.net/Articles/181025/ https://lwn.net/Articles/181025/ Blaisorblade That's indeed implement since some time (guess in the 2.5 era) in arch/x86_64/kernel/vsyscall.c, together with the time syscall and two empty slots.<br> Sat, 22 Apr 2006 08:33:06 +0000 Virtual time https://lwn.net/Articles/181020/ https://lwn.net/Articles/181020/ skybrian There's actually a good reason for "messing deeply with their idea of time": testing applications that use timeouts and schedulers. For example, suppose you want to see what happens after a month's worth of nightly batch processes have happened. It's useful to be able to speed up time so it doesn't actually take a month to run the test.<br> <p> There are many ways to do this, but running software in fast-forward would be a useful tool in the application developer's toolkit.<br> <p> Sat, 22 Apr 2006 05:22:04 +0000 gettimeofday() --- Move the system call into userspace https://lwn.net/Articles/180960/ https://lwn.net/Articles/180960/ AnswerGuy <p> One novel approach to speeding up gettimeofday that I heard about a few<br> years ago (from Andrew Tridgell who implemented it on a different OS<br> and architecture) was to get ride of the gettimeofday() system call<br> entirely. <br> <p> One model for doing this would be to use a read-only globally shared page which contained the current time (and things like the uname() struct pathconf() and sysconf() and whatever else will fit in one or two pages).<br> <p> These pages are mapped into every process' address space (similar to how VDSO's are mapping a kernel hosted userspace threading library implementation --- but read-only rather than executable). Then the gettimeofday() and uname() and a few other system calls can be implemented in user space by he libraries without including any context switch overhead.<br> <p> (Realistically you'd leave the system calls in for compatability but offer<br> a faster more lightweight method as described; perhaps adding printk() options to help identify those apps which were using the slower, heavyweight system call method).<br> <p> One thing that's easy to misunderstand about UNIX is that the distinction between system call and library function can (from some perspective) be a bit arbitrary. Classically a system call is any function which interfaces to kernel space while library functions can be wrapped around system calls but are generally done entirely within a process' own address space (in user space). However, with some of the memory mapping tricks (and memory mapped I/O hardware features) it's possible for many operations that would conception involve system calls to be implemented as library functions with suitable memory mappings.<br> <p> This is not to say that such memory mappings are "better" than system calls in the general case. However, for some things like gettimeofday() and uname() there is a pretty clear win on (almost?) any modern virtual memory architecture.<br> <p> JimD<br> <p> Fri, 21 Apr 2006 16:37:23 +0000