Re: Fix to swap_out()

From: Rik van Riel (riel@conectiva.com.br)
Date: Tue Apr 18 2000 - 11:49:24 EST


On Tue, 18 Apr 2000, Espiritu, Civ Kenneth wrote:

> I also looked at the code and it didn't look too nice. The
> offending line is 365, where we pick the largest Resident Size
> Set (RSS) to swap first.

The key word here is "first". We scan the processes in
biggest -> smallest order, but we make sure to scan them
all fairly.

> A fix would be to pick tasks to page which don't page fault alot
> by calculating a page fault rate over the task's lifespan. If
> the system inadvertently pages something that it shouldn't there
> is feedback from p->maj_flt which will make the task less likely
> to be swapped out in future swap attempts.

This will not work for a number of reasons. Firstly, when we
swap out a page it'll linger for a while in the "swap cache",
from where we can softfault them back in (hint: p->maj_flt
only gets updated on hard page faults, not on softfaults).

But of course this doesn't matter since:
- your calculation of "long running" isn't safe against
  either jiffie or p->maj_flt overflows
- we'll scan all tasks anyway, if we scanned the biggest
  task on the last pageout, we'll be scanning the next
  biggest task on this pageout run ... we'll scan them
  all, so scoring doesn't matter all that much

regards,

Rik

--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies http://www.conectiva.com/ http://www.surriel.com/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:13 EST