[Badmem-developer] Improved proc_memmap
Status: Beta
Brought to you by:
eagle2
From: Yann D. <yd...@fr...> - 2004-01-14 20:49:56
|
Hi, I've worked a bit on memmap today, and discovered a couple of annoying bugs, which I could fix, at the same time as I implemented a couple of other things. Here is the changelog: - extracted from badmem patch, and made so that both can be applied in any order - allowed to be used as a module to ease further development - fixed displayed offset for each line to be offset for this line, not next one's - fixed calculation of dotconst to include all requested pages - moved legend from /proc/memmap into Documentation/vm/memmap - added 'x' symbol to show pages below min_low_pfn - fixed error codes to be all negative, printk a message on all errors - protect write from buffer overflow - turned on auto-detection of numeration base of numbers written to procfile, instead of forcing 10 - allow changing numbers of rows and columns Note that allowing to build memmap as a module required that the (min|max)_low_pfn symbols are exported from bootmem.c, which may not be desirable. I'm not digged much into the VM yet (memmap is supposed to help me ;), but as I understand it, there should be after boottime other means to get this information, which may already be exported. However, it is infinitely more comfortable to be able to rmmod and insmod a new version back for testing purposes. I hope this will encourage others to hack into this. Other thoughts: - writing to /proc/memmap is not much flexible. We could want to add more parameters to tune, or get other general information. Maybe a set of files in a /proc/memmap-params/ or so would be cleaner. - a single view of the memory may not be flexible enough for some uses. It would be useful to keep an eye on the big picture while looking at precise pieces of memory in a more precise manner. That could probably be handled by a central writable file, to which we would write things like "myregion 0 8000", resulting in /proc/memmap/myregion being created to look at the specified region. I thought it would be neat to be able to say just "echo 0 8000 > /proc/memmap/myregion" to get that new map created, and "rm /proc/memmap/myregion" to free the resources, but I fear procfs may not be flexible enough for this. Best regards, -- Yann Dirson <Yan...@fr...> http://www.alcove.com/ Technical support manager Responsable de l'assistance technique Senior Free-Software Consultant Consultant senior en Logiciels Libres Debian developer (di...@de...) Développeur Debian |