From owner-freebsd-hackers Thu Dec 24 12:08:31 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA14529 for freebsd-hackers-outgoing; Thu, 24 Dec 1998 12:08:31 -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 MAA14524 for ; Thu, 24 Dec 1998 12:08:29 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id LAA18231; Thu, 24 Dec 1998 11:59:51 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpda18228; Thu Dec 24 19:59:49 1998 Date: Thu, 24 Dec 1998 11:59:46 -0800 (PST) From: Julian Elischer To: Matthew Dillon cc: "John S. Dyson" , hackers@FreeBSD.ORG Subject: Re: M_KERNEL in sys/malloc.h ??? In-Reply-To: <199812241721.JAA27982@apollo.backplane.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 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. On Thu, 24 Dec 1998, Matthew Dillon wrote: > > :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. > > Ok, I'll document it then and make sure it operates the same with my > cleanups. > > -Matt > > :John | Never try to teach a pig to sing, > :dyson@iquest.net | it makes one look stupid > > Matthew Dillon Engineering, HiWay Technologies, Inc. & BEST Internet > Communications & God knows what else. > (Please include original email in any response) > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message