From owner-freebsd-hackers Fri Feb 6 10:48:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA01229 for hackers-outgoing; Fri, 6 Feb 1998 10:48:31 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from misery.sdf.com (misery.sdf.com [204.244.213.32]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA01179 for ; Fri, 6 Feb 1998 10:48:07 -0800 (PST) (envelope-from tom@sdf.com) Received: from tom by misery.sdf.com with smtp (Exim 1.73 #1) id 0y0sXV-0001vL-00; Fri, 6 Feb 1998 10:30:13 -0800 Date: Fri, 6 Feb 1998 10:30:05 -0800 (PST) From: Tom To: Terry Lambert cc: John Fieber , calin@ibd.dbio.ro, freebsd-hackers@FreeBSD.ORG Subject: Re: Powering off the system/UPS In-Reply-To: <199802061839.LAA12897@usr01.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" On Fri, 6 Feb 1998, Terry Lambert wrote: > > > I followed all your mail about how to patch the kernel. I seems that the > > > solution that would satisfy (more or less) everybody would be an extra > > > list for at_shutdown where both apm and ups drivers can insert callbacks. > > > (the way I patched my system's kernel - haha). > > > > Maybe I missed it in the thread, but why it is a Good Thing to > > put UPS support in the kernel as opposed to a purely user mode > > daemon that monitors the UPS and does the Right Thing, like > > shutdown(8), when things get to a critical state? > > Because the kernel knows about uncommitted write buffers, but the > user space daemon does not, and the user space daemon might be > fighting for a quantum with 1000 other processes, so it can't > react before its too late to save your data. Not even an issue. You want to start the shutdown well in advance anyhow, because battery life is a bit variable. The biggest problem is that a usermode program loses control as soon as it halts the system. What happens if power is resumed? The system is limbo with "Press any key to reboot" on the screen. A smarter UPS can help, but adding intelligence to the OS is easier. > Terry Lambert > terry@lambert.org > --- > Any opinions in this posting are my own and not those of my present > or previous employers. Tom