2001-02-19 23:54:32

by Marcelo Tosatti

[permalink] [raw]
Subject: [PATCH] run_task_queue(&tq_disk) only if we written data to disk


Hi,

This patch makes page_launder() do actual disk IO
(run_task_queue(&tq_disk)) only if IO was queued in the page freeing
loop.

If we freed enough clean pages without needing do to any disk IO, there is
no need to call run_task_queue(&tq_disk).


--- linux/mm/vmscan.c.orig Mon Feb 19 20:46:23 2001
+++ linux/mm/vmscan.c Mon Feb 19 20:47:21 2001
@@ -657,12 +657,13 @@
}

/*
- * We have to make sure the data is actually written to
- * the disk now, otherwise we'll never get enough clean
- * pages and the system will keep queueing dirty pages
+ * If we written something to disk, we have to make sure the data
is
+ * actually written to the disk now, otherwise we'll never get
enough
+ * clean pages and the system will keep queueing dirty pages
* for flushing.
*/
- run_task_queue(&tq_disk);
+ if (launder_loop)
+ run_task_queue(&tq_disk);

/*
* Return the amount of pages we freed or made freeable.