shithub: gefs

Download patch

ref: 3d5ff2d9beb0bdf1aef5ab7afca578ebe4f55795
parent: 6d81e5b3fab334a63318d4ed88eccc89971ddeea
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Oct 12 11:43:49 EDT 2023

fs: add more epoch enter/leave pairs where needed

--- a/fs.c
+++ b/fs.c
@@ -2070,7 +2070,7 @@
 }
 
 void
-runfs(int, void *pc)
+runfs(int wid, void *pc)
 {
 	char err[128];
 	RWLock *lk;
@@ -2111,6 +2111,7 @@
 		}
 
 		h = ihash(m->fid) % fs->nreaders;
+		epochstart(wid);
 		switch(m->type){
 		/* sync setup */
 		case Tversion:	fsversion(m);	break;
@@ -2147,6 +2148,7 @@
 			respond(m, &r);
 			break;
 		}
+		epochend(wid);
 	}
 }
 
@@ -2217,7 +2219,7 @@
 }
 
 void
-runtasks(int, void *)
+runtasks(int wid, void *)
 {
 	int i, c;
 	Fmsg *m;
@@ -2250,6 +2252,7 @@
 		 */
 		qlock(&fs->synclk);
 		for(i = 0; i < fs->narena; i++){
+			epochstart(wid);
 			lock(&fs->arenas[i]);
 			c = fs->arenas[i].nlog > fs->arenas[i].reserve/(4*Blksz);
 			unlock(&fs->arenas[i]);
@@ -2257,6 +2260,7 @@
 				if(compresslog(&fs->arenas[i]) == -1)
 					fprint(2, "compress log: %r");
 			}
+			epochend(wid);
 		}
 		qunlock(&fs->synclk);
 	}