From owner-svn-src-head@freebsd.org Tue Nov 21 20:23:19 2017 Return-Path: Delivered-To: svn-src-head@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 2382AD9364A; Tue, 21 Nov 2017 20:23:19 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBE187E753; Tue, 21 Nov 2017 20:23:18 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eHF4X-0001Sr-Iu; Tue, 21 Nov 2017 21:23:09 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Alan Somers" Subject: Re: svn commit: r326036 - head/sys/cam/scsi References: <201711202227.vAKMRYvW001932@repo.freebsd.org> Date: Tue, 21 Nov 2017 21:14:22 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201711202227.vAKMRYvW001932@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 388a8ff653e0601f0215f26536afca72 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 20:23:19 -0000 Out of curiosity, What is the use case which this improves? Does happen in daily usage or mostly in testing? Regards, Ronald. On Mon, 20 Nov 2017 23:27:34 +0100, Alan Somers wrote: > Author: asomers > Date: Mon Nov 20 22:27:33 2017 > New Revision: 326036 > URL: https://svnweb.freebsd.org/changeset/base/326036 > > 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 > > Modified: > head/sys/cam/scsi/scsi_da.c > > Modified: head/sys/cam/scsi/scsi_da.c > ============================================================================== > --- 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) != 0 || > + (softc->flags & DA_FLAG_DIRTY) == 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 &= ~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"