Russell Leighton a écrit :I dont know, (what a strange idea is it anyway ?) but reading two Solaris functions just gave me the example of non true software perfection. http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/timers.c#1... I would say this code was OK 10 years ago. Now that a processor (say an Opteron in 64 bits mode, used on SUN hardware), can perform a multiply in few cycles, ts2hrt() could use a normal multiply and an addition. Processors are improving, compilers are improving, memory sizes are increasing, source code (and algorithms) should be changed accordingly. (gcc for example already knows the reciprocal division trick and so can compile this : hrt2ts_div(hrtime_t hrt, timestruc_t *tsp) { tsp->tv_nsec = do_div(hrt, NANOSEC); tsp->tv_sec = hrt; } to : movq %rdi, %rdx movabsq $19342813113834067, %rax shrq $9, %rdx mulq %rdx shrq $11, %rdx imulq $1000000000, %rdx, %rax movq %rdx, (%rsi) subq %rax, %rdi movl %edi, 8(%rsi) while hrtime_t ts2hrt(const timestruc_t *tsp) { return tsp->tv_sec * NANOSEC + tsp->tv_nsec; } can be inlined as it is trivial (and much faster than Solaris version) movq (%rdi), %rdx mov 8(%rdi), %eax imulq $1000000000, %rdx, %rdx addq %rdx, %rax -
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
| Greg Kroah-Hartman | [PATCH 022/196] adb: Convert from class_device to device |
git: | |
| Jakub Narebski | Re: VCS comparison table |
| Mark Levedahl | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Matthieu Moy | git push to a non-bare repository |
| Jon Smirl | Re: Calculating tree nodes |
| Marco Peereboom | Re: Real men don't attack straw men |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Tony Abernethy | Re: What is our ultimate goal?? |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Andy Grover | [PATCH] RDS: Add AF and PF defines for RDS sockets |
| David Miller | Re: [PATCH] inet6: Fix paramater issue of inet6_csk_xmit |
