Thread (4 messages) 4 messages, 4 authors, 2019-02-27

Re: [LSF/MM TOPIC] More async operations for file systems - async discard?

From: Matthew Wilcox <willy@infradead.org>
Date: 2019-02-27 13:24:55
Also in: linux-block, linux-btrfs, linux-fsdevel, linux-xfs

On Fri, Feb 22, 2019 at 09:45:05AM -0700, Keith Busch wrote:
On Thu, Feb 21, 2019 at 09:51:12PM -0500, Martin K. Petersen wrote:
quoted
Keith,
quoted
With respect to fs block sizes, one thing making discards suck is that
many high capacity SSDs' physical page sizes are larger than the fs
block size, and a sub-page discard is worse than doing nothing.
That ties into the whole zeroing as a side-effect thing.

The devices really need to distinguish between discard-as-a-hint where
it is free to ignore anything that's not a whole multiple of whatever
the internal granularity is, and the WRITE ZEROES use case where the end
result needs to be deterministic.
Exactly, yes, considering the deterministic zeroing behavior. For devices
supporting that, sub-page discards turn into a read-modify-write instead
of invalidating the page.  That increases WAF instead of improving it
as intended, and large page SSDs are most likely to have relatively poor
write endurance in the first place.

We have NVMe spec changes in the pipeline so devices can report this
granularity. But my real concern isn't with discard per se, but more
with the writes since we don't support "sector" sizes greater than the
system's page size. This is a bit of a different topic from where this
thread started, though.
I don't understand how reporting a larger discard granularity helps.
Sure, if the file was written block-by-block in that large granularity
to begin with, then the drive can invalidate an entire page.  But if
even one page of that, say, 256kB block was rewritten, then discarding
the 256kB block will need to discard 252kB from one erase block and 4kB
from another erase block.

So it looks like you really just want to report a larger "optimal IO
size", which I thought we already had.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help