On Sat, 17 Jun 2000, Alan Cox wrote:
> 2.2.17pre4
> o Winchip C6 has buggy TSC (Dave Jones)
> o TCP crash workaround for the problem seen by
> auctionnet (Alexey Kuznetsov)
> o VM improvements (mm-fix-3) (Andrea Arcangeli)
Alan,
Andrea's mm-fix-3 returned success on do_try_to_free_pages only if the
number of request pages were freed.
This patch from Rik modifies do_try_to_free_pages to return success on any
progress, making VM less fragile.
--- vmscan.c.orig Fri Jan 3 03:25:04 1997
+++ vmscan.c Fri Jan 3 03:31:23 1997
@@ -380,6 +380,8 @@
static int do_try_to_free_pages(unsigned int gfp_mask)
{
int priority;
+ int ret = 0;
+ int swapcount;
int count = SWAP_CLUSTER_MAX;
lock_kernel();
@@ -390,6 +392,7 @@
priority = 6;
do {
while (shrink_mmap(priority, gfp_mask)) {
+ ret = 1;
if (!--count)
goto done;
}
@@ -397,15 +400,18 @@
/* Try to get rid of some shared memory pages.. */
if (gfp_mask & __GFP_IO) {
while (shm_swap(priority, gfp_mask)) {
+ ret = 1;
if (!--count)
goto done;
}
}
/* Then, try to page stuff out.. */
+ swapcount = count;
while (swap_out(priority, gfp_mask)) {
- if (!--count)
- goto done;
+ ret = 1;
+ if (!--swapcount)
+ break;
}
shrink_dcache_memory(priority, gfp_mask);
@@ -417,7 +423,7 @@
printk("VM: do_try_to_free_pages failed for %s...\n",
current->comm);
/* Return success if we freed a page. */
- return priority >= 0;
+ return ret;
}
/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:14 EST