lkml.org 
[lkml]   [2008]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: VolanoMark regression with 2.6.27-rc1
Date
On Thursday 21 August 2008 00:33, Peter Zijlstra wrote:
> On Wed, 2008-08-20 at 18:32 +0400, adobriyan@gmail.com wrote:
> > On Wed, Aug 20, 2008 at 03:32:17PM +0200, Peter Zijlstra wrote:

> > > +#define avg(x, y) ({ \
> > > + typeof(x) _avg1 = ((x)+1)/2; \
> > > + typeof(x) _avg2 = ((y)+1)/2; \
> >
> > ITYM, typeof(y)
>
> you thought right, I did mean that :-)
>
> > > + (void) (&_avg1 == &_avg2); \
> > > + _avg1 + _avg2; })

I don't think this implementation of avg should go in kernel.h?

It gives an average of 1 and 1 to be 2, 3 and 3 is 4, 1 and 3 is
3 etc.

Maybe it is reasonable for very high numbers that would overflow
if added first, but it doesn't seem reasonable for a generic
averaging function.


\
 
 \ /
  Last update: 2008-08-20 17:13    [W:0.113 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site