[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Kernel UMA current occupancy statistics
From:       Karl Denninger <karl () denninger ! net>
Date:       2016-08-31 13:02:06
Message-ID: 18fdca3b-9002-db60-504b-388c628fab0e () denninger ! net
[Download RAW message or body]


Working on the ZFS ARC code I'm trying to find documentation on the
means by which I can determine the occupancy of a UMA slab.

There is a userland set of calls but I assume those are not the correct
way to approach this in the kernel context.  include/sys/vm/uma.h
declares that the returned structure is to be opaque to users of the
facility, and the only occupancy-related function I can find is
uma_zone_get_cur, which gives me the number of items allocated but
uma_zone_get_max states that it will return "0" if no limit on
allocations has been set.

Any hints on how to determine, if for example there are 50,000 "units"
of memory that are currently held out of kmem in a given slab how many
are actually allocated and how many are free and reusable without a
further kernel memory allocation?

What I'm trying to determine is this (from vmstat -z):

ITEM                   SIZE  LIMIT     USED     FREE      REQ FAIL SLEEP
zio_buf_512:            512,      0,   79865,  199359, 6495950,   0,   0

In other words how do I programmatically, inside a kernel routine (in
this case zfs/arc.c) retrieve the "used" and "free" values if I have a
given slab's pointer (which I can use to call kmem_cache_reap_now)?

Thanks in advance;

--=20
Karl Denninger
karl@denninger.net <mailto:karl@denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/

["smime.p7s" (application/pkcs7-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic