svn commit: r221853 - in head/sys: dev/md dev/null sys vm

mdf at FreeBSD.org mdf at FreeBSD.org
Tue May 31 23:19:15 UTC 2011


On Tue, May 31, 2011 at 3:47 PM,  <mdf at freebsd.org> wrote:
> On Tue, May 31, 2011 at 2:48 PM, Pieter de Goeje <pieter at degoeje.nl> wrote:
>> On Sunday 29 May 2011 05:01:57 mdf at freebsd.org wrote:
>>> On Sat, May 28, 2011 at 12:03 PM, Pieter de Goeje <pieter at degoeje.nl> wrote:
>>> > To me it looks like it's not able to cache the zeroes anymore. Is this
>>> > intentional? I tried to change ZERO_REGION_SIZE back to 64K but that
>>> > didn't help.
>>>
>>> Hmm.  I don't have access to my FreeBSD box over the weekend, but I'll
>>> run this on my box when I get back to work.
>>>
>>> Meanwhile you could try setting ZERO_REGION_SIZE to PAGE_SIZE and I
>>> think that will restore things to the original performance.
>>
>> Indeed it does. I couldn't find any authoritative docs stating wether or not
>> the cache on this CPU is virtually indexed, but apparently at least some of
>> it is.
>
> On my physical box (some Dell thing from about 2008), I ran 10 loops
> of dd if=/dev/zero of=/dev/null bs=XX count=XX where bs went by powers
> of 2 from 512 bytes to 2M, and count was set so that the dd always
> transferred 8GB.  I compared ZERO_REGION_SIZE of 64k and 2M on amd64.
>
> The summary of the ministat(1) output is:
>
> bs=512b - no difference
> bs=1K - no difference
> bs=2k - no difference
> bs=4k - no difference
> bs=8k - no difference
> bs=16k - no difference
> bs=32k - no difference
> bs=64k - no difference
> bs=128k - 2M is 0.69% faster
> bs=256k - 2M is 0.98% faster
> bs=512k - 2M is 0.65% faster
> bs=1M - 2M is 1.02% faster
> bs=2M - 2M is 2.17% slower
>
> I'll play again with a 4K buffer.

The data is harder to parse precisely, but in general it looks like on
my box using a 4K buffer results in significantly worse performance
when the dd(1) block size is larger than 4K.  How much worse depends
on the block size, but it goes from 6% at bs=8k to 17% at bs>=256k.
Showing 4k/64k/2M ZERO_REGION_SIZE graphically in the ministat(1)
output also makes it clear that the difference between 64k and 2M is
nearly insignificant on my box compared to using 4k.

http://people.freebsd.org/~mdf/zero-ministat.txt

Cheers,
matthew


More information about the svn-src-all mailing list