Re: HELP!! Serious stability problems with Linux! Where to go from here?

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Sun, 28 Jun 1998 18:46:18 +0000 (/usr/local/etc/localtime)


On Sun, 28 Jun 1998, Heinz Mauelshagen wrote:

> Please try a patch in /usr/src/linux/fs/buffer.c in function grow_buffers()
> which _really_ limits the size of the buffer cache.
> (yes i know that some people say this isn't stable too, but for me
> it runs and runs and ...)

Well, Linus and some of the MM folks (including me) had
_doubts_ about it running stably in all situations.
More specifically, there could be problems with:
- loopback devices
- the md driver
- a ramdisk taking up all of the buffer cache, thereby
blocking the system from doing _any_ other I/O

> A simple testhack can be:
>
> if ( buffermem > BufferMemSizeInBytes) return 0;
>
> at the top of grow_buffers().
> Replace BufferMemSizeInBytes with the value you like.

Replace this test with:

if ( buffermem * 100 > buffer_mem.max_percent * num_physpages)

NOTE: this might not be safe when you are using large ramdisks,
raid or loopback!

A proper fix would be to allow allocation of just ONE
more buffer when we are over the limit; then wake up
both kflushd and kswapd and do a schedule...

> The second one avoided instability and _really_ bad performance, because
> the actual buffer code doeen't recognize the limits given in
> /proc/sys/vm/buffermem and then runs into trouble for sure!

Totally stopping the buffer cache from growing when it
reaches the maximum could probably [*] lead to system
instability. We should just let it grow _very_ slowly
and have kflushd and kswapd do something about the
situation.

[*] I heard from Linus that there were some problems with
loopback and md that could lead to system instability
when the buffermem limit is hard. This, however, was quite
a while ago and I don't know whether those drivers are
fixed now. OTOH, the drivers could become broken again
and we want to have a stable system irregardless, so slow
growing should probably be the option we use.

Rik.

PS. Anyone in favor of a patch to the ramdisk driver that won't
allow the ramdisks to take more than 75% of
buffer_mem.max_percent?
+-------------------------------------------------------------------+
| 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