From 4a7bc13806d6f8ec77830807f57a64d6834d5f0b Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Fri, 24 Sep 1993 01:03:17 -0800 Subject: [PATCH] put back in the shift, don't use the bottom bits for hashing SCCS-vsn: sys/kern/kern_synch.c 8.5 --- usr/src/sys/kern/kern_synch.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/usr/src/sys/kern/kern_synch.c b/usr/src/sys/kern/kern_synch.c index f0f2cc9950..2af5f9a0ac 100644 --- a/usr/src/sys/kern/kern_synch.c +++ b/usr/src/sys/kern/kern_synch.c @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)kern_synch.c 8.4 (Berkeley) %G% + * @(#)kern_synch.c 8.5 (Berkeley) %G% */ #include @@ -213,8 +213,13 @@ updatepri(p) resetpriority(p); } -#define TABLESIZE 64 /* Must be power of 2. */ -#define LOOKUP(x) ((int)x & (TABLESIZE - 1)) +/* + * We're only looking at 7 bits of the address; everything is + * aligned to 4, lots of things are aligned to greater powers + * of 2. Shift right by 8, i.e. drop the bottom 256 worth. + */ +#define TABLESIZE 128 +#define LOOKUP(x) (((int)(x) >> 8) & (TABLESIZE - 1)) struct slpque { struct proc *sq_head; struct proc **sq_tailp; -- 2.20.1