DragonFly BSD
DragonFly kernel List (threaded) for 2010-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: resident stack size


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 May 2010 21:36:33 -0700 (PDT)

:I went through the code for top in /contrib/top/ but their was no specific
:information about the functions being called for getting the resident stack
:size.
:Or any construct which gives the resident stack size.
:Theirs the function get_process_info and get_system_info (definition resides
:in one of the file) but they give the cpu and memory usage statistics/ time
:values.
:If you know how does it gets the resident stack size, please tell me.
:Till then I will go through it again.
:
:Pratyush Kshirsgar.

    I think you meant "Resident Set Size", meaning the number of active
    VM pages associated with a process.

    It is a long convoluted chain.

    The code is in /usr/src/usr.bin/top/m_dragonfly.c.  It looks like
    the value is pulled out of the kinfo_proc structure returned by
    the kernel.

    The code in the kernel is in /usr/src/sys/kern/kern_kinfo.c,
    around line 149, calling the function vmspace_resident_count()
    which is in vm/vm_map.h which calls pmap_resident_count() which
    pulls the data out of the process pmap's pm_stats.resident_count
    sub-structure.

						-Matt




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]