tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[SOLVED?] Re: netbsd-5 deadlocks when memory is low



Emmanuel Dreyfus <manu%netbsd.org@localhost> wrote:

> When running perfused stress test (a build of NetBSD over a glusterfs
> volume), memory gets low, and the machine hangs. 

I made some progress, thanks to Manuel Bouyer suggestions. There are
code paths where pagedaemon sleeps for memory. During my tests, I never
spoted pagedaemon in such a situation, but just to check the thing, I
added KASSERTs everywhere memory is allocated with sleep enabled in
PUFFS code, in order to make sure pagedaemon does not do that.

And indeed it does. A KASSERT quickly told me that in
puffs_vnop_strategy, there was a puffs_msgmem_alloc() call where it may
sleep. Forcing non sleeping mode if (curlwp == uvm.pagedaemon_lwp) seems
to fix the freeze problem.

Since I never caught pagedaemon sleeping there at freeze time during my
tests, I assume it does not sleep very long, but long enough to make
available memory very tight. The system does not survive this, after
pagedaemon wakes up, it dies from various non-pagedaemon places because
of memory shortage.

I just committed the fix.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index