From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
"Maciej S . Szmigiero" <mail@maciej.szmigiero.name>,
Hannes Reinecke <hare@suse.de>, Christoph Hellwig <hch@lst.de>,
Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH v7 0/7] Improve libata support for FUA
Date: Thu, 5 Jan 2023 12:43:06 +0900 [thread overview]
Message-ID: <79260c74-92dd-2cdf-ad71-e70d9fa0f8a9@opensource.wdc.com> (raw)
In-Reply-To: <Y7WuEqMgySOCCTqy@slm.duckdns.org>
On 1/5/23 01:49, Tejun Heo wrote:
> Hello,
>
> On Tue, Jan 03, 2023 at 02:19:17PM +0900, Damien Le Moal wrote:
>> Finally, patch 7 enables FUA support by default in libata for devices
>> supporting this features.
>
> These optional features tend to be broken in various and subtle ways,
FUA is not optional for any drive that supports NCQ. The FUA bit is a
mandatory part of the FPDMA READ/WRITE commands. The optional part is
support for the non-ncq WRITE FUA EXT command.
> especially the ones which don't show clear and notable advantages and thus
> don't get used by everybody. I'm not necessarily against enabling it by
> default but we should have better justifications as we might unnecessarily
> cause a bunch of painful and subtle failures which can take a while to sort
> out.
Avoiding regressions is always my highest priority. I know that there
are a lot of cheap ATA devices out there that have questionable ACS spec
compliance.
> * Can the advantages of using FUA be demonstrated in a realistic way? IOW,
> are there workloads which clearly benefit from FUA? My memory is hazy but
> we only really use FUA from flush sequence to turn flush, write, flush
> sequence into flush, FUA-write. As all the heavy lifting is done in the
> first flush anyway, I couldn't find a case where that optimization made a
> meaningful difference but I didn't look very hard.
The main users in kernel are file systems, when committing
transactions/metadata journaling. Given that this is generally not
generating a lot of traffic, I do not think we can measure any
difference for HDDs. The devices are too slow to start with, so saving
one command will not matter much, unless the application is fsync()
crazy (and even then, not sure we'll see any difference). Even for SATA
SSDs it likely will be hard to see a difference I think.
Then we have applications using the drive block device file directly.
For these, it is hard to tell how much it matters. Enabling it by
default with a drive correctly supporting it will very much likely not
hurt though.
Maciej,
May be you did some experiments before asking for enabling FUA by
default ? Any interesting performance data you can share ?
> * Do we know how widely FUA is used now? IOW, is windows using FUA by
> default now? If so, do we know whether they have a blocklist?
You mean "blacklist" ? I do not have any information about Windows, but
I can try to find out, at least for my employer's devices. But that will
not be very useful as I know these drives behave correctly.
More than Windows or the kernel, I think that looking at SAS HBAs is
more important here. SATA HDDs are the most widely used type of devices
with these, by far. These may have a SAT translating FUA scsi writes to
FUA NCQ FPDMA writes, resulting in FUA being extensively used. Modulo a
blacklist that results in the same as the kernel with a
flush/write/flush sequence. Hard to know as HBA's FW are not open. A bus
analyzer could tell us that though, but again I can look at that only
with the drives I have, which I know are working well with FUA.
I am OK with attempting enabling FUA by default for the following reasons:
1) The vast majority of drives in libata blacklist (all features) are
old models that are not sold anymore.
2) We are restricting FUA support to drives that also support NCQ, that
is, modern-ish ones that are supposed to process the FUA NCQ read/write
commands correctly, per specs.
3) For HDDs, which is the vast majority of ATA devices out there these
days, all recent drives I have tested are OK. Even older ones with NCQ
support that I have access to are fine.
4) We are at rc2, which gives us time to revert patch 7 if we see too
many bug reports.
One thing we could add to the patch series is an additional restriction
to enabling FUA by default to drives that support a recent standard. Say
ACS-4 and above. That will restrict this to recent devices, thus
reducing the risk of hitting bad apples. Thoughts ?
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2023-01-05 3:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 5:19 [PATCH v7 0/7] Improve libata support for FUA Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 1/7] block: add a sanity check for non-write flush/fua bios Damien Le Moal
2023-01-03 8:05 ` Niklas Cassel
2023-01-03 12:46 ` Damien Le Moal
2023-01-03 13:02 ` Niklas Cassel
2023-01-04 14:23 ` Ming Lei
2023-01-05 3:54 ` Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 2/7] ata: libata: Introduce ata_ncq_supported() Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 3/7] ata: libata: Rename and cleanup ata_rwcmd_protocol() Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 4/7] ata: libata: cleanup fua support detection Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 5/7] ata: libata: Fix FUA handling in ata_build_rw_tf() Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 6/7] ata: libata: blacklist FUA support for known buggy drives Damien Le Moal
2023-01-03 5:19 ` [PATCH v7 7/7] ata: libata: Enable fua support by default Damien Le Moal
2023-01-04 16:49 ` [PATCH v7 0/7] Improve libata support for FUA Tejun Heo
2023-01-05 3:43 ` Damien Le Moal [this message]
2023-01-05 18:15 ` Tejun Heo
2023-01-06 6:51 ` Damien Le Moal
2023-01-06 18:03 ` Tejun Heo
2023-01-10 13:23 ` Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79260c74-92dd-2cdf-ad71-e70d9fa0f8a9@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=axboe@kernel.dk \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=mail@maciej.szmigiero.name \
--cc=niklas.cassel@wdc.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox