On 14.10.2015 18:48, Pádraig Brady wrote:
some disks can be very slow with direct I/O and shred. I developed a
small patch that adds a new
option -i, --nodirectio to disable direct I/O.
Interesting. direct I/O was added in 2004 to improve performance
by avoid page cache thrashing, as suggested in:
https://bugs.debian.org/207035
Can you give us some details on where direct I/O is slower?
Are you working with files or device nodes?
Which type of disk device is this?
I use shred for block devices only. My measurements show that
direct I/O is indeed optimal for block devices where the device has
its write cache enabled. If for some reason the write cache is
disabled and/or cannot be enabled, then shred with direct I/O is
very slow because the device must complete a physical transaction
for each 64 KB write request. In this case, the option to disable
direct I/O is very helpful.
In my case the cache could not be enabled on some older SATA (via AHCI)
drives.
Regards Andreas