lkml.org 
[lkml]   [1998]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: more kswapd swap death ideas
On Mon, 22 Jun 1998, George wrote:

> The first patch was more of a 'see if I can inspire someone more
> experienced to think of a fix' type patch. Well, here's some other ideas
> from an acknowledged kernel neophyte that should work better than the
> previous one.

It was a rather good patch for a newbie^H^H^H^H^H^Hneophyte :-)

> In do_try_to_free_page(), couldn't we do something like this:
>
> case 2:
> if (nr_swap_pages != 0)
> if (swap_out(i, gfp_mask))
> return 1;
> state = 3;

This is a good idea, which will save us quite some CPU
time and will get us to a 'true OOM' situation with
less waste of resources...
This is important because this means that:
- we can kick off the OOM killer earlier (when it's needed)
- the system recovers faster on it's own (when the OOM killer
wasn't needed after all), thus making the probability of
needing to do a OOM kill smaller...

> Since we don't have swap left, nothing can get swapped out anyway. I don't
> think shrink_dcache_memory() or shrink_mmap() swap to disk, but I don't

They don't. It is safe to call these two functions until the
cache+buffer memory approaches the minimum requirement...

> know if shm_swap() needs the same type of treatment (doesn't appear so at a

It does, shm_swap() _does_ use the swap device to store it's
data.

> quick glance). This would at least prevent trying to swap out with no swap
> left. Then perhaps get a out of memory signal later instead of deadlock
> looking for more swap.

Your fix, combined with my process killing code should make
for systems that are more stable...

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.082 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site