[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH]: add an option to disable direct I/O in shred
From: |
Pádraig Brady |
Subject: |
Re: [PATCH]: add an option to disable direct I/O in shred |
Date: |
Thu, 15 Oct 2015 15:24:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 15/10/15 12:46, Andreas Kinzler wrote:
> 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.
Thanks for the extra info.
> In my case the cache could not be enabled on some older SATA (via AHCI)
> drives.
That is an edge case in fairness.
I'd like to avoid an option for this performance only edge case.
Attached is a patch to periodically request to discard written pages,
rather than use O_DIRECT. I need to do a bit more testing to
ensure it introduces no performance regressions, though it's
worth noting that we ran without direct I/O between 2006-2013
without any requests to address that.
thanks,
Pádraig.
shred-avoid-direct-io.patch
Description: Text Data