On Wed, 27 Apr 2005, A.M. Fradley wrote: > Sorry, I didn't get back to you sooner. I had a busy week. Anyway I > figured the best way to get anywhere with this project would just be to > get the page faults per second or something and use that to measure the > vm pressure. Think about a system with very large address space, where somebody mmaps an enormous file and streams through it once. In that case a high page fault rate does not mean the system is thrashing. It simply means the system is streaming through the data fast. > I was thinking of doing something like this: > > timeSinceLastFault = currentTime - timeOfLastFault; > faultsPerSec = 1 / timeSinceLastFault; > av_fps = (av_fps + faultsPerSec) / 2; > timeOfLastFault = currentTime; Looks like it would work, but make sure to only count major faults and not minor faults... > That would go inside the page fault function. I'm going to look into > doing it this way as part of the runqueue structure for now. I think I > should start by moving the strusture definition into sched.h. I also > need to check the math behind that algorithm. Am I on the right lines > with the runqueue thing? Why move this into the runqueue? The runqueue contains processes that are runnable, I don't understand how you want to hook into that processes that are not runnable but waiting for page faults... -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/