Subject: swap on cgd can lock up my system
To: None <current-users@netbsd.org>
From: Denis Lagno <dlagno@smtp.ru>
List: netbsd-bugs
Date: 02/20/2004 18:42:14
It is 100% reproducible on my box.

It is NetBSD-current 1.6ZK on i386.  I have swap configured
on cgd.  Without much stress it works fine, but if I start
20-30 copies of following program:

#include <stdlib.h>
#include <unistd.h>

main()
{
    int *ip = (int *)malloc( 10000000 * sizeof( int ) );
    int i;
    for ( i = 10000000; i--; )
    {
	ip[i] = i * 3 - 65465;
    }
    for ( ;; ) sleep( 5 );
}

then it freezes.  Not completely -- kernel is alive, I can
switch consoles, if prior to experiment I start top on some
virtual console it can remain alive, if I switch to X
virtual console it is dead but after several seconds I can
switch back and I see kernel logs to console something like
usl_detachtimeout.  But all other stuff is frozen.  getty
are frozen, if I quit from top I get frozen.  It is not due
to high load -- I start them one by one and passing a
minute top shows 100% idle -- all this programs got into
sleep phase.  It is not temporary, I've left it alone for
half an hour, it does not wake.  I have feeling that all
processes that happen to be swapped out are blocked.

If I configure swap on the same physical space but without
cgd all works fine.  I saw no hardware problems, the system
was rebuild many times without problems.

If you need any info about my configuration I can provide
it.