[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH] a character device counting kernel pages
On Aug 14, 2008, at 7:00 AM, Ilya Dogolazky wrote:
The concept is good, but the use of mdpage is machine-dependent and
is arm-specific. Walking all the pages to keep the count is not
Instead, I've added a sysctl node to pmap.c (machdep.kmpages) which will
return the number of pages with PMAP_KMPAGE set.
the attached patch is implementing a simple counter of memory pages
This kernel memory consumption measuring device (/dev/kp0,
is reporting (in decimal form, useful for shell scripts) the number of
physical memory pages used by the kernel itself. It is tested for
but will probably work with some other architectures too. To enable
it add the
line "pseudo-device pagecounter" to the config file and create the
(mknod /dev/kp0 c 239 0).
Usage in a shell script: KERNEL_MEM=$(cat /dev/kp0)
Any comment and suggestions are welcome.
Now you can do sysctl -n machdep.kmpages
Main Index |
Thread Index |