From owner-svn-src-all@freebsd.org Wed Nov 22 17:45:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C411DF1116; Wed, 22 Nov 2017 17:45:01 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (www.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D27835B6; Wed, 22 Nov 2017 17:45:00 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from greggminer-mba.dhcp.thefacebook.com ([199.201.64.2]) (authenticated bits=0) by aslan.scsiguy.com (8.15.2/8.15.2) with ESMTPSA id vAMHin3h079638 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Nov 2017 10:44:51 -0700 (MST) (envelope-from gibbs@scsiguy.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r326036 - head/sys/cam/scsi From: "Justin T. Gibbs" In-Reply-To: Date: Wed, 22 Nov 2017 10:44:44 -0700 Cc: Ronald Klop , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Justin T. Gibbs" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201711202227.vAKMRYvW001932@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 17:45:01 -0000 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 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 = 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 = 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