[dm-devel] do not disable ext4 discards on first discard failure? [was: Re: dm snapshot: ignore discards issued to the snapshot-origin target]

Mike Snitzer snitzer at redhat.com
Fri Apr 29 13:55:57 UTC 2011


On Thu, Apr 28 2011 at  9:12pm -0400,
Andreas Dilger <adilger.kernel at dilger.ca> wrote:

> On Apr 28, 2011, at 14:59, Mike Snitzer wrote:
> > Eric and I think it is best to revert this commit:
> > a30eec2 ext4: stop issuing discards if not supported by device
> > 
> > (though ideally ext4 would still WARN_ONCE per superblock with something
> > like: "discard failed, please consider disabling discard support")
> > 
> > 1) The user asked for discards (with '-o discard' mount option)
> >   - what is the real harm in coninuing to issue them even if it _seems_
> >     they aren't supported?
> 
> Aren't discard operations considered barriers?  If there are needless
> discard operations being sent to the disk then it seems like this
> would have a non-zero performance penalty, just by virtue of blocking
> IO submissions at the block device layer.

The blkdev_issue_discard() interface is synchronous.  Given that, yes it
will cause jbd2 to block waiting for it to complete.

For DM, the discard would not actually be issued to the physical storage
there is still work that would be done to submit the bio only to have DM
return -EOPNOTSUPP.

But ext4 doesn't care if it is on DM or not; so I agree that cost of
continuing to issue discards would be higher on non-DM storage.

That said, the user asked for discards via -o discard.  Ext4 is taking
that to mean "no the user only _really_ asked for discards if they will
always work".

If ext4 is committed to that disable-on-first-failure hueristic then
Documentation/filesystems/ext4.txt should probably speak to it.
 
> > 2) assuming the entire block device uniformly supports discards can
> >   be flawed (a DM device's discard support can vary based on logical
> >   offset).
> 
> Hybrid storage is potentially an increasingly popular configuration.
> We've been looking at DM-mapped SSD RAID-1 + HDD RAID-6 arrays for
> ext4 to allow storing only the metadata on SSD.

Meaning you assemble a tailormade DM linear (concat) device that mixes
the two?  What are you using to assemble that device -- presummably some
code that is aware of ext4's metadata and data layout?  Code hooked off
of mkfs?

> That said, it may
> make sense to have the DM translation layer check the component
> devices of an LV to see if discard is supported on any of them, and
> only return -EOPNOTSUPP if none of them do.

That is what DM does.  DM will only return -EOPNOTSUPP if a particular
target doesn't support discards.  If only one device supports discards
then the entire logical DM device advertises discard support.

Mike



More information about the dm-devel mailing list