On Wed, Aug 08, 2012 at 05:52:57PM -0700, Leo Alterman wrote: > 64-bit glibc appears to avoid syscalls for clock_gettime(), so we can get > higher resolution timing and avoid having a timer firing off SIGALRM > without introducing extra overhead. > > Signed-off-by: Leo Alterman <lalter...@nicira.com>
"git am" reported some trailing whitespace: Applying: timeval: On Linux x86-64 systems refresh time whenever it is requested. /home/blp/nicira/ovs/.git/rebase-apply/patch:108: trailing whitespace. * /home/blp/nicira/ovs/.git/rebase-apply/patch:112: trailing whitespace. * /home/blp/nicira/ovs/.git/rebase-apply/patch:121: trailing whitespace. > +/* On Linux x86-64 systems, glibc avoids using syscalls for clock_gettime(). I don't think that this is a feature of glibc. I think that it is a feature of the kernel system call interface, which includes a stub that implements clock_gettime() without doing a user-to-supervisor ring transition and thereby avoids most of the normal system call overhead. > +#if defined __LP64__ && defined __linux__ > +#define CACHE_TIME 0 > +#else > +#define CACHE_TIME 1 > +#endif I think that __LP64__ is meant to indicate that the system has "long" and pointer types that are 64-bits wide. (But I can't find it in the usually comprehensive listing at predef.sf.net.) I think it would be better to test for __x86_64__ instead. In test-timeval.c please add {} around the conditional statements. Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev