summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 ae3f944..9384016 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];
}
OpenPOWER on IntegriCloud