From owner-freebsd-hackers Thu Dec 24 12:23:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA15469 for freebsd-hackers-outgoing; Thu, 24 Dec 1998 12:23:33 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from iquest3.iquest.net (iquest3.iquest.net [209.43.20.203]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA15464 for ; Thu, 24 Dec 1998 12:23:31 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 27453 invoked from network); 24 Dec 1998 20:23:17 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 24 Dec 1998 20:23:17 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id PAA50865; Thu, 24 Dec 1998 15:23:16 -0500 (EST) Message-Id: <199812242023.PAA50865@y.dyson.net> Subject: Re: M_KERNEL in sys/malloc.h ??? In-Reply-To: <199812242017.PAA50847@y.dyson.net> from "John S. Dyson" at "Dec 24, 98 03:17:29 pm" To: dyson@iquest.net Date: Thu, 24 Dec 1998 15:23:16 -0500 (EST) Cc: julian@whistle.com, dillon@apollo.backplane.com, dyson@iquest.net, hackers@FreeBSD.ORG From: "John S. Dyson" Reply-To: dyson@iquest.net X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG John S. Dyson said: > Julian Elischer said: > > > > I would rename it to M_RESERVED or something that indicates > > that this is a request that is allowed dip into the emergency reserves > > to satisfy the request. > > > > > :> > > > :As I remember, M_KERNEL means that it really needs memory. waiting > > > :for memory is bad, and dip deeply into the page reserves. Normally, the > > > :malloc (in vm_kern) code will only dip into the interrupt accessible > > > :free pages. The M_KERNEL allows it to dip into all of the pages. > > > > > > That isn't what it really does. In reality, malloc normally grabs > memory from the interrupt available queues. The M_KERNEL relaxes the > restriction so that more memory is available. M_KERNEL cannot > be used from interrupt time. > Following up: M_WAITOK -- Get any pages, but block if you cannot get them M_NOWAIT -- Get only interrupt available pages, but don't block. M_KERNEL -- Get any pages, but don't block M_KERNEL is used to keep the VM from deadlocking, and should mostly be used in the pagers. M_WAITOK should normally be used in the non-interrupt part of the kernel except when M_KERNEL is more appropriate. M_NOWAIT should normally be used in the interrupt part of the kernel, but can be used elsewhere. If you rename, you might want to call M_KERNEL: M_VMREQ or somesuch to note that this is a vm deadlock avoidance compromise. -- John | Never try to teach a pig to sing, dyson@iquest.net | it makes one look stupid jdyson@nc.com | and it irritates the pig. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message