From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 10 15:14:07 2012 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 05E4F106566B; Tue, 10 Jan 2012 15:14:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D14888FC16; Tue, 10 Jan 2012 15:14:06 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 8915E46B09; Tue, 10 Jan 2012 10:14:06 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EC9DBB962; Tue, 10 Jan 2012 10:14:05 -0500 (EST) From: John Baldwin To: Andriy Gapon Date: Tue, 10 Jan 2012 08:43:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <4EED20C7.1090704@FreeBSD.org> <201112200911.43880.jhb@freebsd.org> <4F0C11B1.1070508@FreeBSD.org> In-Reply-To: <4F0C11B1.1070508@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201100843.30893.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Jan 2012 10:14:06 -0500 (EST) Cc: freebsd-hackers@freebsd.org Subject: Re: RB_NOSYNC -> no device_shutdown ? 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: Tue, 10 Jan 2012 15:14:07 -0000 On Tuesday, January 10, 2012 5:23:45 am Andriy Gapon wrote: > on 20/12/2011 16:11 John Baldwin said the following: > > On Saturday, December 17, 2011 6:07:51 pm Andriy Gapon wrote: > [snip] > >> and wonder why RB_NOSYNC is overloaded to mean that no > >> MOD_SHUTDOWN/device_shutdown cleanup should be done? > > > > Presumably most device_shutdown handlers were used for syncing storage when > > the module stuff was first added. I'm not sure how you would fix this now > > since you can't easily pass the 'arg2' flags down to each handler so that the > > appropriate ones could skip their shutdown actions. > > I see what you are saying. > Couple of thoughts: > - maybe MOD_EVENT interface could/should be extended to pass another argument > along with the event type > - maybe various sync-ing stuff should be done in shutdown_post_sync event > handlers, or even via a new dedicated event > > Hmm, it looks like the latter might actually already be the case. I almost think the best way (ugh) is to have a global variable similar to boothowto that device_shutdown methods can use to skip behavior if needed. It may only be a fairly small number of devices that need to skip their shutdown routine (or portions thereof) during a nosync shutdown. > And another tangentially related idea: maybe we should inhibit device/module > shutdown for the RB_HALT case given that it is a quite special case where the > system actually stays up and at least the keyboard is expected to be still > operational. I think we still want to do device_shutdown in that case. The mfi(4) driver sends a specific command to note a clean shutdown that then affects how the event log behaves on the next boot, for example. -- John Baldwin