[hackers] Re: [ubase] dd doesn't handle reading from high latency files well

From: Eric Pruitt <eric.pruitt_AT_gmail.com>
Date: Wed, 6 Sep 2017 11:48:31 -0700

On Tue, Sep 05, 2017 at 09:31:04PM -0700, Eric Pruitt wrote:
> The amount of sys time spent by ubase's dd is always a lot higher than
> coreutil's even when the wall-clock time of the runs is comparable. I
> haven't spent a lot of time looking into this yet, so I don't have a
> patch prepared, but glancing at strace showed rapid invocations of
> select(2) which often alternated between succeeding and ENOSYS:

The GNU implementation just uses read(2)
(https://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=src/dd.c;h=ddeeb4f).
I also looked at the dd implementations in:

- OpenBSD: https://github.com/openbsd/src/blob/master/bin/dd/dd.c
- FreeBSD: https://github.com/freebsd/freebsd/blob/master/bin/dd/dd.c
- BusyBox: https://git.busybox.net/busybox/tree/coreutils/dd.c

Assuming I didn't overlook something, they all use read(2) and write(2)
without select(2). My inclination would be to revert ubase commit
0ca8e52 which introduced select(2) and avoid splice(2) since getting rid
of the Linux-specific function might make it possible to move dd from
ubase to sbase.

Eric
Received on Wed Sep 06 2017 - 20:48:31 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 06 2017 - 21:00:24 CEST