summaryrefslogtreecommitdiff
path: root/benchmarks/rawio/files
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2006-10-09 17:19:54 +0000
committerStefan Eßer <se@FreeBSD.org>2006-10-09 17:19:54 +0000
commit081930c498c6d602b61220e20b131b2a793aaa88 (patch)
treee4061863f252b26503269e70250aaee0f1103130 /benchmarks/rawio/files
parent- Fix incorrect dependency path (diff)
Fix rawio for sequential read/write tests:
Revision 1.3 of patch-ad worked around the problem, that only one writer is allowed to allow a partition through GEOM. The fix was not complete, leading to the file position not been incremented during reads and writes, thus not testing sequential performance, but performance of cached reads and writes, in general. This fix makes rawio report reasonable sequential performance again, but I'm still very suspicious with regard to randomized start positions working. The results do not show the expected variation of sequential read/write performance. I have not had time to look into this any deeper, though, and thus decidied to not delay the commit any further ...
Diffstat (limited to 'benchmarks/rawio/files')
-rw-r--r--benchmarks/rawio/files/patch-ad43
1 files changed, 31 insertions, 12 deletions
diff --git a/benchmarks/rawio/files/patch-ad b/benchmarks/rawio/files/patch-ad
index cd025c4214a7..afd8e208fd2a 100644
--- a/benchmarks/rawio/files/patch-ad
+++ b/benchmarks/rawio/files/patch-ad
@@ -1,5 +1,5 @@
---- rawio.c.orig Sun Nov 26 22:28:19 2000
-+++ rawio.c Tue Nov 1 11:55:33 2005
+--- rawio.c.orig Mon Nov 27 04:28:19 2000
++++ rawio.c Tue Jun 20 23:03:20 2006
@@ -58,6 +58,9 @@
#endif
#ifdef BSD4_4
@@ -125,8 +125,8 @@
- strerror (errno));
- else if ((iocount = read (file, buf, length)) != length)
+ % (maxchunk * 2) + sectorsize) & ~(sectorsize - 1); /* length of this transfer */
-+ offset = ((((off_t) (myrandom2 (proc + nproc * i)) * sectorsize)
-+ % (filesize - SKIPSTART - length)) & ~(sectorsize - 1)) + SKIPSTART;
++ offset = (((((off_t) myrandom2 (proc + nproc * i)) * sectorsize)
++ % (filesize - SKIPSTART - length)) & ~((off_t)sectorsize - 1)) + SKIPSTART;
+ if ((iocount = pread (file, buf, length, pos = offset)) != length)
{
int Errno = errno;
@@ -140,10 +140,10 @@
offset = SKIPSTART; /* start at the beginning */
else /* random start */
- offset = ((((off_t) (myrandom (proc + nproc)) * DEV_BSIZE)
-+ offset = ((((off_t) (myrandom (proc + nproc)) * sectorsize)
++ offset = (((((off_t) myrandom (proc + nproc)) * sectorsize)
% (filesize - SKIPSTART /* decide where to start */
- - (maxrecs * length))) & ~0x1ff) + SKIPSTART;
-+ - (maxrecs * length))) & ~(sectorsize - 1)) + SKIPSTART;
++ - (maxrecs * length))) & ~((off_t)sectorsize - 1)) + SKIPSTART;
if ((offset + maxrecs * length) > filesize) /* XXX */
{
printf ("Overrun: offset %" Quad "d, end %" Quad "d, file size %" Quad "d\n",
@@ -168,7 +168,15 @@
fprintf (stderr,
"offset %" Quad "d, filesize %" Quad "d\n",
-@@ -976,30 +973,28 @@
+@@ -965,6 +962,7 @@
+ {
+ childinfo [proc].reads++;
+ childinfo [proc].bytes_read += iocount;
++ offset += iocount;
+ }
+ }
+ break;
+@@ -976,30 +974,28 @@
length = maxchunk;
else
length = (myrandom (proc + nproc * i * 2)
@@ -179,8 +187,8 @@
- fprintf (stderr, "Child %d can't seek: %s", proc, strerror (errno));
- else
+ % (maxchunk * 2) + sectorsize) & ~(sectorsize - 1); /* length of this transfer */
-+ offset = ((((off_t) (myrandom2 (proc + nproc * i)) * sectorsize)
-+ % (filesize - SKIPSTART - length)) & ~(sectorsize - 1)) + SKIPSTART;
++ offset = (((((off_t) myrandom2 (proc + nproc * i)) * sectorsize)
++ % (filesize - SKIPSTART - length)) & ~((off_t)sectorsize - 1)) + SKIPSTART;
+ if (1)
{
if ((RWfrac == 100)
@@ -206,12 +214,12 @@
fprintf (stderr,
"offset %" Quad "d, filesize %" Quad "d\n", offset,
-@@ -1032,36 +1027,30 @@
+@@ -1032,36 +1028,30 @@
if (fixedoffset)
offset = SKIPSTART; /* start at the beginning */
else /* random start */
- offset = ((((off_t) (myrandom (proc + nproc)) * DEV_BSIZE)
-+ offset = ((((off_t) (myrandom (proc + nproc)) * sectorsize)
++ offset = (((((off_t) myrandom (proc + nproc)) * sectorsize)
% (filesize - SKIPSTART /* decide where to start */
- - (maxrecs * length))) & ~0x1ff) + SKIPSTART;
- if (lseek (file, offset, SEEK_SET) < 0)
@@ -221,7 +229,7 @@
- offset,
- strerror (errno));
- else if ((verbose > 2) && ! fixedoffset)
-+ - (maxrecs * length))) & ~(sectorsize - 1)) + SKIPSTART;
++ - (maxrecs * length))) & ~((off_t)sectorsize - 1)) + SKIPSTART;
+ if ((verbose > 2) && ! fixedoffset)
printf ("Child %d writing to %" Quad "d\n", proc, offset);
for (i = 1; i <= maxrecs; i++)
@@ -249,3 +257,14 @@
fprintf (stderr,
"offset %" Quad "d, filesize %" Quad "d\n",
+@@ -1082,6 +1072,10 @@
+ iocount,
+ length );
+ exit (1);
++ }
++ else
++ {
++ offset += iocount;
+ }
+ }
+ break;