OpenSolaris邮件列表中关于虚拟内存管理学习的讨论

发表于:2007-06-08来源:作者:点击数: 标签:
转载自: OpenSolaris: code Hi Ivan, Check the following link ... (Send some time back by Craig dot Steinberger at Sun dot COM http://blogs.sun.com/roller/page/plan9/20050304#sun_white_album_essential_papers Thanks Venku Ivan wrote: Hi, Coul

转载自: OpenSolaris: code



Hi Ivan,

Check the following link ...
(Send some time back by Craig dot Steinberger at Sun dot COM>

http://blogs.sun.com/roller/page/plan9/20050304#sun_white_album_essential_papers

Thanks
Venku


Ivan wrote:
> Hi,
>
> Could someone tell me where I should start to learn how (Virtual) Memory Management works in OpenSolaris?
>
> Thanks
> With kindest regards,
> Ivan


On 06/23/05 08:39, Alan J. Burlison wrote:
> Best bet is to start with the Solaris Internals book - http://www.amazon.com/exec/obidos/tg/detail/-/0130224960/qid=1119511795/sr=8-1/ref=pd_bbs_ur_1/103-8697652-4546208?v=glance&s=books&n=507846
> There's also Jeff Bonwick's Slab Allocator paper - http://srl.cs.jhu.edu/courses/600.418/SlabAllocator.pdf, plus the follow-up paper from Jeff and Jonathan Adams - http://www.parrotcode.org/talks/vmem.pdf. After that, there's always the code ;)

There were also some opening day blog entries in this area:

http://blogs.sun.com/roller/page/elowe?entry=page_fault_handling_in_solaris
http://blogs.sun.com/roller/page/paulsan/

and possibly some others.

You can also use Dtrace to speed your understanding of the source a bit. eg look at stack()
on pagefault:entry, probe sfmmu_*:entry and hat_*:entry and look
at stack etc. As a quick and not especially illuminating example here's
a quick look at the frequency of hat_* calls on my home system:

# dtrace -n 'hat_*:entry'
dtrace: description 'hat_*:entry' matched 80 probes
^C

hat_add_callback 1
hat_devload 1
hat_preferred_pgsz 1
hat_getpfnum 2
hat_map 4
hat_memload_array 4
hat_unload 13
hat_unload_callback 13
hat_kpm_page2va 25
hat_get_mapped_size 26
hat_probe 105
hat_memload 241
hat_page_setattr 1320
hat_pageunload 2044
hat_page_getattr 4429
hat_page_clrattr 17867
hat_pagesync 20790
hat_page_getshare 24894

So what are the codepaths to hat_memload and hat_devload (which load
translations into the translation hash). I'll limit stacks to no
more than 4 above the entry point to uniquefy a bit:

# dtrace -n hat_devload:entry,hat_memload:entry''
dtrace: description 'hat_devload:entry,hat_memload:entry' matched 2 probes
^C

genunix`segkp_get_internal+0x480
genunix`segkp_get_withanonmap+0x1c
genunix`schedctl_getpage+0x2c
genunix`schedctl_shared_alloc+0x60
1

genunix`segvn_fault+0xb84
genunix`as_fault+0x4c8
unix`pagefault+0xac
unix`trap+0xclearcase/" target="_blank" >cc0
1

swrand`physmem_ent_gen+0x17c
swrand`rnd_handler+0x14
genunix`callout_execute+0x98
genunix`taskq_thread+0x1a4
1

unix`segkmem_xalloc+0x150
unix`segkmem_alloc+0xc0
genunix`vmem_xalloc+0x608
genunix`vmem_alloc+0x1d4
5

genunix`segvn_faultpage+0x53c
genunix`segvn_fault+0x8e8
genunix`as_fault+0x4c8
unix`pagefault+0xac
82

Cheers

Gavin


On Wed, Jun 22, 2005 at 11:42:22PM -0700, Ivan wrote:
| Hi,
|
| Could someone tell me where I should start to learn how (Virtual) Memory Management works in OpenSolaris?

In addition to the sources Alan mentioned, there is some more info
in my blog:

http://blogs.sun.com/elowe

VMM is a rather broad area, so if there are specific areas you're interested in
learning more about, let me know and I'll add more blog entries to cover them
or try to talk others into blogging about them. :)

--
Eric Lowe Solaris Kernel Development Austin, Texas


原文转自:http://www.ltesting.net