Index: linux-2.6/mm/quicklist.c =================================================================== --- linux-2.6.orig/mm/quicklist.c 2008-01-02 13:13:41.000000000 -0800 +++ linux-2.6/mm/quicklist.c 2008-01-02 13:40:50.000000000 -0800 @@ -40,6 +40,9 @@ static long min_pages_to_free(struct qui pages_to_free = q->nr_pages - max_pages(min_pages); + if (pages_to_free < 0) + return 0; + return min(pages_to_free, max_free); } @@ -56,6 +59,8 @@ void quicklist_trim(int nr, void (*dtor) if (q->nr_pages > min_pages) { pages_to_free = min_pages_to_free(q, min_pages, max_free); + printk("cpu=%d nr_pages=%d min_pages=%d to_free=%d\n", + smp_processor_id(), q->nr_pages, min_pages, pages_to_free); while (pages_to_free > 0) { /* * We pass a gfp_t of 0 to quicklist_alloc here @@ -68,6 +73,7 @@ void quicklist_trim(int nr, void (*dtor) free_page((unsigned long)p); pages_to_free--; } + printk("end nr_pages=%d\n", q->nr_pages); } put_cpu_var(quicklist); }