From owner-svn-src-all@freebsd.org Fri Oct 27 15:55:25 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 4F6EBE4A97B for ; Fri, 27 Oct 2017 15:55:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 0D27A6D756 for ; Fri, 27 Oct 2017 15:55:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id m81so13651897ioi.13 for ; Fri, 27 Oct 2017 08:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=pE+Pqb7W2dUNsbw4Mu/s91akfnY8zBuX003ZzHwMUTQ=; b=EcC46Uj2FNl3UoMZjxg3c3XdPrFzse10fMbzkjPpc6x8rtRHCBk3mQkcE/iKtPlYl/ 4AvDJiqhHYFJ8VrLbA9NTz50Tt2w+3vbeh90Gus070qjdJEwOLzu6SftO6kuo8Gd4wwC y+0GNUe9aKxLEwSvELm4s+gHe2SMmxRgJVW0oDBGqJy2z/swaHt5h2iMACTmGLj1Qtom KA3NuxjDbE7iQqylc5PMNGynePAFdE8Y0w+o2vANILuVr4Xb/Srmp/XVBVfrApuYEy7K Ha/d6wyJLY491A8o/Z8l0eXDM4LT3a5lRG+hc0eXfYIYPdweWP4WVXU7rxE1Z988sahR 7RZQ== 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=pE+Pqb7W2dUNsbw4Mu/s91akfnY8zBuX003ZzHwMUTQ=; b=mtbgUiAWAaPHN1Tp22rP/Xr0ybK0NN+Z95v22Kgm+TZys6hGMZOf9w+bzZqQ475mkh riokr71iexxNhFqASOx1Fa08nOnCKD5Y0wDJY/45rEKSk89r1OAdZmgMGJpkYq/L6ZBk F6a31rqDS8BdwrTiWk5J2HA2NVYrnccry4CuMxNHC0wXCENxLolVC7UecPsWTPBsDao4 52P5zSF1FNFWI83JY7BlimW6xQ6qQ0DPVDxtebak/Cnu7HWq1M4hESpiey8su0Q7brir zrgK0MwpEijDPk/LTIM/kF0XAPTGN7cQpgpFerruywPNGBqI9R5XzIxTaR+1bTKCXUIr JEDA== X-Gm-Message-State: AMCzsaWlueC1URnVClYJShBaB31GawBDe4ug1s1LRCHJOgl9IBLejj1R 844Si69jli2FUc8orwIP5+1HMBDmw95lN4o1d+AgZQ== X-Google-Smtp-Source: ABhQp+TFVoESwgtSifRDrHLI5MTOrjNHKdwFIdfxneJLT6gOpufjuETwRvAVS4CP6OMTzR/kimvMkQovMTP22qSOs6M= X-Received: by 10.36.94.129 with SMTP id h123mr1162297itb.64.1509119724464; Fri, 27 Oct 2017 08:55:24 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Fri, 27 Oct 2017 08:55:23 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:68f3:90da:7630:94a5] In-Reply-To: <1509119530.56824.75.camel@freebsd.org> References: <201710262253.v9QMrovZ009495@repo.freebsd.org> <1509119530.56824.75.camel@freebsd.org> From: Warner Losh Date: Fri, 27 Oct 2017 09:55:23 -0600 X-Google-Sender-Auth: NBQL_P0rfdGi_78-cezJryXUYrc Message-ID: Subject: Re: svn commit: r325026 - head/sys/cam/ata To: Ian Lepore Cc: Alan Somers , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 27 Oct 2017 15:55:25 -0000 On Fri, Oct 27, 2017 at 9:52 AM, Ian Lepore wrote: > On Thu, 2017-10-26 at 20:27 -0600, Warner Losh wrote: > > On Thu, Oct 26, 2017 at 5:35 PM, Warner Losh wrote: > > > > > > > > > > > > > > On Thu, Oct 26, 2017 at 5:04 PM, Alan Somers > wrote: > > > > > > > > > > > On Thu, Oct 26, 2017 at 4:53 PM, Warner Losh > wrote: > > > > > > > > > > Author: imp > > > > > Date: Thu Oct 26 22:53:49 2017 > > > > > New Revision: 325026 > > > > > URL: https://svnweb.freebsd.org/changeset/base/325026 > > > > > > > > > > Log: > > > > > Always send STANDBY IMMEDIATE when shutting down > > > > > > > > > > To save SMART data and for a drive to understand that it's been > nicely > > > > > shutdown, we need to send a STANDBY IMMEDIATE. Modify > adaspindown to > > > > > use a local CCB on the stack. When we're panicing, used > > > > > xpt_polled_action rather than cam_periph_runccb so that we can > SEND > > > > > IMMEDIATE after we've shutdown the scheduler. > > > > > > > > > > Sponsored by: Netflix > > > > > Reviewed by: scottl@, gallatin@ > > > > > Differential Revision: https://reviews.freebsd.org/D12799 > > > > > > > > > > Modified: > > > > > head/sys/cam/ata/ata_da.c > > > > Will this put the drive into a standby state just prior to a warm > > > > reboot? That could cause lengthy delays on the new boot while the > > > > drives spin up. That behavior caused a problem when the mpr driver > > > > did it to a JBOD full of 96 SATA drives. On the new boot, each drive > > > > spun up one at a time while they were being probed. Eventually the > > > > system paniced because run_interrupt_driven_hooks timed out. With > > > > mpr, I was able to fix the problem by setting hw.mpr.enable_ssu=0. > > > > > > > That's a good question. The standard is silent about what, exactly, the > > > Standby state means. We already allow this to be disabled, and this > commit > > > doesn't change that. It looks like IDLE IMMEDIATE also forces SMART > media > > > non volatile to be flushed out. > > > > > > What do you suggest? > > > > > I see two paths forward. We need to flush the NV SMART data at reboot > time. > > SSDs that we use, at least, consider it an unclean shutdown if you don't > > Idle the drive on reboot because part of that process does a > > COMINIT/COMRESET and if the drive is in the Active state, it ticks up the > > counter (and with at least one vendor can lose NV SMART data). > > > > So, path forward #1 is that we do STANDBY IMMEDIATE for SSDs in the > > RB_REBOOT case or all drives in the other cases. For HDD and RB_REBOOT we > > do only a IDLE IMMEDIATE which shouldn't spin the drives down. > > IDLE will actually spin drives up -- my 'spinup' script is just a > series of 'camcontrol idle ada#' commands for all the backup drives > that are usually in standby. > > If IDLE does the necessary flushing, then why not STANDBY in the power- > down/cycle case and IDLE in all other cases, regardless of drive type? > The only point in using STANDBY at all would be to avoid spinning up > drives just before powering them down. https://reviews.freebsd.org/D12811 does exactly this. Alan suggested something similar. Maybe you could "give it a spin" on that crazy system of yours we chatted about on IRC and see if that helps... Warner > > -- Ian > > > This seems > > to bake in what we know about storage devices and is easiest for the > user. > > If we get it right, it's easier for the user. If we get it wrong, the > user > > can disable all spin downs. > > > > Path forward #2 is to just make what we send a sysctl. This is > unsatisfying > > and error-prone, but gives the most flexibility. I don't like this. > > > > I'd be curious if there's another viable path forward I'm not seeing that > > you might know. > > > > FWIW, we don't connect HDDs to our AHCI ports (they are all on > MPT/MPS/MPR > > HBAs), so we've not seen any issues in the 6 or so months we've had this > in > > the tree. > > > > Warner >