From owner-freebsd-hackers Wed Nov 4 19:16:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA05390 for freebsd-hackers-outgoing; Wed, 4 Nov 1998 19:16:50 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA05383 for ; Wed, 4 Nov 1998 19:16:47 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id NAA06544; Thu, 5 Nov 1998 13:46:35 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id NAA16143; Thu, 5 Nov 1998 13:46:34 +1030 (CST) Message-ID: <19981105134634.N784@freebie.lemis.com> Date: Thu, 5 Nov 1998 13:46:34 +1030 From: Greg Lehey To: Terry Lambert , Reinier Bezuidenhout Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Malloc in the kernel References: <199811041747.SAA05132@borg.kryptokom.de> <199811041835.LAA09570@usr07.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199811041835.LAA09570@usr07.primenet.com>; from Terry Lambert on Wed, Nov 04, 1998 at 06:35:12PM +0000 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wednesday, 4 November 1998 at 18:35:12 +0000, Terry Lambert wrote: >> If I want to malloc really large space in the kernel, say from >> 2k up to 1M or maybe more .... wat parameter should 'n >> give to malloc ?? >> >> malloc(1000, ????, M_WAITOK); >> >> ? M_DEVBUF >> >> if it is possible :) > > It depends on what you intend to use the memory for. > > Ideally, you would be prepared to take a page fault, and would > allocate pageable memory backed by swap so that you didn't > exhaust the physical memory in the system. > > In general, the kernel is better at deciding what memory it needs > when it needs it than a kernel code author. You either trust > the locality of reference model upon which VM systems are based, > or you don't. Assuming that fits his needs, what's the answer? Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message