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.
? 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);

Reply via email to