Re: [patch] my latest oom stuff

Andrea Arcangeli (andrea@e-mind.com)
Mon, 26 Oct 1998 13:44:05 +0100 (CET)


On Mon, 26 Oct 1998, Andrea Arcangeli wrote:

>On Mon, 26 Oct 1998, Andrea Arcangeli wrote:
>
>>>Could you try the above simple approach?
>>
>>Sure.
>
>Seems to works fine here.
>
>Here the patch against your pre-2.1.127-1:

Woops excuse Linus, the patch was against 2.1.126 clean.

Here a little _incremental_ patch though:

Index: linux/mm/vmscan.c
diff -u linux/mm/vmscan.c:1.1.1.2.4.14 linux/mm/vmscan.c:1.1.1.2.4.15
--- linux/mm/vmscan.c:1.1.1.2.4.14 Mon Oct 26 01:44:59 1998
+++ linux/mm/vmscan.c Mon Oct 26 13:34:22 1998
@@ -537,9 +537,9 @@
init_swap_timer();
kswapd_task = current;
while (1) {
- unsigned long start;
+ unsigned long stop;

- run_task_queue(&tq_disk);
+/* run_task_queue(&tq_disk); */
flush_signals(current);
/*
* Remeber to enable up the swap tick before go to sleep.
@@ -552,19 +552,13 @@
/*
* Do the pageout for at most one jiffy.
*/
- start =jiffies;
+ stop = jiffies + (2 - free_memory_available());
do {
do_try_to_free_page(0);
- /*
- * Syncing large chunks is faster than swapping
- * synchronously (less head movement). -- Rik.
- */
- if (atomic_read(&nr_async_pages) >= pager_daemon.swap_cluster)
- run_task_queue(&tq_disk);
if (free_memory_available() == 2 && buffer_under_max()
&& pgcache_under_max())
break;
- } while (jiffies == start);
+ } while ((long)(stop - jiffies) >= 0);
}
/* As if we could ever get here - maybe we want to make this killable */
kswapd_task = NULL;

Increasing the time of some jiffies make no difference for the deadlock
since when we are OOM do_try_to_free_pages() is always longer than some
jiffies, but it helps when we are out of RAM and we have to swapout.

I also stopped the run_task_queue() since many times there are a few page
to swapout and I think it' s an improvement.

The whole new patch against 2.1.126 or pre-2.1.127-1 can be downloaded
from here:

ftp://e-mind.com/pub/linux/kernel-patches/oom-15-....

Andrea Arcangeli

-
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/