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 -
| Andreas Gruenbacher | Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching |
| Alan Cox | Re: [patch 7/8] fdmap v2 - implement sys_socket2 |
| Jens Axboe | Re: regression: CD burning (k3b) went broke |
| Paul E. McKenney | Re: [PATCH 0/24] make atomic_read() behave consistently across all architectures |
git: | |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| David Miller | [GIT]: Networking |
| Alexey Dobriyan | [PATCH 09/33] netns ct: per-netns /proc/net/nf_conntrack, /proc/net/stat/nf_conntr... |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
