tech-kern archive

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

Re: netbsd-5 deadlocks when memory is low

Manuel Bouyer <> wrote:

> > Do you suggest to use mlock(NULL, (size_t)-1) ?
> this probably won't work. Look at how ntpd uses it ...

Using mlockall(MCL_CURRENT|MCL_FUTURE) on perfused fixes the problem. No
more deadlocks, the swap is used when memory gets low. 

I was not even necessary to do the same in glusterfsd, (remember kernel
sends PUFFS ops to perfused, which translate that into FUSE ops and
sends them to glusterfsd - or to any another FUSE filesystem). This
suggests there is really a specific problem in how kernel part of PUFFS
waits for its replies, at least on netbsd-5. I tried hard to reproduce
the problem in -current without success, and I never managed to identify
what change fixed the problem. I tried backporting most kernel changes
to sys/fs/puffs sys/dev/pud sys/dev/puffs without success.

The mlockall(2) trick works around the problem, but it is probably
required for any PUFFS filesystem. Should the kernel do it on behalf of
the process when it sees a mount(2) with type MOUNT_PUFFS? Or should
libpuffs take care of it? And should it be done on -current or just

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index