From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 16 02:37:36 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEEBF106566C; Thu, 16 Sep 2010 02:37:36 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 880148FC14; Thu, 16 Sep 2010 02:37:36 +0000 (UTC) Received: by iwn34 with SMTP id 34so774086iwn.13 for ; Wed, 15 Sep 2010 19:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=9IksdNRsHV2L49om2obd0n78exIv00WjA9NH9KFrdhI=; b=K2iRRGLdVIM3JfuU29yySB+pxQc6UNVJ5CKnuOkpBqibln5vakfX0Ujd0z4cC0+IMg eV26FplHn2VSvSwGs7k0kccwzk6iow534HPYrVGV+4tMVSwdFil5zvxY5MFVFMRWHin3 g9RXfdtPFOC47kxIf7nLzcxwdtFS5LNXWQ338= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=VsHJ6HVq3oeWiO6F+ax7oy9E5OJNI8gAadm/lSlU5Vn3xryfpHczj6GN39RTezuo4P ccOS/O6dr0KprtclUjJG0lZ9NZUBDrbP59sMuXdBwl8pLafvGQUtcKPy39av9SF9eM1i swKx4m9NE8EoehvPkXeEN0VnSXOROiCl9RDEw= MIME-Version: 1.0 Received: by 10.231.152.143 with SMTP id g15mr2684794ibw.76.1284604655652; Wed, 15 Sep 2010 19:37:35 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.11.133 with HTTP; Wed, 15 Sep 2010 19:37:35 -0700 (PDT) In-Reply-To: <20100916004902.GA46401@freebsd.org> References: <201009152143.o8FLhE9p022233@lurza.secnetix.de> <20100916004902.GA46401@freebsd.org> Date: Wed, 15 Sep 2010 19:37:35 -0700 X-Google-Sender-Auth: jIrTdal_NsRjXlp-o-lqsIx6KQU Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, mav@freebsd.org, Oliver Fromme Subject: Re: Summary: Re: Spin down HDD after disk sync or before power off X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2010 02:37:37 -0000 On Wed, Sep 15, 2010 at 5:49 PM, Alexander Best wrote= : > On Wed Sep 15 10, Oliver Fromme wrote: >> Warren Block wrote: >> =A0> [...] >> =A0> 8. Alexander Motin has an updated CAM version of the ATA system whi= ch >> =A0> will eventually replace the existing one. =A0In -CURRENT, anyway. = =A0He was >> =A0> kind enough to look at my event handler. =A0My understanding is tha= t he is >> =A0> looking at implementing the head parking/standby mechanism in that = new >> =A0> code. >> >> The patch below will work with the new CAM ATA driver >> (i.e. ada(4) disks). =A0It adds a sysctl, so you can switch >> the spin-down off if you're going to just reboot: >> # sysctl kern.cam.ada.spindown_shutdown=3D0 > > i haven't tested your patch yet, but i don't think deciding whether to sp= in > down the hdd should be decided merely from the sysctl value. > > the hdd should spindown when a shutdown has been issued and not spindown, > if a reboot has been issued. > > either people have the sysctl set to 1 in which case a reboot will cause = a > spindown (which isn't healthy for the hdd) > ...or people will set it to 0 in which case everything remains just the w= ay it > is. > > imo the sysctl should stay, but shuld have a different meaning. if it is = set to > 1 (which should be the default) a shutdown will issue a spindown; a reboo= t > won't. > if for some reason people want back the current behavior (no spindown eve= n > during a shutdown) they need to set it to 0. Agreed. Spinning down at reboot isn't smart and seems like a good way to kill a disk quicker. > deciding whether freebsd reboots or shuts down cannot be done from a scri= pt, > since users might use the reboot or halt commands in which case (if i'm n= ot > mistaken) all shutdown scripts get skipped. I'm not so sure of that statement, in particular because halt(8), reboot(8), and shutdown(8) send SIGTERM to processes (unless you use halt -q / reboot -q ... there might be some other scenarios I'm not envisioning here). Thanks, -Garrett