Subject: Re: Strange VM behaviour
To: None <eeh@netbsd.org>
From: Lennart Augustsson <lennart@mail.augustsson.net>
List: tech-kern
Date: 02/04/2001 14:54:33
eeh@netbsd.org wrote:

>         When my machine is heavily loaded memory-wise (which happens a lot
>         with UBC) I've observed a strange behaviour.  Perhaps it's normal, but I
>         doubt it.
>         All of a sudden the machine freezes.  I can't move the mouse, there is no
>         sound from my speakers anymore, and there is no disk activity.  This lasts
>         1 - 5 seconds and then everything is back to normal again (i.e. paging like
>         crazy).
>         Can anyone shed any light?  (No, I've not been able to switch console
>         to get into the debugger, so no stack traces.)
>
> Haven't been paying very much attention to tech-kern lately,
> have we?
>
> What you're seeing is typical UBC behavior:
>
> 1) the buffer cache useage is unlimited,
> so any/all pages are eventually swallowed
> by the buffer cache, displacing everything
> else including the X server.
>
> 2) there is no limit on dirty buffer cache
> pages and nothing to force immediate writing
> so when the sync-er runs a huge number of pages
> are scheduled to be written, which swamps the
> I/O subsystem.
>
> 3) The page scanner was broken so it degraded
> to FIFO page replacement rather than LRU.  Jason
> has fixed that a couple of weeks ago.
>
> For #3, upgrade.
>
> For #1, you can use a patch that Jason sent
> out a few weeks ago.
>
> For #1 and #2, you can try the following patch
> (which potentially causes TLB issues, but those
> are much less expensive than UBC issues):

First of all, I'm running -current (about a day old), so #3 is not an issue.

I doubt your analysis of my problem is correct.  Note that when the system
freezes there is no disk activity.  If the syncer was flushing pages I would expect
heavy disk activity.
The only normal condition I can imagine this to happen is if the scheduler
decide to run processes that all happen to be totally in core and that don't
need any disk I/O.  This is not impossible, but very improbable.  Especially
for a time period of 5 seconds.

    -- Lennart