Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Nov 2017 10:44:44 -0700
From:      "Justin T. Gibbs" <gibbs@scsiguy.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        Ronald Klop <ronald-lists@klop.ws>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "Justin T. Gibbs" <gibbs@freebsd.org>
Subject:   Re: svn commit: r326036 - head/sys/cam/scsi
Message-ID:  <B67D70C6-5695-4DCD-BE29-D3664A653936@scsiguy.com>
In-Reply-To: <CAOtMX2gkCE-bVqbpd8K0erOGqp_dk5OJ0QKz_Jqc_SE99Dda_w@mail.gmail.com>
References:  <201711202227.vAKMRYvW001932@repo.freebsd.org> <op.y92k58c9kndu52@klop.ws> <CAOtMX2gkCE-bVqbpd8K0erOGqp_dk5OJ0QKz_Jqc_SE99Dda_w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm sure it was to improve the performance of some SSD we were testing =
at Spectra.

--
Justin

> On Nov 22, 2017, at 9:16 AM, Alan Somers <asomers@freebsd.org> wrote:
>=20
> I believe the original motivation was to reduce FLUSH CACHE EXT
> activity with some old SSDs that handled that command very slowly.
> gibbs might know more.
>=20
> On Tue, Nov 21, 2017 at 1:14 PM, Ronald Klop <ronald-lists@klop.ws> =
wrote:
>> Out of curiosity, What is the use case which this improves? Does =
happen in
>> daily usage or mostly in testing?
>>=20
>> Regards,
>> Ronald.
>>=20
>>=20
>>=20
>> On Mon, 20 Nov 2017 23:27:34 +0100, Alan Somers <asomers@freebsd.org> =
wrote:
>>=20
>>> Author: asomers
>>> Date: Mon Nov 20 22:27:33 2017
>>> New Revision: 326036
>>> URL: https://svnweb.freebsd.org/changeset/base/326036
>>>=20
>>> Log:
>>>  da(4): Short-circuit unnecessary BIO_FLUSH commands
>>> sys/cam/scsi/scsi_da.c
>>>        Complete BIO_FLUSH commands immediately if the da(4) device =
hasn't
>>>        been written to since the last flush. If we haven't written =
to the
>>>        device, there is no reason to send a flush.
>>> Submitted by:  gibbs
>>>  Reviewed by:  imp
>>>  MFC after:    3 weeks
>>>  Sponsored by: Spectra Logic Corp
>>>  Differential Revision:        https://reviews.freebsd.org/D13106
>>>=20
>>> Modified:
>>>  head/sys/cam/scsi/scsi_da.c
>>>=20
>>> Modified: head/sys/cam/scsi/scsi_da.c
>>>=20
>>> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
>>> --- head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:18:24 2017        =
(r326035)
>>> +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:27:33 2017        =
(r326036)
>>> @@ -3038,6 +3038,18 @@ more:
>>>                }
>>>                case BIO_FLUSH:
>>>                        /*
>>> +                        * If we don't support sync cache, or the =
disk
>>> +                        * isn't dirty, FLUSH is a no-op.  Use the
>>> +                        * allocated * CCB for the next bio if one =
is
>>> +                        * available.
>>> +                        */
>>> +                       if ((softc->quirks & DA_Q_NO_SYNC_CACHE) !=3D =
0 ||
>>> +                           (softc->flags & DA_FLAG_DIRTY) =3D=3D 0) =
{
>>> +                               biodone(bp);
>>> +                               goto skipstate;
>>> +                       }
>>> +
>>> +                       /*
>>>                         * BIO_FLUSH doesn't currently communicate
>>>                         * range data, so we synchronize the cache
>>>                         * over the whole disk.  We also force
>>> @@ -3052,6 +3064,15 @@ more:
>>>                                               /*lb_count*/0,
>>>                                               SSD_FULL_SIZE,
>>>                                               =
da_default_timeout*1000);
>>> +                       /*
>>> +                        * Clear the dirty flag before sending the
>>> command.
>>> +                        * Either this sync cache will be =
successful, or
>>> it
>>> +                        * will fail after a retry.  If it fails, it =
is
>>> +                        * unlikely to be successful if retried =
later, so
>>> +                        * we'll save ourselves time by just marking =
the
>>> +                        * device clean.
>>> +                        */
>>> +                       softc->flags &=3D ~DA_FLAG_DIRTY;
>>>                        break;
>>>                case BIO_ZONE: {
>>>                        int error, queue_ccb;
>>> _______________________________________________
>>> svn-src-all@freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/svn-src-all
>>> To unsubscribe, send any mail to =
"svn-src-all-unsubscribe@freebsd.org"
>=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B67D70C6-5695-4DCD-BE29-D3664A653936>