diff -urN 2.3.18ac4/include/linux/sched.h 2.3.18ac4-trashmem/include/linux/sched.h --- 2.3.18ac4/include/linux/sched.h Wed Sep 15 14:48:32 1999 +++ 2.3.18ac4-trashmem/include/linux/sched.h Wed Sep 15 15:19:49 1999 @@ -321,6 +321,8 @@ /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; + int trashing_mem:1; + int trashing_bigmem:1; /* process credentials */ uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; @@ -404,7 +406,7 @@ /* utime */ {0,0,0,0},0, \ /* per CPU times */ {0, }, {0, }, \ /* flt */ 0,0,0,0,0,0, \ -/* swp */ 0, \ +/* swp */ 0,0,0, \ /* process credentials */ \ /* uid etc */ 0,0,0,0,0,0,0,0, \ /* suppl grps*/ 0, {0,}, \ diff -urN 2.3.18ac4/mm/page_alloc.c 2.3.18ac4-trashmem/mm/page_alloc.c --- 2.3.18ac4/mm/page_alloc.c Tue Sep 14 14:35:26 1999 +++ 2.3.18ac4-trashmem/mm/page_alloc.c Wed Sep 15 15:18:57 1999 @@ -255,43 +255,43 @@ */ if (!(current->flags & PF_MEMALLOC)) { int freed; - static int low_on_memory = 0; #ifndef CONFIG_BIGMEM if (nr_free_pages > freepages.min) { - if (!low_on_memory) + if (!current->trashing_mem) goto ok_to_allocate; if (nr_free_pages >= freepages.high) { - low_on_memory = 0; + current->trashing_mem = 0; goto ok_to_allocate; } } - low_on_memory = 1; + if (!current->trashing_mem) + current->trashing_mem = 1; #else - static int low_on_bigmemory = 0; - if (gfp_mask & __GFP_BIGMEM) { if (nr_free_pages > freepages.min) { - if (!low_on_bigmemory) + if (!current->trashing_bigmem) goto ok_to_allocate; if (nr_free_pages >= freepages.high) { - low_on_bigmemory = 0; + current->trashing_bigmem = 0; goto ok_to_allocate; } } - low_on_bigmemory = 1; + if (!current->trashing_bigmem) + current->trashing_bigmem = 1; } else { if (nr_free_pages-nr_free_bigpages > freepages.min) { - if (!low_on_memory) + if (!current->trashing_mem) goto ok_to_allocate; if (nr_free_pages-nr_free_bigpages >= freepages.high) { - low_on_memory = 0; + current->trashing_mem = 0; goto ok_to_allocate; } } - low_on_memory = 1; + if (!current->trashing_mem) + current->trashing_mem = 1; } #endif current->flags |= PF_MEMALLOC;