This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: memcpy walk benchmark [was: Hoist ZVA check out of the memset function]
On Monday 16 October 2017 06:42 PM, Wilco Dijkstra wrote:
> No this is not the case. For larger sizes it accesses less and less memory.
> See eg. bench-memset-walk.c:
>
> size_t i, iters = MIN_PAGE_SIZE / n;
>
> for (i = 0; i < iters && s <= s_end; s++, i++)
> CALL (impl, s, c, n);
Ahh wait, my intention was to start from s_end and go down to s,
decrementing along the way. That should have different behaviour from
incrementing since the latter will tune hardware prefetchers for future
iterations, thus skewing readings.
> Clearly the working set is (MIN_PAGE_SIZE / n) + n. For n=256 it is
> 128KB, for n=1024 it is just 33KB. I wouldn't call either a 32MB walk...
>
> Presumably the intention was to do s += n?
Right, except it was supposed to be s_end -= n.
I'll post a fix for both those issues and re-test memset. Any other
comments on the test? BTW, I thought you were talking about memcpy and
not memset. Can you please review those tests as well?
Siddhesh