put back in the shift, don't use the bottom bits for hashing
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Sep 1993 09:03:17 +0000 (01:03 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 24 Sep 1993 09:03:17 +0000 (01:03 -0800)
SCCS-vsn: sys/kern/kern_synch.c 8.5

usr/src/sys/kern/kern_synch.c

index f0f2cc9..2af5f9a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_synch.c        8.4 (Berkeley) %G%
+ *     @(#)kern_synch.c        8.5 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -213,8 +213,13 @@ updatepri(p)
        resetpriority(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;
 struct slpque {
        struct proc *sq_head;
        struct proc **sq_tailp;