svn commit: r211152 - user/des/phybs
Dag-Erling Smorgrav
des at FreeBSD.org
Tue Aug 10 18:58:06 UTC 2010
Author: des
Date: Tue Aug 10 18:58:06 2010
New Revision: 211152
URL: http://svn.freebsd.org/changeset/base/211152
Log:
Increase MINSIZE; there isn't much point in doing 512-byte
transactions, as they will always be either perfectly aligned or
short.
Increase STEP to MAXSIZE * 4; having STEP equal to MAXSIZE means that
the last round actually tests sequential reading / writing, which is
not what we're after.
Instead of testing all offsets from 0 to size, test 0 and power-of-two
multiples of BSIZE, since we assume that the physical block size is a
power-of-two multiple of BSIZE.
This should both shorten the test's run time and improve the
significance of its output.
Modified:
user/des/phybs/phybs.c
Modified: user/des/phybs/phybs.c
==============================================================================
--- user/des/phybs/phybs.c Tue Aug 10 18:29:39 2010 (r211151)
+++ user/des/phybs/phybs.c Tue Aug 10 18:58:06 2010 (r211152)
@@ -36,9 +36,10 @@
#include <string.h>
#include <unistd.h>
-#define MINSIZE 512
+#define BSIZE 512
+#define MINSIZE 1024
#define MAXSIZE 8192
-#define STEP MAXSIZE
+#define STEP (MAXSIZE * 4)
#define COUNT 65536
static int opt_r = 0;
@@ -137,9 +138,12 @@ main(int argc, char *argv[])
printf("%8s%8s%8s%8s%12s%8s%8s\n",
"count", "size", "offset", "step",
"msec", "tps", "kBps");
- for (size_t size = MINSIZE; size <= MAXSIZE; size *= 2)
- for (off_t offset = 0; offset < (off_t)size; offset += 512)
+ for (size_t size = MINSIZE; size <= MAXSIZE; size *= 2) {
+ printf("\n");
+ scan(fd, size, 0, STEP, COUNT);
+ for (off_t offset = BSIZE; offset <= (off_t)size; offset *= 2)
scan(fd, size, offset, STEP, COUNT);
+ }
close(fd);
exit(0);
}
More information about the svn-src-user
mailing list