how to avoid low memory situation

From: Eli Cohen
Date: Tue Mar 30 2004 - 12:03:32 EST

Our driver is locking user space memory by calling sys_mlock() while the processes are ordinary processes without root priviliges. However it happens that the system has low memory since there have been many processes that locked memory and another attempt to lock memory brings the system to a state in which it struggles to find some free pages and the system becomes none responsive. Checking just the amount of free pages just before attempting to lock is not so good since there may be a lot of pages used by various caches which could be reduced thus allowing to lock memory. I am seeking a method in which I can forsee if another attempt to lock memory will bring me to such a condition and thus avoid it.

thanks for any help
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at