From owner-svn-src-head@freebsd.org Wed Nov 22 16:16:59 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 A350FDEF01E; Wed, 22 Nov 2017 16:16:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26FED7F7D4; Wed, 22 Nov 2017 16:16:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id w23so18839929lfd.11; Wed, 22 Nov 2017 08:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=v2iTT/JM6Ceeeo46LARWBY5dEHz5YGC/zbB8kpb49Xc=; b=g64ndA+WtWrWYMdMlWgUhRxF0bBXLcGx0RcI7kGYwzn7dYGRfjPTpoWh014Sgam2nH bhC2Yw0midMhZb+bxw+N35OB6PP11rOIS1mexOpGLmMfI/Ogly3t7BDx0XMyIVwkN9A8 qm/UpHBVrzCdzq1WZhoQOci6i0T3zd/ahhjdtrDCIXjx6S/8DSzneT+qBI9A4rloscqK tEXy3aKKo0OPF6DLYe4xw186InwHZcZKYcpOMooOWBNKhNYn0rV2H+H3mv2AuEkpKwp6 dpzmK6H5IMIFUcEbI/wcGu+CelxUBjIw350Vkb+pMs2egulcO/ti7cGvNPc2Czsnsytz CLrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=v2iTT/JM6Ceeeo46LARWBY5dEHz5YGC/zbB8kpb49Xc=; b=aEbXYSEa2UeZsR7DlBcYL/gWaQMUw4boYM1YcS8MDz509M7QiQDxV3jRFTSrA6tt/X odhBbAB8HkLJHEelKxL1pk3CU0UYcD45NyeShWHsDpElASAGcMdQ5AJ2k0NM19VJNAYH Otvy5HIsi3KYco7BIPKKqucAPb8dEBGbbKWgUQqRKMFdF6txkF1a/qWo0pZHD/754xv3 TN66WS4BYYptq5xgZiuyXond3Sj2uge3UK1T8zu8RMvxeZw1tLCDyXFrznb+9gzW7zH9 4c70daRgeuLxeY2NL7ztY+QY/COWSn/LBxCbJgDoa9fTCcVzctTZ5/nez6WlcSrkYZYO vVdQ== X-Gm-Message-State: AJaThX6zSOt1036jzP6QRA9Qx8vH7V/uwsJaNgEGVjwXd/v5UlNimsYx LhujNozeWLMtpIwFdcRAoZYBHVhG9NkOu9h2yMw= X-Google-Smtp-Source: AGs4zMaJbokRIspLxM5Cn3MQKC1jplXVghVyanwXb1t94Kcj6gYMq9OCt2UD44AW3VKRs6PXCD9QjAdSCV5y1oUtNl0= X-Received: by 10.46.20.4 with SMTP id u4mr4684447ljd.38.1511367416976; Wed, 22 Nov 2017 08:16:56 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Wed, 22 Nov 2017 08:16:56 -0800 (PST) In-Reply-To: References: <201711202227.vAKMRYvW001932@repo.freebsd.org> From: Alan Somers Date: Wed, 22 Nov 2017 09:16:56 -0700 X-Google-Sender-Auth: agjreehG24IS8_VuLDVKoQTAeRg Message-ID: Subject: Re: svn commit: r326036 - head/sys/cam/scsi To: Ronald Klop Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Justin T. Gibbs" Content-Type: text/plain; charset="UTF-8" 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: Wed, 22 Nov 2017 16:16:59 -0000 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. 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? > > 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"