Subject: dynamic memory allocation problem
To: None <tech-kern@netbsd.org>
From: ycchang <ycchang@cirx.org>
List: tech-kern
Date: 05/25/2003 11:16:33
This is a multi-part message in MIME format.

------=_NextPart_000_001F_01C322AF.1962C370
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

Hi, All

    Recently, I' m studying the vm of NetBSD from the source code, but I =
still can not figure out what kinds of  dynamic=20
    memory allocation mechanism does the kernel provide. As in Linux, =
it's very clear that the dynamic memory is allocated
    totally from the buddy system, such as alloc_pages(), and the slab =
allocator uses it to provide cache for efficient kernel=20
    data structure allocation, such as kmem_alloc  or kmalloc(), =
finally, if we want nonconti. memory , we can use vmalloc().=20
    In NetBSD, does any one can tell me roughly the guidelines of =
dynamic memory allocation? I have traced the code, but=20
    it seems that various purpose dynamic memory allocation functions =
call each other(uvm, pmap etc.), and I can not figure
    out the relationship among them.



                                                                         =
                                               Regards,
                                                                         =
                                                           ycchang
------=_NextPart_000_001F_01C322AF.1962C370
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV><FONT size=3D2>Hi, All</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; Recently, I' m studying the vm of =
NetBSD=20
from the source code, but I still can not figure out what kinds of&nbsp; =
dynamic=20
</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;memory allocation =
mechanism&nbsp;does=20
the kernel provide. As in Linux, it's very clear that the dynamic memory =
is=20
allocated</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; totally from the buddy system, =
such=20
as&nbsp;alloc_pages(), and the slab allocator uses&nbsp;it to =
provide&nbsp;cache=20
for efficient kernel </FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;data structure allocation, =
such=20
as&nbsp;kmem_alloc&nbsp; or&nbsp;kmalloc(),&nbsp;finally, if we want =
nonconti.=20
memory , we can use vmalloc(). </FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; In NetBSD, does any one can tell =
me roughly=20
the guidelines of dynamic memory allocation? I have traced the code, but =

</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; it seems that various purpose =
dynamic=20
memory allocation functions call each other(uvm, pmap etc.), and I can =
not=20
figure</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp;&nbsp; out the relationship among=20
them.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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