|> I'm running lmbench on a few linux machines. lmbench measures (among other
|> things) bcopy bandwidth. There are two lines in the file bw_mem_cp.c which I
|> don't understand:
|>
|> bzero(src, bytes); /* for Linux */
|> bzero(dst, bytes); /* for Linux */
|>
|> Removing these lines yields much higher (although apparently innacurate)
|> numbers for bandwidth for large bcopys.
|>
|> Can anyone tell me why the calls to bzero are necessary?
When you don't initialize your source area, all your source area is
the same page, one page filled with zero bytes. This page fits nicely
in the first level cache. Reading from cache is faster than reading
from memory.
Roger