On Wed, May 14, 2008 at 04:15:19PM +0200, konstantin at gremliza.net wrote:
> yes there are many ways to extract the information for zfs arc cache size.
> 
> ::memstat is my tool, when it comes to gathering overall memory usage.
> my question was: why not include the arc cache size into the ::memstat output?
> looking at the code, its almost there. 
> 
> and
> 
> would it also be possible to include/extract shm-mem into ::memstat? 

Would you be willing to file a bug and/or put together a suggested fix? 
I'd be happy to sponsor a putback of this change.

Cheers,
- jonathan

> >
> >If all you're interested in is the ARC, then why not "::arc" ?
> >
> >FrankH.
> >
> >On Wed, 14 May 2008, Surya Prakki wrote:
> >
> >> To my understanding, zfs makes use of kmem for its arc [and ofcourse for
> >> zfs nodes] - this info
> >> you can extract using the standard '::kmastat'.
> >> HTH.
> >> -surya
> >>
> >>
> >> Konstantin Gremliza wrote:
> >>> Hi,
> >>>
> >>> I like the the ::memstat dcmd, becauss it gives a brief system
> >>> overview of where memory has gone. It does not show arc cache or
> >>> shared memory information.
> >>>
> >>> Would it be possible to add zfs arc cache size and maybe shared memory
> >>> information to memstat output.
> >>> Current code does:
> >>>
> >>> 
> >http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/mo
> >dules/genunix/memory.c:
> >>>
> >>>
> >>> #*define* MS_PP_ISKAS 
> ><http://cvs.opensolaris.org/source/s?refs=MS_PP_ISKAS>(pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>, stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>)                              \
> >>>     232   (((pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>)->p_vnode 
> ><http://cvs.opensolaris.org/source/s?defs=p_vnode> == (stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>)->ms_kvp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_kvp>) ||          \
> >>>     233      * (((stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>)->ms_zvp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_zvp> != NULL 
> ><http://cvs.opensolaris.org/source/s?defs=NULL>) && ((pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>)->p_vnode 
> ><http://cvs.opensolaris.org/source/s?defs=p_vnode> == (stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>)->ms_zvp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_zvp>))*)
> >>>
> >>> Isn`t zvp the zfs arc cache?
> >>> Could we add a new zfs stat to the memstat_t?
> >>>
> >>>
> >>>
> >>>     234
> >>>     235 /*
> >>>     236  * Summarize pages by type; called from page walker.
> >>>     237  */
> >>>     238
> >>>     239 /* ARGSUSED */
> >>>     240 *static* *int*
> >>>     241 memstat_callback 
> ><http://cvs.opensolaris.org/source/s?refs=memstat_callback>(page_t 
> ><http://cvs.opensolaris.org/source/s?defs=page_t> *page, page_t 
> ><http://cvs.opensolaris.org/source/s?defs=page_t> *pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>, memstat_t 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#memstat_t> *stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>)
> >>>     242 {
> >>>     243   *struct* vnode <http://cvs.opensolaris.org/source/s?defs=vnode> 
> >>> vn 
> ><http://cvs.opensolaris.org/source/s?refs=vn>, *vp 
> ><http://cvs.opensolaris.org/source/s?refs=vp>;
> >>>     244   uintptr_t <http://cvs.opensolaris.org/source/s?defs=uintptr_t> 
> >>> ptr 
> ><http://cvs.opensolaris.org/source/s?refs=ptr>;
> >>>     245
> >>>     246   /* read page's vnode pointer */
> >>>     247   *if* ((ptr = (uintptr_t 
> ><http://cvs.opensolaris.org/source/s?defs=uintptr_t>)(pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>->p_vnode 
> ><http://cvs.opensolaris.org/source/s?defs=p_vnode>)) != NULL 
> ><http://cvs.opensolaris.org/source/s?defs=NULL>) {
> >>>     248           *if* (mdb_vread 
> ><http://cvs.opensolaris.org/source/s?defs=mdb_vread>(&vn, *sizeof* (vnode_t 
> ><http://cvs.opensolaris.org/source/s?defs=vnode_t>), ptr) == -1) {
> >>>     249                   mdb_warn 
> ><http://cvs.opensolaris.org/source/s?defs=mdb_warn>("unable to read vnode_t 
> >at 
> >%#lx",
> >>>     250                       ptr);
> >>>     251                   *return* (WALK_ERR 
> ><http://cvs.opensolaris.org/source/s?defs=WALK_ERR>);
> >>>     252           }
> >>>     253           vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp> = &vn;
> >>>     254   } *else*
> >>>     255           vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp> = NULL 
> ><http://cvs.opensolaris.org/source/s?defs=NULL>;
> >>>     256
> >>>     257   *if* (PP_ISFREE 
> ><http://cvs.opensolaris.org/source/s?defs=PP_ISFREE>(pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>))
> >>>     258           stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_cachelist 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_cachelist>++;
> >>>     259   *else* *if* (vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp> && IS_SWAPFSVP 
> ><http://cvs.opensolaris.org/source/s?defs=IS_SWAPFSVP>(vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp>))
> >>>     260           stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_anon 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_anon>++;
> >>>     261   *else* *if* (MS_PP_ISKAS 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#MS_PP_ISKAS>(pp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#pp>, stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>))
> >>>     262           stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_kmem 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_kmem>++;
> >>>     263   *else* *if* (vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp> && (((vp 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#vp>)->v_flag 
> ><http://cvs.opensolaris.org/source/s?defs=v_flag> & VVMEXEC 
> ><http://cvs.opensolaris.org/source/s?defs=VVMEXEC>)) != 0)
> >>>     264           stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_exec 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_exec>++;
> >>>     265   *else*
> >>>     266           stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_vnode 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_vnode>++;
> >>>     267
> >>>     268   stats 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#stats>->ms_total 
> ><http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/mdb/common/m
> >odules/genunix/memory.c#ms_total>++;
> >>>     269
> >>>     270   *return* (WALK_NEXT 
> ><http://cvs.opensolaris.org/source/s?defs=WALK_NEXT>);
> >>>     271 }
> >>>
> >>> Regards, Konstantin
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>>
> >>> _______________________________________________
> >>> mdb-discuss mailing list
> >>> mdb-discuss at opensolaris.org
> >>>
> >>
> >>
> >> -- 
> >> http://blogs.sun.com/sprakki
> >>
> >> _______________________________________________
> >> mdb-discuss mailing list
> >> mdb-discuss at opensolaris.org
> >>
> >
> >------------------------------------------------------------------------------
> >
> >No good can come from selling your freedom, not for all the gold in the 
> >world,
> >for the value of this heavenly gift far exceeds that of any fortune on earth.
> >------------------------------------------------------------------------------
> >
> _______________________________________________
> mdb-discuss mailing list
> mdb-discuss at opensolaris.org

Reply via email to