summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2003-06-21 21:01:44 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2003-06-21 21:01:44 +0000
commit98530110a271da127c47b259168c17c48d412e0f (patch)
tree59b692dafbfa68af9c3758e4f7b3ec4561233d37
parentf1fe8d5bac537156cf752848a7917dd027dbd842 (diff)
Notes
-rw-r--r--sys/nfsserver/nfs_serv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index ae3f944ca666..9384016d5947 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -109,7 +109,7 @@ __FBSDID("$FreeBSD$");
#define MAX_COMMIT_COUNT (1024 * 1024)
-#define NUM_HEURISTIC 64
+#define NUM_HEURISTIC 1017
#define NHUSE_INIT 64
#define NHUSE_INC 16
#define NHUSE_MAX 2048
@@ -819,13 +819,13 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
{
int hi;
- int try = 4;
+ int try = 32;
/*
* Locate best candidate
*/
- hi = ((int)(vm_offset_t)vp / sizeof(struct vnode)) & (NUM_HEURISTIC - 1);
+ hi = ((int)(vm_offset_t)vp / sizeof(struct vnode)) % NUM_HEURISTIC;
nh = &nfsheur[hi];
while (try--) {
@@ -835,7 +835,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
}
if (nfsheur[hi].nh_use > 0)
--nfsheur[hi].nh_use;
- hi = (hi + 1) & (NUM_HEURISTIC - 1);
+ hi = (hi + 1) % NUM_HEURISTIC;
if (nfsheur[hi].nh_use < nh->nh_use)
nh = &nfsheur[hi];
}