[ale] Understanding dd and/or /dev/zero

Danny Cox danscox at mindspring.com
Mon Jan 10 21:33:27 EST 2005


Greg,

On Mon, 2005-01-10 at 19:41 -0500, Greg Freemyer wrote:
> I'll do it tomorrow, but I assume you are trying to cause swapping???

	No, as I said, just another data point.  1 MB is lots bigger than 512,
so I thought we'd just see if it made a difference.

	In the past, I frequently used a larger block size to write to various
tape devices, and the larger a block size I can stuff down it's throat,
the faster it runs.  It can make a huge difference in copying a large
file, too.

	Thus, if there IS a difference in what iostat says during a run with a
large block size, then we might say that iostat, or where ever it's
getting it's numbers from may be wrong.

	Ah, I just had a thought.  Doesn't Linux always use a 4K page size?  In
that case, using the dd default of 512 bytes, the kernel will have to
read each page once (for 4K), in the event that you only modify part of
it, and write it back out.  That's perhaps where your reads are coming
from.  Try a 4k block size, and see if it makes a difference.

-- 
kernel, n.: A part of an operating system that preserves the
medieval traditions of sorcery and black art.

Danny



More information about the Ale mailing list