Re: OT: Does Linux have any "Perfect Code"

2007-11-17 Thread Geert Uytterhoeven
On Thu, 15 Nov 2007, Daniel Barkalow wrote: > On Thu, 15 Nov 2007, Michael Gerdau wrote: > > > This code is far to be perfect, some part is outdated, bcopy() use instead > > > of memcpy() for example. More annoying are the comment, the file is 3306 > > > lines while there is only 1640 line of code,

Re: OT: Does Linux have any "Perfect Code"

2007-11-15 Thread Chris Friesen
Michael Gerdau wrote: That having said: I really do like such obvious (as in: for those knowing the stuff anyway) comments when looking at code and probably concepts I'm not familiar with. IMO there is no need to belittle this type of comment. IMO any casual reader not familiar with the whole s

Re: OT: Does Linux have any "Perfect Code"

2007-11-15 Thread Daniel Barkalow
On Thu, 15 Nov 2007, Michael Gerdau wrote: > > This code is far to be perfect, some part is outdated, bcopy() use instead > > of memcpy() for example. More annoying are the comment, the file is 3306 > > lines while there is only 1640 line of code, nothing bad per se but looking > > some comments:

Re: OT: Does Linux have any "Perfect Code"

2007-11-15 Thread Michael Gerdau
> This code is far to be perfect, some part is outdated, bcopy() use instead > of memcpy() for example. More annoying are the comment, the file is 3306 > lines while there is only 1640 line of code, nothing bad per se but looking > some comments: > > /* >* Before we b

Re: OT: Does Linux have any "Perfect Code"

2007-11-15 Thread Andi Kleen
Eric Dumazet <[EMAIL PROTECTED]> writes: > > http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/timers.c#1106 > > I would say this code was OK 10 years ago. I would have expected 1997 compilers to already do these standard muliplication optimizations. > Now that a proces

Re: OT: Does Linux have any "Perfect Code"

2007-11-15 Thread Philippe Elie
On Wed, 14 Nov 2007 at 20:21 +, Russell Leighton wrote: > > Bryan Cantrill of Sun (ala DTrace) has a notion of perfect code: > > http://blogs.sun.com/bmc/entry/on_i_dreaming_in_code > > He also has some examples (from bottom comment section of above): > > > > > > >Can you list a smal

Re: OT: Does Linux have any "Perfect Code"

2007-11-14 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Thu, 15 Nov 2007 07:29:47 +0100 > 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 >

Re: OT: Does Linux have any "Perfect Code"

2007-11-14 Thread Eric Dumazet
Russell Leighton a écrit : Bryan Cantrill of Sun (ala DTrace) has a notion of perfect code: http://blogs.sun.com/bmc/entry/on_i_dreaming_in_code He also has some examples (from bottom comment section of above): Can you list a small number of examples of "software perfection"? Posted b

Re: OT: Does Linux have any "Perfect Code"

2007-11-14 Thread David Miller
From: Russell Leighton <[EMAIL PROTECTED]> Date: Wed, 14 Nov 2007 20:21:04 -0500 > > At the risk of being egocentric, the cyclic subsystem (which is > > executed at least 100 times per second on every Solaris system) > > had its last substantial fix over six years ago, and its last fix > > of any

OT: Does Linux have any "Perfect Code"

2007-11-14 Thread Russell Leighton
Bryan Cantrill of Sun (ala DTrace) has a notion of perfect code: http://blogs.sun.com/bmc/entry/on_i_dreaming_in_code He also has some examples (from bottom comment section of above): Can you list a small number of examples of "software perfection"? Posted by Russell Leighton on No