Re: [RFC v2][PATCH 7/9] Infrastructure for shared objects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-08-21 at 12:40 +0200, Louis Rilling wrote:
> 
> > +struct cr_objhash {
> > +     struct cr_obj **hash;
> > +     int next_tag;
> > +};
> > +
> > +#define CR_OBJHASH_NBITS  10 /* 10 bits = 1K buckets */
> > +#define CR_OBJHASH_ORDER  0  /* 1K buckets * 4 bytes/bucket = 1
> page */
> 
> Only true when PAGE_SIZE == 4K and in 32bits. Perhaps like below?
> 
> #define CR_OBJHASH_BUCKET_NBITS (BITS_PER_LONG == 64 ? 3 : 2)
> #define CR_MIN_OBJHASH_NBITS ((PAGE_SHIFT - CR_OBJHASH_BUCKET_NBITS)
> #define CR_OBJHASH_NBITS (CR_MIN_OBJHASH_NBITS >= 10 ?
> CR_MIN_OBJHASH_NBITS : 10)
> #define CR_OBJHASH_ORDER (CR_OBJHASH_NBITS + CR_OBJHASH_BUCKET_NBITS -
> PAGE_SHIFT)

Gah.  Can't we just use the existing radix tree or hash implementations
we already have?

-- Dave

_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux