All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	sandeen@redhat.com, DarkNovaNick@gmail.com, linux-lvm@redhat.com,
	linux-ext4@vger.kernel.org, Alasdair G Kergon <agk@redhat.com>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target]
Date: Mon, 2 May 2011 08:48:04 -0400	[thread overview]
Message-ID: <20110502124803.GA31034@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1105021217080.3778@dhcp-27-109.brq.redhat.com>

On Mon, May 02 2011 at  6:24am -0400,
Lukas Czerner <lczerner@redhat.com> wrote:

> On Mon, 2 May 2011, Christoph Hellwig wrote:
> 
> > On Mon, May 02, 2011 at 09:13:08AM +0100, Alasdair G Kergon wrote:
> > > On Mon, May 02, 2011 at 09:16:21AM +0200, Lukas Czerner wrote:
> > > > However when we have dm device where part of the device supports
> > > > discard due to underlying hardware capability we just can not return
> > > > EOPNOTSUPP from blkdev_issue_discard, because it is just not true! 
> > > 
> > > EOPNOTSUPP from dm means the operation was not supported on that *one* bio.
> > > It does *not* tell you anything in general about the device, or whether
> > > you'd get the same error from different bios in future.
> > 
> > Exactly.  We already have the information in the queue limits to tell
> > the filesystem if discard is supported at all or not.
> > 
> 
> So I gave it a try. First of all the device composed of SSD and spinning
> disk does export discard_support information properly, however it also
> advertise discard_zeroes_data which is wrong and possibly dangerous and
> should be fixed!

You're effectively advocating that blk_stack_limits() needs to clear the
topmost device's discard_zeroes_data flag if any one bottom device does
not have discard_zeroes_data.

> And second of all, strictly speaking if EOPNOTSUPP from dm means that
> operation was not supported on that *one* bio, blkdev_issue_discard()
> should handle that and do not return EOPNOTSUPP further if queue limits
> tells that device has discard support. Is this acceptable solution for
> you guys ? I can make that change since I am changing blkdev_issue_discard()
> anyway. Or, we can make that change in filesystem where we disable
> discard on mount time, when we notice that discard mount option was
> specified, but the device does not support it (we should probably do
> this regardless on blkdev_issue_discard() change).

The blkdev_issue_discard() change you propose could be fine (mask
EOPNOTSUPP return if device advertises support for discards) -- though
Eric said we shouldn't ever say we did something when we didn't.

But that blkdev_issue_discard() change is really only safe if the
discard_zeroes_data flag is cleared by blk_stack_limits() if finds
inconsistent discard_zeroes_data support.

Mike

WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Lukas Czerner <lczerner@redhat.com>
Cc: sandeen@redhat.com, Christoph Hellwig <hch@infradead.org>,
	device-mapper development <dm-devel@redhat.com>,
	DarkNovaNick@gmail.com, linux-lvm@redhat.com,
	linux-ext4@vger.kernel.org, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [linux-lvm] do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target]
Date: Mon, 2 May 2011 08:48:04 -0400	[thread overview]
Message-ID: <20110502124803.GA31034@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1105021217080.3778@dhcp-27-109.brq.redhat.com>

On Mon, May 02 2011 at  6:24am -0400,
Lukas Czerner <lczerner@redhat.com> wrote:

> On Mon, 2 May 2011, Christoph Hellwig wrote:
> 
> > On Mon, May 02, 2011 at 09:13:08AM +0100, Alasdair G Kergon wrote:
> > > On Mon, May 02, 2011 at 09:16:21AM +0200, Lukas Czerner wrote:
> > > > However when we have dm device where part of the device supports
> > > > discard due to underlying hardware capability we just can not return
> > > > EOPNOTSUPP from blkdev_issue_discard, because it is just not true! 
> > > 
> > > EOPNOTSUPP from dm means the operation was not supported on that *one* bio.
> > > It does *not* tell you anything in general about the device, or whether
> > > you'd get the same error from different bios in future.
> > 
> > Exactly.  We already have the information in the queue limits to tell
> > the filesystem if discard is supported at all or not.
> > 
> 
> So I gave it a try. First of all the device composed of SSD and spinning
> disk does export discard_support information properly, however it also
> advertise discard_zeroes_data which is wrong and possibly dangerous and
> should be fixed!

You're effectively advocating that blk_stack_limits() needs to clear the
topmost device's discard_zeroes_data flag if any one bottom device does
not have discard_zeroes_data.

> And second of all, strictly speaking if EOPNOTSUPP from dm means that
> operation was not supported on that *one* bio, blkdev_issue_discard()
> should handle that and do not return EOPNOTSUPP further if queue limits
> tells that device has discard support. Is this acceptable solution for
> you guys ? I can make that change since I am changing blkdev_issue_discard()
> anyway. Or, we can make that change in filesystem where we disable
> discard on mount time, when we notice that discard mount option was
> specified, but the device does not support it (we should probably do
> this regardless on blkdev_issue_discard() change).

The blkdev_issue_discard() change you propose could be fine (mask
EOPNOTSUPP return if device advertises support for discards) -- though
Eric said we shouldn't ever say we did something when we didn't.

But that blkdev_issue_discard() change is really only safe if the
discard_zeroes_data flag is cleared by blk_stack_limits() if finds
inconsistent discard_zeroes_data support.

Mike

  reply	other threads:[~2011-05-02 12:48 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 14:59 [linux-lvm] Testing TRIM with LVM DarkNovaNick
2011-04-12 23:47 ` Mike Snitzer
2011-04-13  1:47   ` DarkNovaNick
2011-04-13  8:41     ` Zdenek Kabelac
2011-04-13 15:38       ` DarkNovaNick
2011-04-13 22:40     ` [PATCH] dm snapshot: add discard support to the snapshot-origin target [was: Re: Testing TRIM with LVM] Mike Snitzer
2011-04-13 22:40       ` [linux-lvm] " Mike Snitzer
2011-04-13 23:48       ` Mike Snitzer
2011-04-13 23:48         ` [linux-lvm] " Mike Snitzer
2011-04-26 17:32         ` Mike Snitzer
2011-04-26 17:32           ` [linux-lvm] " Mike Snitzer
2011-04-28  0:19           ` [PATCH] dm snapshot: ignore discards issued to the snapshot-origin target Mike Snitzer
2011-04-28  0:19             ` [linux-lvm] " Mike Snitzer
2011-04-28  7:53             ` Christoph Hellwig
2011-04-28  7:53               ` [linux-lvm] [dm-devel] " Christoph Hellwig
2011-04-28 20:59               ` do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target] Mike Snitzer
2011-04-28 20:59                 ` [linux-lvm] " Mike Snitzer
2011-04-28 21:28                 ` Eric Sandeen
2011-04-28 21:28                   ` [linux-lvm] " Eric Sandeen
2011-04-28 22:59                   ` Alasdair G Kergon
2011-04-28 22:59                     ` Alasdair G Kergon
2011-04-28 23:01                     ` Eric Sandeen
2011-04-28 23:01                       ` Eric Sandeen
2011-04-28 23:11                       ` Alasdair G Kergon
2011-04-28 23:11                         ` Alasdair G Kergon
2011-04-29  1:12                 ` Andreas Dilger
2011-04-29  1:12                   ` [linux-lvm] " Andreas Dilger
2011-04-29 13:55                   ` Mike Snitzer
2011-04-29 13:55                     ` [linux-lvm] " Mike Snitzer
2011-04-29  9:30                 ` Lukas Czerner
2011-04-29  9:30                   ` [linux-lvm] " Lukas Czerner
2011-04-29 12:24                   ` [dm-devel] " Alasdair G Kergon
2011-04-29 12:24                     ` [linux-lvm] " Alasdair G Kergon
2011-04-29 12:29                     ` Christoph Hellwig
2011-04-29 12:29                       ` [linux-lvm] " Christoph Hellwig
2011-04-29 14:28                       ` Eric Sandeen
2011-04-29 14:28                         ` [linux-lvm] " Eric Sandeen
2011-04-29 15:13                         ` Ray Morris
2011-04-29 15:13                           ` Ray Morris
2011-05-04 16:33                         ` Ted Ts'o
2011-05-04 16:33                           ` [linux-lvm] " Ted Ts'o
2011-05-04 16:51                           ` Eric Sandeen
2011-05-04 16:57                             ` Lukas Czerner
2011-05-04 17:02                           ` Lukas Czerner
2011-05-04 17:02                             ` [linux-lvm] " Lukas Czerner
2011-05-02  7:16                     ` Lukas Czerner
2011-05-02  7:16                       ` [linux-lvm] " Lukas Czerner
2011-05-02  8:13                       ` Alasdair G Kergon
2011-05-02  8:13                         ` [linux-lvm] " Alasdair G Kergon
2011-05-02  8:19                         ` Christoph Hellwig
2011-05-02  8:19                           ` [linux-lvm] " Christoph Hellwig
2011-05-02 10:24                           ` Lukas Czerner
2011-05-02 10:24                             ` [linux-lvm] " Lukas Czerner
2011-05-02 12:48                             ` Mike Snitzer [this message]
2011-05-02 12:48                               ` [linux-lvm] " Mike Snitzer
2011-05-02 13:05                               ` Lukas Czerner
2011-05-02 13:05                                 ` [linux-lvm] " Lukas Czerner
2011-05-02 14:47                                 ` Eric Sandeen
2011-05-02 14:47                                   ` [linux-lvm] " Eric Sandeen
2011-05-02 14:48                                   ` Christoph Hellwig
2011-05-02 14:48                                     ` [linux-lvm] " Christoph Hellwig
2011-05-02 14:58                                   ` Lukas Czerner
2011-05-02 14:58                                     ` [linux-lvm] " Lukas Czerner
2011-05-02 13:48                             ` [dm-devel] " Martin K. Petersen
2011-05-02 13:48                               ` [linux-lvm] " Martin K. Petersen
2011-05-02 14:20                             ` Martin K. Petersen
2011-05-02 14:20                               ` [linux-lvm] [dm-devel] " Martin K. Petersen
2011-05-02 14:39                               ` Lukas Czerner
2011-05-02 14:39                                 ` [linux-lvm] " Lukas Czerner
2011-05-02 14:50                                 ` Martin K. Petersen
2011-05-02 14:50                                   ` [linux-lvm] " Martin K. Petersen
2011-05-02 14:58                                 ` Mike Snitzer
2011-05-02 14:58                                   ` [linux-lvm] " Mike Snitzer
2011-05-02 16:58                                 ` [dm-devel] " Martin K. Petersen
2011-05-02 16:58                                   ` [linux-lvm] " Martin K. Petersen
2011-05-03  8:57                                   ` Lukas Czerner
2011-05-03  8:57                                     ` [linux-lvm] " Lukas Czerner
2011-05-04 15:10                                     ` Martin K. Petersen
2011-05-04 15:10                                       ` [linux-lvm] " Martin K. Petersen
2011-05-04 16:02                                       ` Mike Snitzer
2011-05-04 16:02                                         ` [linux-lvm] " Mike Snitzer
2011-05-04 16:50                                         ` Martin K. Petersen
2011-05-04 16:50                                           ` [linux-lvm] " Martin K. Petersen
2011-05-04 18:03                                           ` Mike Snitzer
2011-05-04 18:03                                             ` [linux-lvm] " Mike Snitzer
2011-05-04 17:10                                       ` [dm-devel] " Lukas Czerner
2011-05-04 17:10                                         ` [linux-lvm] " Lukas Czerner
2011-05-04 17:32                                         ` Martin K. Petersen
2011-05-04 17:32                                           ` [linux-lvm] " Martin K. Petersen
2011-05-04 17:35                                           ` Lukas Czerner
2011-05-04 17:35                                             ` [linux-lvm] " Lukas Czerner
2011-05-18 12:16                                       ` Mike Snitzer
2011-05-18 12:16                                         ` [linux-lvm] " Mike Snitzer
2011-05-18 12:52                                         ` Mike Snitzer
2011-05-18 12:52                                           ` [linux-lvm] " Mike Snitzer
2011-05-04 15:16                                     ` [dm-devel] " Martin K. Petersen
2011-05-04 15:16                                       ` [linux-lvm] " Martin K. Petersen
2011-05-04 16:12                                       ` Lukas Czerner
2011-05-04 16:12                                         ` [linux-lvm] " Lukas Czerner
2011-05-05  8:33                                       ` Karel Zak
2011-05-05  8:33                                         ` [linux-lvm] " Karel Zak
2011-05-05 10:48                                         ` Lukas Czerner
2011-05-05 10:48                                           ` [linux-lvm] " Lukas Czerner
2011-04-14 15:31       ` [linux-lvm] [PATCH] dm snapshot: add discard support to the snapshot-origin target [was: Re: Testing TRIM wi DarkNovaNick

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=20110502124803.GA31034@redhat.com \
    --to=snitzer@redhat.com \
    --cc=DarkNovaNick@gmail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-lvm@redhat.com \
    --cc=sandeen@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.