2.1.90 dies with many procs procs, partial fix

Finn Arne Gangstad (finnag@guardian.no)
Sun, 22 Mar 1998 02:51:15 +0100 (MET)


I haven't got to the bottom of this yet, but if you compile
2.1.90 with the following files from 2.1.89, the kernel works
somewhat better:

linux/fs/buffer.c
linux/include/linux/swap.h
linux/include/linux/swapctl.h
linux/kernel/sysctl.c
linux/mm/page_alloc.c
linux/mm/slab.c
linux/mm/swap.c
linux/mm/vmscan.c

The following test program will show the problem with 2.1.90:
(The problem only occurs if you have too little memory to keep all the
procs in memory, so try booting with mem=20M or less)

#include <sys/types.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdlib.h>

int main() {
int procs = 0;
while (1) {
int err = fork();
if (err == -1) {
perror("fork failed. eek.");
exit(EXIT_FAILURE);
} else if (err == 0) {
setsid();
pause();
_exit(EXIT_SUCCESS);
}
++procs;
printf("%d children forked off\n", procs);
usleep(30000);
}
exit(EXIT_SUCCESS);
}

It will pretty soon print warnings like these:

swap_duplicate: entry 00001b00 map count=126
swap_duplicate: entry 00001c00 map count=126
swap_duplicate: entry 00001d00 map count=126
swap_duplicate: entry 00001e00 map count=126
swap_duplicate: entry 00001b00 map count=127

- Finn Arne

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu