On Wednesday 04 June 2008, Nicolas Thery wrote: > Hello, > > As part of my quest of migrating zones allocations to kmalloc/objcache, > I'm writing a small utility that dumps stats about each object cache. > > By default, it displays (from left to right), the cache name, magazine > capacity > (MAGC), number of unallocated objects (UNOBJ), number of empty (EMAG) > and full magazines (FMAG) in the depot, number of objects in loaded (LRD) > and previous (PRD) rounds. Per-cpu values are separated by commas: [...] > It also provides the number of successful gets and puts and failed > gets since boot: [...] > There is also a -l option to display all available stats and a -o one > to select what > fields to display (a la ps(1)). > > Internally, I added an opaque sysctl to objcache that dumps all stats and is > parsed by ocstat. > > Do you think this could be added to base? If so, I'll clean up the code > and email patches here.
Should be useful. A thing that afaict is lacking from objectcache at the moment is a debug mode; I've spend 1+ day chasing a bug that was caused by a very subtle double free for an mbuf and the way I did it (add kprintf()s for every mbuf malloc/free, also logging their call sites and write script to track alloc/frees) cannot be reused. If kmalloc/kfree can detect stuff like that we could add an option that makes objcache pass through all gets and puts. Ideas? Aggelos
