tech-kern archive

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

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



On Tue, 18 Oct 2011, Emmanuel Dreyfus wrote:

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.

I'm sorry I wasn't paying attention to this earlier. I've seen reboots
on my amd64 netbsd-5 server under probably heavy load (building
userspace or rebuilding all my pkgsrc packages, for example) but haven't
seen a core file (I probably disabled that) or any other indication of
why it's rebooting.

Sounds like it's different than the freeze, but I'd like to make sure.

--
Hisashi T Fujinaka - htodd%twofifty.com@localhost
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte


Home | Main Index | Thread Index | Old Index