From: Adrian Hunter <adrian.hunter@intel.com>
To: Christoph Hellwig <hch@infradead.org>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org,
Wenchao Chen <wenchao.chen666@gmail.com>,
Avri Altman <avri.altman@wdc.com>,
Christian Lohle <cloehle@hyperstone.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Bean Huo <beanhuo@micron.com>
Subject: Re: [PATCH] mmc: core: Allow to avoid REQ_FUA if the eMMC supports an internal cache
Date: Thu, 16 Mar 2023 21:12:35 +0200 [thread overview]
Message-ID: <522a5d01-e939-278a-3354-1bbfb1bd6557@intel.com> (raw)
In-Reply-To: <ZBNIg8+rOdFKcsS8@infradead.org>
On 16/03/23 18:49, Christoph Hellwig wrote:
> On Thu, Mar 16, 2023 at 05:45:14PM +0100, Ulf Hansson wrote:
>> File systems typically uses REQ_FUA for writing their meta-data and other
>> important information. Ideally it should provide an increased protection
>> against data-corruption, during sudden power-failures. This said, file
>> systems have other ways to handle sudden power-failures too, like using
>> checksums to detect partly-written data, for example.
>
> Sorry, but this is completely wrong and dangerous, if not intentionally
> misleading bullshit.
There is some context missing.
Historically file systems have assumed that sectors are updated
atomically i.e. there is never a sector with a mixture of
old and new data. The eMMC spec does not guarantee that,
except for the eMMC "reliable write" operation. So the paragraph
above is informing the potential benefit of reliable write instead
of cache flush.
Note, it is not that eMMC cannot avoid torn sectors, it is that
the specification does not mandate that they do.
However, the issue has been raised that reliable write is not
needed to provide sufficient assurance of data integrity, and that
in fact, cache flush can be used instead and perform better.
This patch adds a card quirk MMC_QUIRK_AVOID_REL_WRITE
that can be set for cards where cache flush outperforms
reliable write. We would expect acks from someone in the
manufacturer's organization on patches setting the quirk, effectively
assuring fitness-for-purpose, and implying that torn sectors are
not especially more likely than any other sort of data integrity
failure.
>
> The only way to provide data integrity is to ensure data is written to
> the media and not a cache. That can be done by a full blown cache
> flush, or with a FUA-like optimization.
The patch is just reporting (via blk_queue_write_cache())
that FUA is not supported, so a flush will be done instead.
next prev parent reply other threads:[~2023-03-16 19:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 16:45 [PATCH] mmc: core: Allow to avoid REQ_FUA if the eMMC supports an internal cache Ulf Hansson
2023-03-16 16:49 ` Christoph Hellwig
2023-03-16 19:12 ` Adrian Hunter [this message]
2023-03-20 6:25 ` Christoph Hellwig
2023-03-20 15:24 ` Ulf Hansson
2023-03-21 12:37 ` Christoph Hellwig
2023-03-21 13:28 ` Ulf Hansson
2023-03-21 10:36 ` Adrian Hunter
2023-03-21 11:03 ` Ulf Hansson
2023-03-21 11:12 ` Adrian Hunter
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=522a5d01-e939-278a-3354-1bbfb1bd6557@intel.com \
--to=adrian.hunter@intel.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=cloehle@hyperstone.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=wenchao.chen666@gmail.com \
/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