LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Evan Green <evgreen@chromium.org>
To: martin.petersen@oracle.com
Cc: ming.lei@redhat.com, axboe@kernel.dk,
Gwendal Grignou <gwendal@chromium.org>,
asavery@chromium.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] loop: Better discard support for block devices
Date: Tue, 18 Dec 2018 15:48:15 -0800 [thread overview]
Message-ID: <CAE=gft7X2D-wiikFUqTpdCi40dP_4h74Z=CX=+917_XuhYWvNA@mail.gmail.com> (raw)
In-Reply-To: <CAE=gft7ymeVu0chvCYWn8tw9ss_pZgyUHt=5sSdxfRenDD46Xw@mail.gmail.com>
On Mon, Dec 10, 2018 at 9:31 AM Evan Green <evgreen@chromium.org> wrote:
>
> On Wed, Dec 5, 2018 at 7:15 PM Martin K. Petersen
> <martin.petersen@oracle.com> wrote:
> >
> >
> > Evan,
> >
> > > Ah, I see. But I think it's useful to reflect max_discard_sectors,
> > > max_write_zeroes_sectors, discard_granularity, and discard_alignment
> > > from the block device to the loop device. With the exception of
> > > discard_alignment, these parameters are visible via sysfs,
> >
> > discard_alignment is visible in sysfs, just not in the queue directory
> > since alignment can be different on a per-partition basis. So there is
> > one discard_alignment at the root of each /sys/block/foo directory and
> > one for each partition subdirectory. This mirrors the alignment_offset
> > variable which indicates a partitions alignment wrt. the underlying
> > physical block size.
> >
> > That said, there are not many devices that actually report a non-zero
> > discard alignment so it's not as useful as the device manufacturers
> > (that were looking for an implementation shortcut) envisioned.
>
> Ah ok, thanks.
>
> >
> > > I'm not totally sure about discard_alignment, that seems to be useful
> > > in cases of merging blk requests. So I can stop mirroring that one if
> > > it's harmful or not helpful. But unless it's a nak, I'd really love to
> > > keep most of the mirroring. In which case the bool doesn't do a whole
> > > lot of simplifying.
> >
> > I think it's fine to export these. The block device topology was
> > explicitly designed to be stackable like this.
>
> Yeah, it seemed to fall in pretty naturally, which is why I was hoping
> it might not be so controversial. Thanks Martin.
Any other thoughts about this series?
Ming, I did go back and experiment a little. The pseudocode you had
proposed earlier would work, and solve the error prints I was seeing.
But I still would like to keep the reflection of the block device
properties, since that allows discard to be used on block devices that
do support it.
-Evan
next prev parent reply other threads:[~2018-12-18 23:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 23:06 [PATCH 0/2] loop: Better discard " Evan Green
2018-10-30 23:06 ` [PATCH 1/2] loop: Report EOPNOTSUPP properly Evan Green
2018-11-28 1:06 ` Ming Lei
2018-10-30 23:06 ` [PATCH 2/2] loop: Better discard support for block devices Evan Green
2018-11-26 18:53 ` Evan Green
2018-11-27 2:55 ` Ming Lei
2018-11-27 23:34 ` Evan Green
2018-11-28 1:28 ` Ming Lei
2018-11-28 1:26 ` Ming Lei
2018-12-04 22:19 ` Evan Green
2018-12-05 1:10 ` Ming Lei
2018-12-05 19:35 ` Evan Green
2018-12-06 0:22 ` Ming Lei
2018-12-06 3:15 ` Martin K. Petersen
2018-12-10 17:31 ` Evan Green
2018-12-18 23:48 ` Evan Green [this message]
2018-10-30 23:50 ` [PATCH 0/2] loop: Better discard " Bart Van Assche
2018-11-01 18:15 ` Evan Green
2018-11-01 22:44 ` Gwendal Grignou
2018-11-02 16:02 ` Bart Van Assche
2018-11-05 20:35 ` Evan Green
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='CAE=gft7X2D-wiikFUqTpdCi40dP_4h74Z=CX=+917_XuhYWvNA@mail.gmail.com' \
--to=evgreen@chromium.org \
--cc=asavery@chromium.org \
--cc=axboe@kernel.dk \
--cc=gwendal@chromium.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--subject='Re: [PATCH 2/2] loop: Better discard support for block devices' \
/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
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).