Linux-kernel mailing list archive 1998-25,: Re: more kswapd swap death ideas

# Re: more kswapd swap death ideas

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Mon, 22 Jun 1998 18:04:51 +0200 (CEST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Pat St. Jean: "Re: sound"
- Previous message: : ""
- Next in thread: Eric W. Biederman: "Re: more kswapd swap death ideas"
- Reply: Eric W. Biederman: "Re: 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

- Next message: Pat St. Jean: "Re: sound"
- Previous message: : ""
- Next in thread: Eric W. Biederman: "Re: more kswapd swap death ideas"
- Reply: Eric W. Biederman: "Re: more kswapd swap death ideas"