[OpenAFS-devel] more PAGs

John S. Bucy bucy-openafs-devel@gloop.org
Thu, 9 Sep 2004 17:01:04 -0400


1: Here's a patch to log when the throttling is triggered.  It should
only print once per k_setpag().  I guess another way this could work
is print only after its slept 5 seconds or something.

diff -ur openafs-1.3.71/src/afs/afs_osi_pag.c openafs-1.3.71-cur/src/afs/afs_osi_pag.c
--- openafs-1.3.71/src/afs/afs_osi_pag.c        2004-07-28 23:13:37.000000000 -0400
+++ openafs-1.3.71-cur/src/afs/afs_osi_pag.c    2004-09-09 16:41:21.000000000 -0400
@@ -164,8 +164,14 @@
     if (!afs_suser(NULL))
 #endif
     {
+      int printflag = 0;
        while (osi_Time() - pag_epoch < pagCounter) {
-           afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
+         if(!printflag) {
+           printf("%s() PAG throttling triggered, pid %d... sleeping.\n",
+                  __func__, getpid());
+           printflag = 1;
+         }
+         afs_osi_Wait(1000, (struct afs_osi_WaitHandle *)0, 0);
        }
     }
 #if    defined(AFS_SUN5_ENV)



2: There seems to be a fairness problem with setpag.  If I start
many of the following:

  for(i = 0; ; i++) {
    k_setpag();
    printf("pid %d, %d\n", getpid(), i);
  }

once the throttling kicks in, I only see output (and kmsgs) from one
of them.  If I stop the one that's making progress, another one will
start again. 




john