From owner-freebsd-hackers Sun Nov 8 20:22:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA06439 for freebsd-hackers-outgoing; Sun, 8 Nov 1998 20:22:53 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA06418 for ; Sun, 8 Nov 1998 20:22:45 -0800 (PST) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id VAA24378; Sun, 8 Nov 1998 21:22:23 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp02.primenet.com, id smtpd024329; Sun Nov 8 21:22:13 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id VAA12381; Sun, 8 Nov 1998 21:22:11 -0700 (MST) From: Terry Lambert Message-Id: <199811090422.VAA12381@usr07.primenet.com> Subject: Re: Malloc in the kernel To: grog@lemis.com (Greg Lehey) Date: Mon, 9 Nov 1998 04:22:11 +0000 (GMT) Cc: tlambert@primenet.com, Reinier.Bezuidenhout@KryptoKom.DE, freebsd-hackers@FreeBSD.ORG In-Reply-To: <19981105134634.N784@freebie.lemis.com> from "Greg Lehey" at Nov 5, 98 01:46:34 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 ?? [ ... ] > > 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? vm_pager_allocate(OBJT_SWAP, 0, OFF_TO_IDX(size), VM_PROT_DEFAULT, 0); 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