kernel 2.5: mlock broken?
Hi folks,
By testing 2.6.0-test2, I detected that the glibc-function mlock(), provided by /sys/mlock.h seems to be a deadlock in some cases on 2.5
If you want to lock more memory than physical RAM could be freed, the mlock() does not return with an errorcode as under 2.4.21 does. The system hangs around. This problem was catched under x86 and s390 architecture by using Debian distribution (woody and unstable) and others with the well known memtest program written by Charles Cazabon
from http://www.qcc.ca/~charlesc/software/memtester/ (ver. 2.93.1).
IMHO the problem is effected in kernel mm/mlock.c, ev. in do_mlock(), because glibc was not changed between different kernelversions. The glibc version was 2.3.1-17
Hope it helps.
Bye Andreas
PS.:If you think this report is not related to this list, please contact me per private email.
PPS.: If you need further information, contact me too.
Quoted 6 lines · Andreas Romeyke
Hi folks,
By testing 2.6.0-test2, I detected that the glibc-function
mlock(), provided by/sys/mlock.hseems to be a deadlock in some cases on 2.5
Quoted 7 lines
If you want to lock more memory than physical RAM could be freed, the
mlock()does not return with an errorcode as under 2.4.21 does. The system hangs around. This problem was catched under x86 and s390 architecture by using Debian distribution (woody and unstable) and others with the well known memtest program written by Charles Cazabon
from http://www.qcc.ca/~charlesc/software/memtester/ (ver. 2.93.1).
2.4 kernels have a little check which prevents a single process from mlocking more than half of physical memory. So you need to run two processes to kill a 2.4 box with mlock.
Some people want to be able to mlock more memory than that in a single process, so the check was removed in 2.6. It was pretty pointless.