This bug causes the last PTE page not freed when a task's mmap is freed. The last PTE page corresponds to stack area which is usually valid. The bug causes slow memory leak, roughly 4k (one page) per died process. Pete Popov narrowed down the problem to PTE page leak before I further spotted the root. Jun diff -Nru linux-test/include/asm-mips/pgtable.h.orig linux-test/include/asm-mips/pgtable.h --- linux-test/include/asm-mips/pgtable.h.orig Wed Jan 2 14:00:57 2002 +++ linux-test/include/asm-mips/pgtable.h Thu Jan 3 13:04:51 2002 @@ -104,7 +104,7 @@ #define PTRS_PER_PTE 1024 #define PTRS_PER_PMD 1 #define PTRS_PER_PGD 1024 -#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) +#define USER_PTRS_PER_PGD ((TASK_SIZE-1)/PGDIR_SIZE + 1) #define FIRST_USER_PGD_NR 0 #define VMALLOC_START KSEG2