On 01/11/2025 08:13, Collin Funk wrote:
Pádraig Brady <[email protected]> writes:

This patch is in fact required with OpenZFS as my hunch was correct
that a zero length would be treated specially (even perhaps because
cp has used 0 for so long).  With a specific length OpenZFS 2.2.2
synchronously (decompresses and) populates the cache, which
defeats the subsequent copy offload. Details at:
https://github.com/coreutils/coreutils/issues/122

I'll apply the above, but also the attached more defensive patch,
to avoid fdadvise unless we really need it.

Interesting. Do you happen to have any performance benchmarks from when
fadvise was added to 'cp'? I assumed that the impact of it would be
minimal, but that report proves otherwise at least for ZFS.

We saw a 5% speedup when reading from SSD:
https://github.com/coreutils/coreutils/commit/15f1d0c9a
I measured a more significant speedup with spinning disks.

cheers,
Padraig

Reply via email to