aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>2006-10-10 01:19:54 +0800
committerse <se@FreeBSD.org>2006-10-10 01:19:54 +0800
commitc0e1f6bc407c996d2b848e1613b11d9fd74355be (patch)
tree2e1e178a9739d90a4660ff10f393c2ba8cb27c74 /benchmarks
parent48fd2b2ae0740eed602a53df1015e9fbe2b8507a (diff)
downloadfreebsd-ports-gnome-c0e1f6bc407c996d2b848e1613b11d9fd74355be.tar.gz
freebsd-ports-gnome-c0e1f6bc407c996d2b848e1613b11d9fd74355be.tar.zst
freebsd-ports-gnome-c0e1f6bc407c996d2b848e1613b11d9fd74355be.zip
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')
-rw-r--r--benchmarks/rawio/Makefile2
-rw-r--r--benchmarks/rawio/files/patch-ad43
2 files changed, 32 insertions, 13 deletions
diff --git a/benchmarks/rawio/Makefile b/benchmarks/rawio/Makefile
index d0c2f7ffbdc7..2ba9493f6ee9 100644
--- a/benchmarks/rawio/Makefile
+++ b/benchmarks/rawio/Makefile
@@ -8,7 +8,7 @@
PORTNAME= rawio
PORTVERSION= 1.2
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= benchmarks
MASTER_SITES= ftp://ftp.lemis.com/pub/ \
http://ftp.osuosl.org/pub/FreeBSD/distfiles/
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;