Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/nfs current trylater/jukebox retry delay is way too long...
details: https://anonhg.NetBSD.org/src/rev/41b30fb01236
branches: trunk
changeset: 550663:41b30fb01236
user: yamt <yamt%NetBSD.org@localhost>
date: Sat Aug 16 18:08:27 2003 +0000
description:
current trylater/jukebox retry delay is way too long and
it has a bug in the backoff calculation. so,
- clip it to 1-60 sec. (suggested by Rick Macklem)
- use a constant multiplier instead of nfs_backoff, which
is already exponential.
- move some related constant definations to nfs.h from nqnfs.h and
prefix with NFS_ instead of NQ_ because they are not nqnfs-specific.
diffstat:
sys/nfs/nfs.h | 5 ++++-
sys/nfs/nfs_socket.c | 13 ++++++-------
sys/nfs/nqnfs.h | 3 +--
3 files changed, 11 insertions(+), 10 deletions(-)
diffs (77 lines):
diff -r 478bc3ca41b8 -r 41b30fb01236 sys/nfs/nfs.h
--- a/sys/nfs/nfs.h Sat Aug 16 16:03:05 2003 +0000
+++ b/sys/nfs/nfs.h Sat Aug 16 18:08:27 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs.h,v 1.40 2003/08/07 16:33:49 agc Exp $ */
+/* $NetBSD: nfs.h,v 1.41 2003/08/16 18:08:27 yamt Exp $ */
/*
* Copyright (c) 1989, 1993, 1995
* The Regents of the University of California. All rights reserved.
@@ -57,6 +57,9 @@
#ifndef NFS_MAXATTRTIMO
#define NFS_MAXATTRTIMO 60
#endif
+#define NFS_TRYLATERDEL 1 /* Initial try later delay (sec) */
+#define NFS_TRYLATERDELMAX (1*60) /* Maximum try later delay (sec) */
+#define NFS_TRYLATERDELMUL 2 /* Exponential backoff multiplier */
/*
* These can be overridden through <machine/param.h>, included via
diff -r 478bc3ca41b8 -r 41b30fb01236 sys/nfs/nfs_socket.c
--- a/sys/nfs/nfs_socket.c Sat Aug 16 16:03:05 2003 +0000
+++ b/sys/nfs/nfs_socket.c Sat Aug 16 18:08:27 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_socket.c,v 1.96 2003/08/07 16:33:52 agc Exp $ */
+/* $NetBSD: nfs_socket.c,v 1.97 2003/08/16 18:08:27 yamt Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1995
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.96 2003/08/07 16:33:52 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_socket.c,v 1.97 2003/08/16 18:08:27 yamt Exp $");
#include "fs_nfs.h"
#include "opt_nfs.h"
@@ -927,7 +927,7 @@
time_t reqtime, waituntil;
caddr_t dpos, cp2;
int t1, s, error = 0, mrest_len, auth_len, auth_type;
- int trylater_delay = NQ_TRYLATERDEL, trylater_cnt = 0, failed_auth = 0;
+ int trylater_delay = NFS_TRYLATERDEL, failed_auth = 0;
int verf_len, verf_type;
u_int32_t xid;
char *auth_str, *verf_str;
@@ -1130,10 +1130,9 @@
while (time.tv_sec < waituntil)
(void) tsleep((caddr_t)&lbolt,
PSOCK, "nqnfstry", 0);
- trylater_delay *= nfs_backoff[trylater_cnt];
- if (trylater_cnt + 1 <
- sizeof(nfs_backoff) / sizeof(nfs_backoff[0]))
- trylater_cnt++;
+ trylater_delay *= NFS_TRYLATERDELMUL;
+ if (trylater_delay > NFS_TRYLATERDELMAX)
+ trylater_delay = NFS_TRYLATERDELMAX;
/*
* RFC1813:
* The client should wait and then try
diff -r 478bc3ca41b8 -r 41b30fb01236 sys/nfs/nqnfs.h
--- a/sys/nfs/nqnfs.h Sat Aug 16 16:03:05 2003 +0000
+++ b/sys/nfs/nqnfs.h Sat Aug 16 18:08:27 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nqnfs.h,v 1.14 2003/08/07 16:33:57 agc Exp $ */
+/* $NetBSD: nqnfs.h,v 1.15 2003/08/16 18:08:27 yamt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -49,7 +49,6 @@
#define NQ_MINLEASE 5 /* Min lease duration (sec) */
#define NQ_DEFLEASE 30 /* Default lease duration (sec) */
#define NQ_RENEWAL 3 /* Time before expiry (sec) to renew */
-#define NQ_TRYLATERDEL 15 /* Initial try later delay (sec) */
#define NQ_MAXNUMLEASE 2048 /* Upper bound on number of server leases */
#define NQ_DEADTHRESH NQ_NEVERDEAD /* Default nm_deadthresh */
#define NQ_NEVERDEAD 9 /* Greater than max. nm_timeouts */
Home |
Main Index |
Thread Index |
Old Index