From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
vsementsov@virtuozzo.com, kwolf@redhat.com
Subject: Re: [Qemu-devel] [PATCH] nbd/server: Honor FUA request on NBD_CMD_TRIM
Date: Thu, 8 Mar 2018 16:22:47 +0100 [thread overview]
Message-ID: <c316b5e0-932f-6de0-ac19-41d12730201c@redhat.com> (raw)
In-Reply-To: <8b5bee3a-c30b-38da-b861-bceebad9b57e@redhat.com>
On 08/03/2018 15:45, Eric Blake wrote:
> On 03/08/2018 12:50 AM, Paolo Bonzini wrote:
>>> The NBD spec states that since trim requests can affect disk contents,
>>> then they should allow for FUA semantics just like writes for ensuring
>>> the disk has settled before returning. As bdrv_[co_]pdiscard() does
>>> not (yet?) support a flags argument, we can't pass FUA down the block
>>> layer stack, and must therefore emulate it with a flush at the NBD
>>> layer.
>>
>> TRIM requests should not need FUA since they're just advisory.
>
> Still, while you argue that TRIM is advisory (which I agree), if it does
> nothing, then you've (implicitly) honored FUA (that transaction didn't
> affect persistent storage, so you didn't have to wait any longer for
> anything to land); but if it DOES change the disk contents, then waiting
> for that change to land IS worth supporting, hence why the NBD protocol
> requires the FUA flag to be honored on trim.
But if power fails, after restart you cannot see the difference between
a TRIM command that chose to did nothing, and one that chose to change
the disk contents but failed to persist the changes. This is why I
thought there is no need for FUA in my opinion.
I suppose in principle you could detect the change by reading the
TRIMmed sectors and writing to another disk. So TRIM would have to be a
Schroedinger command that is persistent once you read the sectors, and
that makes little sense. The problem is, SCSI doesn't have a FUA flag
either...
Paolo
next prev parent reply other threads:[~2018-03-08 15:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 22:57 [Qemu-devel] [PATCH] nbd/server: Honor FUA request on NBD_CMD_TRIM Eric Blake
2018-03-08 6:50 ` Paolo Bonzini
2018-03-08 14:45 ` Eric Blake
2018-03-08 15:22 ` Paolo Bonzini [this message]
2018-03-08 16:05 ` Eric Blake
2018-03-12 22:30 ` Eric Blake
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=c316b5e0-932f-6de0-ac19-41d12730201c@redhat.com \
--to=pbonzini@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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;
as well as URLs for NNTP newsgroup(s).