[OpenAFS-devel] PATCH: limit afsd auto-tuning to 500000 files

Troy Benjegerdes hozer@hozed.org
Tue, 23 Aug 2005 17:43:16 -0500


This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_kalmia.hozed.org-32385-1124836996-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

The following patch limits the auto-tuning code to a max upper limit of
500K files. Is this a reasonable upper limit? Should it be
smaller/larger? I have tested this with 20GB and 80GB caches. (The 80GB
cache machine happens to have a 1M file upper limit)

At any rate, if the user really wants something larger, they should
specify '-files' on the command line.

--=_kalmia.hozed.org-32385-1124836996-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="afsd.c.diff"

? afsd.c.diff
Index: afsd.c
===================================================================
RCS file: /cvs/openafs/src/afsd/afsd.c,v
retrieving revision 1.55
diff -u -r1.55 afsd.c
--- afsd.c	17 Aug 2005 16:16:50 -0000	1.55
+++ afsd.c	23 Aug 2005 21:53:35 -0000
@@ -1689,7 +1689,13 @@
 	    if (cacheFiles < 100)
 		fprintf(stderr, "%s: WARNING: cache probably too small!\n",
 			rn);
-
+	
+#define MAXFILES 500000
+	    if (cacheFiles > MAXFILES){
+		fprintf(stderr, "%s: WARNING: cacheFiles was %d\n", rn, cacheFiles);
+		fprintf(stderr, "        limiting to %d\n", MAXFILES);
+		cacheFiles = MAXFILES;
+	    }
 	    if (afsd_verbose)
 		printf("%s: cacheFiles autotuned to %d\n", rn, cacheFiles);
 	}
@@ -2387,7 +2393,7 @@
 	syscall(AFS_SYSCALL, AFSCALL_CALL, param1, param2, param3, param4,
 		param5, param6, param7);
 
-    if (afsd_verbose)
+    if (afsd_debug)
 	printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1,
 	       error);
     return (error);

--=_kalmia.hozed.org-32385-1124836996-0001-2--