> I'm monitoring some very busy NFS clients and would like to graph the > segmap cache hits and misses. I took a look inside the code of the > segmapstat script included in Mr. Gregg's CacheKit collection, and I'm > getting some negative misses values in the results.
I'm not sure I understand what you're trying to measure. Are you talking about segmap faults that result in the system performing I/O, or are you talking about segmap faults that cause a page to be mapped, or have I misunderstood completely? Even in the case where segmap calls VOP_GETPAGE, it's still possible that you hit the page cache, meaning that you're not guaranteed to do I/O for everything that was requested. > The hits and misses are being calculated in segmapstat as such: > > hits = get_reclaim + get_use I don't think this is exactly right. Getmap is all the calls to segmap_getmapflt(). Within getmapflt, these are broken down as get_reclaim, stolen, get_use, and fault. > misses = getmap - hits Misses aren't broken out specficially, unless you're referring to fault. In that case, the reason why get_reclaim + stolen + get_use + fault > getmap, is because there are other code paths that update the fault counter. Calls to segmap_fault() also increment fault. Calls to segmap_faulta() increase faulta. From inspection, it looks like nfs/nfs4 calls to writerp and writerp4, respectively, will call segmap_fault. I might re-write your equations as: misses = fault hits = getmap - misses However, this is just an approximation, since other code paths adjust the fault counter. HTH, -j _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org