Messages in this thread | | | Date | Fri, 29 Oct 1999 18:32:34 +0200 (CEST) | From | Andrea Arcangeli <> | Subject | questions about new buffer hash |
| |
The 2.2.14pre[12] kernels merges the new buffer hashtable from David.
@@ -420,8 +421,13 @@ } } -#define _hashfn(dev,block) (((unsigned)(HASHDEV(dev)^block)) & bh_hash_mask) -#define hash(dev,block) hash_table[_hashfn(dev,block)] +/* After several hours of tedious analysis, the following hash + * function won. Do not mess with it... -DaveM + */ +#define _hashfn(dev,block) \ + ((((dev)<<(bh_hash_shift - 6)) ^ ((dev)<<(bh_hash_shift - 9))) ^ \ + (((block)<<(bh_hash_shift - 6)) ^ ((block) >> 13) ^ ((block) << (bh_hash_shift - 12)))) +#define hash(dev,block) hash_table[_hashfn(dev,block) & bh_hash_mask] static inline void remove_from_hash_queue(struct buffer_head * bh) {
As you mention "tedious analysis", would it be possible to see it?
Andrea
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |