From: Tom Yan <tom.ty89@gmail.com>
To: Hannes Reinecke <hare@suse.de>
Cc: linux-block@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/3] block: set REQ_PREFLUSH to the final bio from __blkdev_issue_zero_pages()
Date: Tue, 8 Dec 2020 20:51:30 +0800 [thread overview]
Message-ID: <CAGnHSE=EXK9H_OzNdBEwQQuQgamCpSSQW76jTLb1ZCzq8ksLnA@mail.gmail.com> (raw)
In-Reply-To: <b18fa5df-2a18-e29c-911b-483dcb451f06@suse.de>
On Mon, 7 Dec 2020 at 00:05, Hannes Reinecke <hare@suse.de> wrote:
>
> On 12/6/20 3:14 PM, Tom Yan wrote:
> > On Sun, 6 Dec 2020 at 22:05, Hannes Reinecke <hare@suse.de> wrote:
> >>
> >> On 12/6/20 2:32 PM, Tom Yan wrote:
> >>> Why? Did you miss that it is in the condition where
> >>> __blkdev_issue_zero_pages() is called (i.e. it's not WRITE SAME but
> >>> WRITE). From what I gathered REQ_PREFLUSH triggers a write back cache
> >>> (that is on the device; not sure about dirty pages) flush, wouldn't it
> >>> be a right thing to do after we performed a series of WRITE (which is
> >>> more or less purposed to get a drive wiped clean).
> >>>
> >>
> >> But what makes 'zero_pages' special as compared to, say, WRITE_SAME?
> >> One could use WRITE SAME with '0' content, arriving at pretty much the
> >> same content than usine zeroout without unmapping. And neither of them
> >> worries about cache flushing.
> >> Nor should they, IMO.
> >
> > Because we are writing actual pages (just that they are zero and
> > "shared memory" in the system) to the device, instead of triggering a
> > special command (with a specific parameter)?
> >
>
> But these pages are ephemeral, and never visible to the user.
What do you mean by the "user"? What I meant was, since it's no
different than "normal" write operation, the zero pages will go to the
volatile write cache of the device.
>
> >>
> >> These are 'native' block layer calls, providing abstract accesses to
> >> hardware functionality. If an application wants to use them, it would be
> >> the task of the application to insert a 'flush' if it deems neccessary.
> >> (There _is_ blkdev_issue_flush(), after all).
> >
> > Well my argument would be the call has the purpose of "wiping" so it
> > should try to "atomically" guarantee that the wiping is synced. It's
> > like a complement to REQ_SYNC in the final submit_bio_wait().
> >
> That's an assumption.
>
> It would be valid if blkdev_issue_zeroout() would only allow to wipe the
> entire disk. As it stands, it doesn't, and so we shouldn't presume what
> users might want to do with it.
Whether it's an entire disk doesn't matter. It still stands when it's
only a certain range of blocks.
>
> Cheers,
>
> Hannes
> --
> Dr. Hannes Reinecke Kernel Storage Architect
> hare@suse.de +49 911 74053 688
> SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
> HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
next prev parent reply other threads:[~2020-12-08 12:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 5:53 [PATCH 1/3] block: try one write zeroes request before going further Tom Yan
2020-12-06 5:53 ` [PATCH 2/3] block: make __blkdev_issue_zero_pages() less confusing Tom Yan
2020-12-06 11:29 ` Hannes Reinecke
2020-12-06 13:28 ` Tom Yan
2020-12-07 13:34 ` Christoph Hellwig
2020-12-08 12:54 ` Tom Yan
2020-12-06 5:53 ` [PATCH 3/3] block: set REQ_PREFLUSH to the final bio from __blkdev_issue_zero_pages() Tom Yan
2020-12-06 11:31 ` Hannes Reinecke
2020-12-06 13:32 ` Tom Yan
2020-12-06 14:05 ` Hannes Reinecke
2020-12-06 14:14 ` Tom Yan
2020-12-06 16:05 ` Hannes Reinecke
2020-12-08 12:51 ` Tom Yan [this message]
2020-12-07 13:35 ` Christoph Hellwig
2020-12-06 11:25 ` [PATCH 1/3] block: try one write zeroes request before going further Hannes Reinecke
2020-12-06 13:25 ` Tom Yan
2020-12-06 13:56 ` Hannes Reinecke
2020-12-06 14:07 ` Tom Yan
2020-12-06 14:28 ` Tom Yan
2020-12-07 13:36 ` Christoph Hellwig
2020-12-08 12:48 ` Tom Yan
2020-12-09 17:51 ` Christoph Hellwig
2020-12-08 22:46 ` Ewan D. Milne
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='CAGnHSE=EXK9H_OzNdBEwQQuQgamCpSSQW76jTLb1ZCzq8ksLnA@mail.gmail.com' \
--to=tom.ty89@gmail.com \
--cc=hare@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.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;
as well as URLs for NNTP newsgroup(s).