Coming into this thread late since I'm returning for vacation...

On Thu, Jan 12, 2006 at 02:55:52AM +1100, Brendan Gregg wrote:
| 
| I want segvn hit rate. There must be a function in the segvn code
| somewhere that checks whether a page is already in the page cache or not,

So in a nutshell, what you want to know is, for mmap() faults what is the
hit rate in the page cache?

| which would be ideal for DTrace to trace. I would expect this to be
| related to when a page fault occurs from a segvn mapping.
| 
| I've looked at a number of functions, including the following,
| 
|       segvn_fault
|       page_exists
|       page_lookup
|       page_reclaim
|       ufs_getpage
|       ufs_getpage_ra
|       seg_plookup

It's probably easier to track the number of misses and compare to the
number of faults since there are so many places you can find a page.
To do that you can just look for calls to page_create_va() from the
context of {segvn_fault,segvn_faulta}.

Some other notes..

Regarding the number of faults. The read-ahead is completely done within
the filesystem layer in the current architecture so the behavior is highly
FS specific. Look for the callers to hat_memload() and hat_memload_array()
in the system -- the read-ahead appears to be loading multiple mappings when
the pages are read in. Further accesses therefore don't generate faults
to these pages. If OTOH you have a 100% hit rate in the cache I would
expect to see ~1000 faults for a 8M segment on SPARC or 4M on x86 since
you would get one fault and one attach per page. These would be counted
as minor faults.

Hope this helps.

- Eric

_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to