Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2001 22:47:59 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        freebsd-hackers@freebsd.org
Subject:   removing setgid kmem from top, collecting per-device swap stats
Message-ID:  <20010130224759.A1589@crow.dom2ip.de>

next in thread | raw e-mail | index | archive | help
Hi,

I'm going to start working on making top work without setgid kmem. 

Is anyone already doing this? I don't want to waste my time...

Most kmem_read calls are easy to replace (the variables are already 
exported as sysctls), the only exception is nextproc (for which I might
add a sysctl, or just leave it out [anyone out there who needs the 
lastpid display?]).

Another thing I will need to do is to make kvm_getswapinfo use sysctls
when using on a "live" kernel (using a similar hack as in kvm_getprocs).
This will also allow to take the setgid kmem bit from swapinfo, while
it can still be used (along with pstat) on crash dumps.
This conversion is more complex. Is there any reason for going through
significant pains to collect swap statistics in userland instead of
doing this in the kernel?

From what I can see in vm_swap.c and swap_pager.c, this seems not
to be too hard. To correctly handle layering, I would need to define a
new vnode op for statistics. 

I would propose as sysctl hierarchy like
vm.nswapdev 	   (number of devices)
vm.swapdev1.dev
vm.swapdev1.total  (this is the one that is currently hard to get)
vm.swapdev1.used
vm.swapdev1.flags
vm.swapdev2...

This would also be much easier for the "non-live" case because we
would keep the statistics in memory, right for kvm to read.

Please correct me if I'm totally wrong somewhere... otherwise, I will
just start doing it like this, so don't let me run into my doom ;-)

	- thomas




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010130224759.A1589>