svn commit: r330932 - in head/sys: cam/nvme dev/nvme

Warner Losh imp at bsdimp.com
Wed Mar 14 17:16:59 UTC 2018


On Wed, Mar 14, 2018 at 11:08 AM, Ravi Pokala <rpokala at mac.com> wrote:

> Hi Warner,
>
> The TRIM command takes a buffer of range structures, and this change
> consolidates multiple range structures into the buffer for a single TRIM
> command, correct? Whereas the old functionality was to populate the buffer
> with a single range structure?
>
> So if we wanted to trim ranges [P..T], [A..E], [K..O], the old
> functionality would be:
>
>     TRIM:[P..T] ; TRIM:[A..E] ; TRIM:[K..O]
>
> The new functionality would be:
>
>     TRIM:[P..T], [A..E], [K..O]
>
> Right?


Correct. This helps a lot, at least for the drives I have access to. I'm
working on adaptive features to allow us to know when it will help.

> +                             /* XXX -- Could collapse adjacent ranges,
> but we don't for now */
> > +                             /* XXX -- Could limit based on total
> payload size */
>
> And that future enhancement would make it:
>
>     TRIM:[A..E], [K..T]
>


> Is that correct?
>

Yes. That's right. This code doesn't do that now. We also need to work on
read biasing and a few other things as well, independent of what we send
down to the driver. That's the scheduling bits. Some of the dynamic stuff
will be only in the dynamic scheduler, but we need to not do trims first. I
think that a strategy of collecting N BIO_DELETEs before we send down the
DSM TRIM to the drive rather than sending them down asap would be useful
(with some reasonable timeout so things don't get stuck for too long).
Collecting TRIMs don't hang anything in the system, except reclaiming
blocks on delete, as far as I can tell...  I accidentally queued 10M trims
and didn't drain them for 8 hours w/o anybody but the graphs for the
machine that report queue length noticing...

Warner


> Thanks,
>
> Ravi (rpokala@)
>
> -----Original Message-----
> From: <owner-src-committers at freebsd.org> on behalf of Warner Losh
> <imp at FreeBSD.org>
> Date: 2018-03-14, Wednesday at 09:44
> To: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <
> svn-src-head at freebsd.org>
> Subject: svn commit: r330932 - in head/sys: cam/nvme dev/nvme
>
> > Author: imp
> > Date: Wed Mar 14 16:44:50 2018
> > New Revision: 330932
> > URL: https://svnweb.freebsd.org/changeset/base/330932
> >
> > Log:
> >   Implement trim collapsing in nda
> >
> >   When multiple trims are in the queue, collapse them as much as
> >   possible. At present, this usually results in only a few trims being
> >   collapsed together, but more work on that will make it possible to do
> >   hundreds (up to some configurable max).
> >
> >   Sponsored by: Netflix
>
>
>
>


More information about the svn-src-head mailing list