From owner-freebsd-hackers Thu Dec 24 00:08:43 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA00517 for freebsd-hackers-outgoing; Thu, 24 Dec 1998 00:08:43 -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 AAA00512 for ; Thu, 24 Dec 1998 00:08:37 -0800 (PST) (envelope-from toor@y.dyson.net) Received: (qmail 10659 invoked from network); 24 Dec 1998 08:08:23 -0000 Received: from dyson.iquest.net (HELO y.dyson.net) (198.70.144.127) by iquest3.iquest.net with SMTP; 24 Dec 1998 08:08:23 -0000 Received: (from root@localhost) by y.dyson.net (8.9.1/8.9.1) id DAA46738; Thu, 24 Dec 1998 03:08:18 -0500 (EST) Message-Id: <199812240808.DAA46738@y.dyson.net> Subject: Re: M_KERNEL in sys/malloc.h ??? In-Reply-To: <199812230019.QAA08154@apollo.backplane.com> from Matthew Dillon at "Dec 22, 98 04:19:43 pm" To: dillon@apollo.backplane.com (Matthew Dillon) Date: Thu, 24 Dec 1998 03:08:18 -0500 (EST) Cc: 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 Matthew Dillon said: > Does anyone know what M_KERNEL is sys/malloc.h is supposed to do? It > is used in precisely two places in the code as far as I can tell: > > vm/default_pager.c: if (swap_pager_swp_alloc(object, M_KERNEL) != 0) { > vm/default_pager.c: if (swap_pager_swp_alloc(object, M_KERNEL) != 0) { > vm/swap_pager.c: spc->spc_bp = malloc(sizeof(*bp), M_TEMP, M_KERNEL); > > But kern/kern_malloc.c doesn't appear to really use it. On the otherhand > I do see lots of absolute comparison of the malloc 'flags' to M_WAITOK > (0) or M_NOWAIT which the use of M_KERNEL would interfere with. I can't > tell if the side effects are something that are expected, or if the > side effects are a bug. > > Anybody know? > 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. -- 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