Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 1999 23:11:48 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Greg Lehey <grog@lemis.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, dg@root.com, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: User block device access (was: cvs commit: src/sys/miscfs/specfs spec_vnops.c src/sys/sys vnode.h src/sys/kern vfs_subr.c)
Message-ID:  <199909200611.XAA77678@apollo.backplane.com>
References:  <16748.937762251@critter.freebsd.dk> <199909191806.LAA73255@apollo.backplane.com> <19990920115556.J55065@freebie.lemis.com> <199909200527.WAA77336@apollo.backplane.com> <19990920152437.W55065@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
:That has nothing to do with the effect I noted, which may be a red
:herring.
:
:I've just checked, one reason for the slower transfer is because the
:dd transfer from the raw device always reads 2 kB per transfer, no
:matter what you tell dd.  Here's iostat output for the following
:commands:

    When running from the block device it is using the block size from
    the label.  For the 'c' partition this is normally 0, resulting in
    the system picking '2K'.

    Try running it from a partition other then c and set the blocksize
    in the partition (you may have to set the fstype to 4.2BSD), then
    accesses to that partition via the block device will use the blocksize
    you set for the partition.

:dd if=/dev/wd3c of=/dev/null bs=64b
:
:      tty             da0              da1              wd0              wd2              wd3             cpu
: tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
:   8  109  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.05 1290  2.59   2  0 18  1 79
:   4  109  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.00 1588  3.10   2  0 20  4 74
:  16  110  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.00 1602  3.13   2  0 25  3 70

    For the raw device no reblocking is done, the block size you
    give dd is what dd will attempt to hand to the raw device.

:dd if=/dev/rwd3c of=/dev/null bs=64b 
:   0  108  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00  32.00 312  9.74   2  0  5  1 92
: 148  109  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00  32.00 311  9.71   3  0  4  0 93
: 371  108  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00  32.00 312  9.74   5  0 11  1 83

:>     If you apply the mmap() patches found on
:>     http://www.backplane.com/FreeBSD4/ and do an mmap based test, you will
:>     find that the overhead narrows considerably.
:
:Hmmm.  I tried running with 2kB blocks, and the results weren't what I
:expected.  I need to scratch my head some more.  Here's what I got:

    The patches only apply to mmap.  dd does not use mmap to read the
    input file.

:dd if=/dev/rwd3c of=/dev/null bs=4b count=10000
:
:   1  109  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.00 3891  7.60   2  0 28  4 67
:   0  109  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.00 3889  7.60   4  0 24  7 66
:
:dd if=/dev/wd3c of=/dev/null bs=4b count=10000 
:
: 193  325  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.10 143  0.29   4  0  2  1 93
:2113  342  0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   0.00   0  0.00   2.76 162  0.44   5  0  4  1 90
:
:>     There is nothing sinister going on here, buffer copying eats cpu
:>     plain and simple.
:
:The primary effect here isn't buffer copying.
:
:Greg
:--
:See complete headers for address, home page and phone numbers
:finger grog@lemis.com for PGP public key
:

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909200611.XAA77678>