Re: [PATCH] perf: Store active software events in a hashlist

From: Frederic Weisbecker
Date: Wed Apr 07 2010 - 08:09:30 EST


On Wed, Apr 07, 2010 at 01:56:45PM +0200, Peter Zijlstra wrote:
> On Wed, 2010-04-07 at 13:52 +0200, Frederic Weisbecker wrote:
> > On Wed, Apr 07, 2010 at 11:02:26AM +0200, Peter Zijlstra wrote:
> > > On Mon, 2010-04-05 at 16:08 +0200, Frederic Weisbecker wrote:
> > > > +#define SWEVENT_HLIST_BITS 8
> > > > +#define SWEVENT_HLIST_SIZE ((1 << (SWEVENT_HLIST_BITS + 1)) - 1)
> > >
> > > That seems to result in 9 bits worth, doesn't it?
> >
> >
> > Oh right, I was confused, will zapp the + 1.
> >
>
> Also, what you're computing seems to be a mask, not a size
>
> So with BITS = 8, you want
> SIZE = 1<<BITS = 256
> MASK = SIZE-1 = 255
>
> right?


Oh right... damn I suck in maths...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/