Faster Reading From /dev/zero With Linux 5.10

Written by Michael Larabel in Linux Kernel on 6 September 2020 at 09:45 AM EDT. 19 Comments
LINUX KERNEL
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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week