Faster Reading From /dev/zero With Linux 5.10
Queued up in char-misc-next ahead of the Linux 5.10 cycle is a speed-up for reading from /dev/zero...
The patch adds a non-iov_iter version of reads for the /dev/zero interface. The write performance is unchanged as it already had a non-iov_iter implementation.
The patch by prominent upstream kernel developer Christoph Hellwig explains that in fact there is a "major speedup" and it's attributed to the iov_iter overhead in the read_iter path, "Christophe reported a major speedup due to avoiding the iov_iter overhead, so just add this trivial function. Note that /dev/zero already implements both an iter and non-iter writes so this just makes it more symmetric."
As for how the overhead can be so bad with something as simple as /dev/zero, any further details are pending on the kernel mailing list. In any case, the patch is now in char-misc-next ahead of the Linux 5.10 merge window opening next month.
The patch adds a non-iov_iter version of reads for the /dev/zero interface. The write performance is unchanged as it already had a non-iov_iter implementation.
The patch by prominent upstream kernel developer Christoph Hellwig explains that in fact there is a "major speedup" and it's attributed to the iov_iter overhead in the read_iter path, "Christophe reported a major speedup due to avoiding the iov_iter overhead, so just add this trivial function. Note that /dev/zero already implements both an iter and non-iter writes so this just makes it more symmetric."
As for how the overhead can be so bad with something as simple as /dev/zero, any further details are pending on the kernel mailing list. In any case, the patch is now in char-misc-next ahead of the Linux 5.10 merge window opening next month.
19 Comments