Date: Sun, 16 Apr 2000 16:52:23 +0000 From: Anatoly Vorobey <mellon@pobox.com> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: hackers@freebsd.org Subject: Re: memory in the kernel Message-ID: <20000416165223.A31100@happy.checkpoint.com> In-Reply-To: <4887.955892191@critter.freebsd.dk>; from phk@critter.freebsd.dk on Sun, Apr 16, 2000 at 03:36:31PM %2B0200 References: <20000416123037.A24869@happy.checkpoint.com> <4887.955892191@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 16, 2000 at 03:36:31PM +0200, Poul-Henning Kamp wrote: > In message <20000416123037.A24869@happy.checkpoint.com>, Anatoly Vorobey writes > : > >I have to malloc a lot of memory in the kernel, hence a few > >questions: > > How much is "a lot" ? Apparently somewhere in the vicinity of 8Mb, and also coming in a form of many hash tables, dynamic-size linked lists, variable-length structs, etc. so it's not practical to estimate a high bound, allocate and be done with it. FWIW, I think Win32 got it right in providing growable private heaps, where you can create your own heap and malloc() from it, and then just return all the memory back with one destroy call. It makes a lot of sense in some contexts. > >1. The data must be absolutely present at all times, no page > >faults or locking mechanisms, etc. Does that mean > >I should use kmem_alloc_wired() or am I misunderstanding its purpose? > >Does it make sense to alloc less than a pageful or is the rest simply > >going to be wasted? > > malloc(9) should be used. Thanks! -- Anatoly Vorobey, mellon@pobox.com http://pobox.com/~mellon/ "Angels can fly because they take themselves lightly" - G.K.Chesterton 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?20000416165223.A31100>