From owner-freebsd-stable@FreeBSD.ORG Wed Jul 24 11:19:46 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 413891F0; Wed, 24 Jul 2013 11:19:46 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.81]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CF8032A47; Wed, 24 Jul 2013 11:19:45 +0000 (UTC) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1V1x6V-0003Hu-60; Wed, 24 Jul 2013 13:19:36 +0200 Received: from [81.21.138.17] (helo=ronaldradial.versatec.local) by smtp.greenhost.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1V1x6V-0006AY-JL; Wed, 24 Jul 2013 13:19:35 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Julian H. Stacey" , "Maurizio Vairani" Subject: Re: [SOLVED] Re: Shutdown problem with an USB memory stick as ZFS cache device References: <201307171529.r6HFT4EK063849@fire.js.berklix.net> <51E79EAD.5040602@cloverinformatica.it> Date: Wed, 24 Jul 2013 13:19:30 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: <51E79EAD.5040602@cloverinformatica.it> User-Agent: Opera Mail/12.16 (Win32) X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.1 X-Scan-Signature: 12808661ad9e64cdb46d03b2a0987e23 Cc: freebsd-fs@freebsd.org, freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jul 2013 11:19:46 -0000 On Thu, 18 Jul 2013 09:52:13 +0200, Maurizio Vairani wrote: > On 17/07/2013 17:29, Julian H. Stacey wrote: >> Maurizio Vairani wrote: >>> On 17/07/2013 11:50, Ronald Klop wrote: >>>> On Wed, 17 Jul 2013 10:27:09 +0200, Maurizio Vairani >>>> wrote: >>>> >>>>> Hi all, >>>>> >>>>> >>>>> on a Compaq Presario laptop I have just installed the latest stable >>>>> >>>>> >>>>> #uname -a >>>>> >>>>> FreeBSD presario 9.2-PRERELEASE FreeBSD 9.2-PRERELEASE #0: Tue Jul 16 >>>>> 16:32:39 CEST 2013 root@presario:/usr/obj/usr/src/sys/GENERIC >>>>> amd64 >>>>> >>>>> >>>>> For speed up the compilation I have added to the pool, tank0, a >>>>> SanDisk memory stick as cache device with the command: >>>>> >>>>> >>>>> # zpool add tank0 cache /dev/da0 >>>>> >>>>> >>>>> But when I shutdown the laptop the process will halt with this screen >>>>> shot: >>>>> >>>>> >>>>> http://www.dump-it.fr/freebsd-screen-shot/2f9169f18c7c77e52e873580f9c2d4bf.jpg.html >>>>> >>>>> >>>>> >>>>> and I need to press the power button for more than 4 seconds to >>>>> switch off the laptop. >>>>> >>>>> The problem is always reproducible. >>>> Does sysctl hw.usb.no_shutdown_wait=1 help? >>>> >>>> Ronald. >>> Thank you Ronald it works ! >>> >>> In /boot/loader.conf added the line >>> hw.usb.no_shutdown_wait=1 >>> >>> Maurizio >> I wonder (from ignorance as I dont use ZFS yet), >> if that merely masks the symptom or cures the fault ? >> >> Presumably one should use a ZFS command to disassociate whatever >> might have the cache open ? (in case something might need to be >> written out from cache, if it was a writeable cache ?) >> >> I too had a USB shutdown problem (non ZFS, now solved)& several people >> made useful comments on shutdown scripts etc, so I'm cross referencing: >> >> http://lists.freebsd.org/pipermail/freebsd-mobile/2013-July/012803.html >> >> Cheers, >> Julian > Probably it masks the symptom. Andriy Gapon hypothesizes a bug in the > ZFS clean up code: > http://lists.freebsd.org/pipermail/freebsd-fs/2013-July/017857.html > > Surely one can use a startup script with the command: > zpool add tank0 cache /dev/da0 > and a shutdown script with: > zpool remove tank0 /dev/da0 > but this mask the symptom too. > > I prefer the Ronald solution because: > - is simpler: it adds only one line (hw.usb.no_shutdown_wait=1) to one > file (/boot/loader.conf). > - is fastest: the zpool add/remove commands take time and > “hw.usb.no_shutdown_wait=1” in /boot/loader.conf speeds up the shutdown > process. > - is cleaner: the zpool add/remove commands pair will fill up the tank0 > pool history. > > Regards > Maurizio Keep an eye on this commit when it is merged to 9-stable. http://svnweb.freebsd.org/changeset/base/253606 It might be the fix of the problem. Ronald.