Re: [PATCH] long format VHPT

Peter Chubb
2003-10-02T01:51:35Z

Aurn> Darren Williams wrote:
>
> -#define ia64_rid(ctx,addr) (((ctx) << 3) | (addr >> 61))
> +#ifdef CONFIG_IA64_LONG_FORMAT_VHPT
> +#define redistribute_rid(rid) (((rid) & ~0xffff) | (((rid) << 8) & 0xff00) | (((rid) >> 8) & 0xff))
> +#else
> +#define redistribute_rid(rid) (rid)
> +#endif
> +#define ia64_rid(ctx,addr) redistribute_rid(((ctx) << 3) | (addr >> 61))
>

Arun> Hi Darren, Can you explain what this code is trying to do ?

If I may comment....

The hash function that the VHPT uses works poorly for consecutive
RIDs. The redistribute_rid() macro flips around the low order bits to
get something that hashes more evenly -- otherwise in the experiments
we did, we saw major hash collision problems.

I've cc'd Matthew, the original author of the code, to clarify if necessary.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
You are lost in a maze of BitKeeper repositories, all slightly different.