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

Out of memory killer almost ready



Hi,

I've now finished most of the Out of memory
killer, except for one thing.

I don't know what condition to test for for
when to start the procedure. We could wait
until kswapd truly fails, but wouldn't that
be waiting _too_ long. OTOH, if we don't,
we can kill a process when it isn't needed.

in kswapd:
	alive = 0;
	while (tries--) {
		cruft;
		if (try_to_free_page())
			alive = 1;	
	}
	if (!alive)
		out_of_memory_killer();

This has the disadvantage of:
- taking things too far
- kicking in when kswapd has just been very
  unlucky

OTOH, testing for free swap space won't help a bit
when we are killed by mlock(), pagetables and other
nonswappable things...

Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page          | Scouting       webmaster |
|        - kswapd ask-him & complain-to guy | Vries    cubscout leader |
|     http://www.phys.uu.nl/~riel/          | <H.H.vanRiel@phys.uu.nl> |
+-------------------------------------------+--------------------------+