From owner-freebsd-hackers Wed Nov 4 10:35:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA07555 for freebsd-hackers-outgoing; Wed, 4 Nov 1998 10:35:28 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA07543 for ; Wed, 4 Nov 1998 10:35:27 -0800 (PST) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id LAA06422; Wed, 4 Nov 1998 11:35:18 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp01.primenet.com, id smtpd006406; Wed Nov 4 11:35:14 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id LAA09570; Wed, 4 Nov 1998 11:35:13 -0700 (MST) From: Terry Lambert Message-Id: <199811041835.LAA09570@usr07.primenet.com> Subject: Re: Malloc in the kernel To: Reinier.Bezuidenhout@KryptoKom.DE (Reinier Bezuidenhout) Date: Wed, 4 Nov 1998 18:35:12 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <199811041747.SAA05132@borg.kryptokom.de> from "Reinier Bezuidenhout" at Nov 4, 98 06:47:55 pm X-Mailer: ELM [version 2.4 PL25] 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 > 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. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message