From: Henry N. <hen...@ar...> - 2008-09-09 20:09:23
|
Hello Harald, Harald Weidner wrote: >> http://www.henrynestler.com/colinux/autobuild/devel-20080907/ >> > [...] > >> Add sysenter / sysexit restoration support >> > [...] > >> If host CPU supports sysenter (SEP), then coLinux kernel will use >> sysenter now. Sysenter is faster as the old Int 0x80. >> > > I updated from Build 20080823 to 20080907 and expected coLinux to > become faster. However, the opposite seems true. > > My standard "benchmark" is a compile run of the plain Linux kernel > 2.6.18, doing "make clean; make defconfig; time make all". I issued > three runs each. Here are the results (real/user/sys min:sec): > > coLinux Snapshot 20080823 > 1. 6:17 / 4:25 / 1:51 > 2. 6:15 / 4:28 / 1:49 > 3. 6:14 / 4:26 / 1:45 > > coLinux Snapshot 20080907 > 1. 6:30 / 4:26 / 2:03 > 2. 6:32 / 4:26 / 2:04 > 3. 6:30 / 4:28 / 2:01 > > Building the Linux kernel is mainly a CPU and memory intensive task; > however, there are also many small files created and removed, which > invokes syscalls. > > The host machine has an Intel Core2 Duo 6400 processor at 2.13 GHz > and 2 GB of RAM, running an (otherwise unloaded) Windows XP Professional > SP 3. coLinux has 512 MB of memory and runs Debian 4.0r4 with the > kernel shipped with coLinux. > > I have seen also such effects. After coLinux boots up: 3x build OpenVPN, every with unpacking source, configure and make. Version 0.8.0-20080823: 51.911s / 26.770s / 12.160s 29.330s / 16.470s / 11.380s 29.290s / 15.040s / 12.890s Version 0.8.0-20080907: 37.811s / 14.900s / 10.600s (Faster from Windows file cache after coLinux reboot) 29.460s / 16.240s / 12.030s (+0.4%) 29.580s / 16.520s / 11.740s (+1%) ( real / user / sys ) In vanilla Linux sysenter should run faster as Int80. But, nobody says how mutch faster. CoLinux needs to save and restore 3 more special registers now. This are 3*RDMSR + 3*WRMSR on every operating system switch, typically hardware interrupts for harddisk and timer, and for memory allocation or free. This cost also some time. I don't know how many. The counts of switching can read from /proc/colinx/stats (stats_clear clears the counters after read). I assume, that the time we got from sysenter, will lose on OS switch now. Currently I'm not sure, is the distribution using sysenter? I only know, that the sysenter exist from kernel. I have tested with [1]. I have not idea how can check, that glibc or the elf-loader use the sysenter. For example a staticly linked old program will use Int 0x80. Someone found, that syscalls on Pentium 4 are slower as Pentium III [2,3]. In [4] is a good summary about sysenter inside Linux kernel. [1] http://www.trilithium.com/johan/2005/08/linux-gate/ [2] http://kerneltrap.org/node/531 [3] http://marc.info/?l=linux-kernel&m=103942289025149&w=2 [4] http://manugarg.googlepages.com/systemcallinlinux2_6.html -- Henry N. |