shithub: gefs

Download patch

ref: 364a6d7d4049534089ea1dbfadaaa145ed72798c
parent: 9b3d57022efef51421855243ff1c33989668f48d
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Apr 30 10:42:05 EDT 2023

test/fsbench: more parallel tests

--- a/test/fsbench.c
+++ b/test/fsbench.c
@@ -127,11 +127,17 @@
 vlong
 rdfile_la(Bench *b)
 {
-	char buf[Bufsz];
+	char path[128], buf[Bufsz];
 	vlong i, rep;
 	int fd;
 
-	if((fd = open(b->s0, OREAD)) == -1)
+	if(b->id == -1)
+		snprint(path, sizeof(path), "%s", b->s0);
+	else if(b->i1 != 0)
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+	else
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
+	if((fd = open(path, OREAD)) == -1)
 		sysfatal("open: %r");
 	for(rep = 0; rep < b->reps; rep++){
 		seek(fd, 0, 0);
@@ -145,12 +151,18 @@
 vlong
 rdfile_ra(Bench *b)
 {
-	char buf[Bufsz];
+	char path[128], buf[Bufsz];
 	vlong i, rep;
 	uvlong off;
 	int fd;
 
-	if((fd = open(b->s0, OREAD)) == -1)
+	if(b->id == -1)
+		snprint(path, sizeof(path), "%s", b->s0);
+	else if(b->i1 != 0)
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+	else
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
+	if((fd = open(path, OREAD)) == -1)
 		sysfatal("open: %r");
 	for(rep = 0; rep < b->reps; rep++){
 		seek(fd, 0, 0);
@@ -184,12 +196,18 @@
 vlong
 rdfile_rr(Bench *b)
 {
-	char buf[Bufsz];
+	char path[128], buf[Bufsz];
 	vlong i, rep;
 	uvlong off;
 	int fd;
 
-	if((fd = open(b->s0, OREAD)) == -1)
+	if(b->id == -1)
+		snprint(path, sizeof(path), "%s", b->s0);
+	else if(b->i1 != 0)
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id % b->i1);
+	else
+		snprint(path, sizeof(path), "%s.%d", b->s0, b->id);
+	if((fd = open(path, OREAD)) == -1)
 		sysfatal("open: %r");
 	for(rep = 0; rep < b->reps; rep++){
 		for(i = 0; i < b->i0; i += Bufsz){
@@ -358,33 +376,83 @@
 {
 	Bench marks[] = {
 		/* l => linear, a => aligned, r => random */
-		{.name="wrcached_la",	.i0=256*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0"},
-		{.name="rdcached_lala",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0"},
-		{.name="rdcached_lara",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0"},
-		{.name="rdcached_larr",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.0"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.1"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.2"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.3"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.4"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.5"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.6"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.7"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.8"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.9"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.10"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.11"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.12"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.13"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.14"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.15"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.16"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.17"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.18"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.19"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.20"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.21"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.22"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.23"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.24"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.25"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.26"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.27"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.28"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.29"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.30"},
+		{.name="wrcached_la",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_la, .s0="cached0.31"},
 
-		{.name="rdcached_lala_2p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=2},
-		{.name="rdcached_lara_2p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=2},
-		{.name="rdcached_larr_2p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=2},
+		{.name="rdcached_lala",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0"},
+		{.name="rdcached_lara",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0"},
+		{.name="rdcached_larr",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0"},
+
+		{.name="rdcached_lala_2p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=2},
+		{.name="rdcached_lara_2p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=2},
+		{.name="rdcached_larr_2p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=2},
+
+		{.name="rdcached_lala_4p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=4},
+		{.name="rdcached_lara_4p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=4},
+		{.name="rdcached_larr_4p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=4},
+
+		{.name="rdcached_lala_8p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=8},
+		{.name="rdcached_lara_8p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=8},
+		{.name="rdcached_larr_8p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=8},
+
+		{.name="rdcached_lala_12p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=12},
+		{.name="rdcached_lara_12p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=12},
+		{.name="rdcached_larr_12p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=12},
 
-		{.name="rdcached_lala_4p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=4},
-		{.name="rdcached_lara_4p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=4},
-		{.name="rdcached_larr_4p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=4},
+		{.name="rdcached_lala_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=16},
+		{.name="rdcached_lara_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=16},
+		{.name="rdcached_larr_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=16},
 
-		{.name="rdcached_lala_8p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=8},
-		{.name="rdcached_lara_8p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=8},
-		{.name="rdcached_larr_8p",	.i0=256*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=8},
+		{.name="rdcached_lala_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=16},
+		{.name="rdcached_lara_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=16},
+		{.name="rdcached_larr_16p",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=16},
 
-		{.name="wrcached_ra",	.i0=256*MiB,	.reps=1, .unit="MiB", .fn=wrfile_ra, .s0="cached1"},
-		{.name="rdcached_rala",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_la, .s0="cached1"},
-		{.name="rdcached_rara",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_ra, .s0="cached1"},
-		{.name="rdcached_rarr",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_rr, .s0="cached1"},
+		{.name="rdcached_lala_16p_1f",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_la, .s0="cached0", .nproc=16, .i1=1},
+		{.name="rdcached_lara_16p_8f",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_ra, .s0="cached0", .nproc=16, .i1=8},
+		{.name="rdcached_larr_32p_16f",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=32, .i1=16},
+		{.name="rdcached_larr_32p_32f",	.i0=128*MiB,	.reps=2, .unit="MiB", .fn=rdfile_rr, .s0="cached0", .nproc=32, .i1=32},
 
-		{.name="wrcached_rr",	.i0=256*MiB,	.reps=1, .unit="MiB", .fn=wrfile_rr, .s0="cached2"},
-		{.name="rdcached_rrla",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_la, .s0="cached2"},
-		{.name="rdcached_rrra",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_ra, .s0="cached2"},
-		{.name="rdcached_rrrr",	.i0=256*MiB,	.reps=10, .unit="MiB", .fn=rdfile_rr, .s0="cached2"},
+		{.name="wrcached_ra",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_ra, .s0="cached1"},
+		{.name="rdcached_rala",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_la, .s0="cached1"},
+		{.name="rdcached_rara",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_ra, .s0="cached1"},
+		{.name="rdcached_rarr",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_rr, .s0="cached1"},
 
+		{.name="wrcached_rr",	.i0=128*MiB,	.reps=1, .unit="MiB", .fn=wrfile_rr, .s0="cached2"},
+		{.name="rdcached_rrla",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_la, .s0="cached2"},
+		{.name="rdcached_rrra",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_ra, .s0="cached2"},
+		{.name="rdcached_rrrr",	.i0=128*MiB,	.reps=10, .unit="MiB", .fn=rdfile_rr, .s0="cached2"},
+
 		{.name="rwcached_la_r0_w2_w",	.i0=64*MiB,	.reps=10, .unit="MiB", .fn=rwfile_lala, .s0="cached0", .nproc=2, .i1=2},
 		{.name="rwcached_la_r0_w4_w",	.i0=64*MiB,	.reps=10, .unit="MiB", .fn=rwfile_lala, .s0="cached0", .nproc=4, .i1=4},
 		{.name="rwcached_la_r1_w1_w",	.i0=64*MiB,	.reps=10, .unit="MiB", .fn=rwfile_lala, .s0="cached0", .nproc=2, .i1=1},
@@ -403,6 +471,17 @@
 		{.name="rwcached_la_r6_w2_r",	.i0=64*MiB,	.reps=10, .unit="MiB", .fn=rwfile_lala, .s0="cached0", .nproc=8, .i1=2},
 		{.name="rwcached_la_r4_w4_r",	.i0=64*MiB,	.reps=10, .unit="MiB", .fn=rwfile_lala, .s0="cached0", .nproc=8, .i1=4},
 
+		{.name="createflat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .s0="cz"},
+		{.name="write1flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=1, .s0="c1"},
+		{.name="write100flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=100, .s0="c100"},
+		{.name="write1027flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=1027, .s0="c1027"},
+		{.name="listfflat",	.i0=100*1000,	.reps=10,	.unit="files", .fn=listfiles},
+		{.name="openfflat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .s0="cz"},
+		{.name="read0flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="cz"},
+		{.name="read1flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c1"},
+		{.name="read100flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c100"},
+		{.name="read1027flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c1027"},
+
 //		{.name="rwcached_lara",	.i0=512*MiB,	.reps=10, .unit="MiB", .fn=rwfile_la, .s0="cached0", .i0=1, .i1=3},
 //		{.name="rwcached_la",	.i0=512*MiB,	.reps=10, .unit="MiB", .fn=rwfile_la, .s0="cached0", .i0=3, .i1=3},
 //		{.name="rwcached_la",	.i0=512*MiB,	.reps=10, .unit="MiB", .fn=rwfile_la, .s0="cached0", .i0=10, .i1=10},
@@ -422,17 +501,6 @@
 //		{.name="rdlarge_larr",	.i0=16*GiB,	.reps=1, .unit="MiB", .fn=rdfile_la, .s0="large2"},
 //		{.name="rdlarge_rarr",	.i0=16*GiB,	.reps=1, .unit="MiB", .fn=rdfile_ra, .s0="large2"},
 //		{.name="rdlarge_rrrr",	.i0=16*GiB,	.reps=1, .unit="MiB", .fn=rdfile_rr, .s0="large2"},
-
-		{.name="createflat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .s0="cz"},
-		{.name="write1flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=1, .s0="c1"},
-		{.name="write100flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=100, .s0="c100"},
-		{.name="write1027flat",	.i0=100*1000,	.reps=1, 	.unit="files", .fn=createflat, .i1=1027, .s0="c1027"},
-		{.name="listfflat",	.i0=100*1000,	.reps=10,	.unit="files", .fn=listfiles},
-		{.name="openfflat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .s0="cz"},
-		{.name="read0flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="cz"},
-		{.name="read1flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c1"},
-		{.name="read100flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c100"},
-		{.name="read1027flat",	.i0=100*1000,	.reps=100*1000, .unit="files", .fn=randopen, .i1=1, .s0="c1027"},
 
 //		{.name="createheir",	.i0=3, .i1=10,	.reps=1, .unit="files", .fn=createhier},
 //		{.name="openheir",	.i0=3, .i1=10,	.reps=1, .unit="files", .fn=randwalk},