Subject: sleep and retry on ENOMEM (out of swap) instead of killing
To: None <tech-kern@NetBSD.ORG>
From: Jeremy C. Reed <>
List: tech-kern
Date: 07/22/2003 18:17:22
Is there any way to implement the kernel to sleep for a moment and retry
at least one time instead of killing the process when out of swap?

I've looked a little at /usr/src/sys/arch/i386/i386/trap.c but I assume
that I'll need to track down where the kernel was before it ran out of
swap to see if I can get it to retry there instead.

Any ideas on where to look? (I assume somewhere in /usr/src/sys/uvm, but I
am not sure where the handler is defined that uses trap() in the first

I am interested in this because my XFree86 was killed (and all its
children too); and I was wondering if there was way for it to pause for a
couple seconds and try again before killing it. If that is a bad idea,
please teach me.

   Jeremy C. Reed