Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Nov 1998 04:22:11 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        grog@lemis.com (Greg Lehey)
Cc:        tlambert@primenet.com, Reinier.Bezuidenhout@KryptoKom.DE, freebsd-hackers@FreeBSD.ORG
Subject:   Re: Malloc in the kernel
Message-ID:  <199811090422.VAA12381@usr07.primenet.com>
In-Reply-To: <19981105134634.N784@freebie.lemis.com> from "Greg Lehey" at Nov 5, 98 01:46:34 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> >> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811090422.VAA12381>