Re: Calling sys_sysinfo from sched.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Rik van Riel <riel@xxxxxxxxxxx>:

> On Wed, 20 Apr 2005, Rik van Riel wrote:
> 
> > I have a feeling there is a LOT of interesting research left to
> > do for the swap token mechanism.
> 
> Since I also suspect this work is going to be important for
> Linux, I set up a wiki page where we can all take notes.
> Otherwise we'll just end up having the same discussion over
> and over again, without making progress.
> 
> If you end up playing with the swap token code, please write
> down your notes so other people can learn...
> 
> http://wiki.linux-mm.org/wiki/SwapTokenTuning
> 
> -- 
> "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
 

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.  I came
up with this small algorithm base on how it seems the cpu load is calculated. 
I'm not sure I got it quite right in saying it's the swap rate per second but I
think the faults per second would be best made available as a property of the
runqueue structure so it can be cpu specific.  Otherwise if this were tried on a
network, it would activate the swap tokening on a computer that might only have
low vm pressure.  Do you think any of that that's a good idea?  Although as far
as I know the vm pressure should be spread evenly over the network, so maybe it
would be better to just measure it over all cpus or was I right to begin with?
I don't think there's anything like that already implemented but I don't know
the kernel very well yet so I can't be sure.

I was thinking of doing something like this:

timeSinceLastFault = currentTime - timeOfLastFault;
faultsPerSec = 1 / timeSinceLastFault;
av_fps = (av_fps + faultsPerSec) / 2;
timeOfLastFault = currentTime;

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?


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux