From owner-freebsd-hackers Fri Feb 6 11:40:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA11015 for hackers-outgoing; Fri, 6 Feb 1998 11:40:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA10984 for ; Fri, 6 Feb 1998 11:40:39 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id LAA04741; Fri, 6 Feb 1998 11:35:13 -0800 (PST) Received: from UNKNOWN(), claiming to be "current1.whistle.com" via SMTP by alpo.whistle.com, id smtpd004739; Fri Feb 6 11:35:03 1998 Message-ID: <34DB650B.33590565@whistle.com> Date: Fri, 06 Feb 1998 11:31:23 -0800 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2.5-RELEASE i386) MIME-Version: 1.0 To: "Bruce M. Walter" CC: John Fieber , Mike Smith , hackers@FreeBSD.ORG Subject: Re: Powering off the system/UPS References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe hackers" I'll add my input because I'm the original author of the 'at_shutdown()' code. I think adding a 3rd queue is good. adding a priority and sorting the queues before execution is dubious because different authors may have used different ordering constants and you will only make them THINK they know what's going on. :) better to have them cope with possible mis-ordering I think.. however, having said that, I agree that it's not a bad idea and however you are willing to implement it... personally, if you MUST add priorities, then just change the existing call and man page.. I think there are few consumers of this call at the moment. The dpt is one, but that's checked in now so you can correct that, and we at whistle use it, (but I can cope with it) as long as you change the prototype (and add a comment) most people should be ok.. still if you want to put in a new call.. feel free. :) Bruce M. Walter wrote: > > > I'm working on reorganizing the kernel code to allow for this right now... > Here's what I'm attempting as per Mike's suggestions: > > 1) There will be another queue, tenatively called 'SHUTDOWN_PRE_HALT' > which will run after SHUTDOWN_POST_SYNC and before an actual reboot/halt. > > 2) I will add a new interface routine and support defines: > > #define SHUTDOWN_PRI_MIN 1 > #define SHUTDOWN_PRI_MAX 20 > #define SHUTDOWN_PRI_DEFAULT 10 > > int > pri_at_shutdown(bootlist_fn func, void *arg, int when, int priority); > > which will add items to the shutdown queues with the specified priority. > > at_shutdown will remain the same and will add its callouts to the queues > at a priority of SHUTDOWN_PRI_DEFAULT. rm_at_shutdown will also remain > the same and will work on callouts added by either function. Callouts > with the same priorities will be ordered LIFO. > > I'd love to hear any comments/suggestions from the peanut gallery. > > - Bruce