Re: PATCH: Improvements in shrink_mmap and kswapd

From: Rik van Riel (
Date: Sat Jun 17 2000 - 18:12:32 EST

On 18 Jun 2000, Juan J. Quintela wrote:

> Reports of success/failure are welcome. Comments are also welcome.

I have a few comments on the patch. They have mostly to do
with the maxlaunder logic.

A few days ago I sent you the buffer.c patch where
try_to_free_buffers was modified so that it would never try
to do IO on pages if the 'wait' argument has a value of -1.

This can be combined with maxlaunder in a nice way. Firstly
we need to wakeup_bdflush() if we queued some buffers or swap
pages for IO, that way bdflush will flush dirty and IO queued
pages to disk.

Secondly we need to try try_to_free_buffers(page, -1) first,
currently you count freeing buffers without doing IO as an
IO operation (and also, you're starting IO operations when
__GFP_IO isn't set). If that fails and maxlaunder isn't reached
yet, we can try to start asynchronous IO on the page.

When we reach the end of shrink_mmap, we can do something like

wait = 0;
if (nr_writes && (gfp_mask & __GFP_IO))
        wait = 1;
if (wait && !ret) {
        goto again; /* bdflush just made pages available, roll again */

This will give us something like write throttling where apps
will be waiting for bdflush to have done IO on pages so we'll
have freeable pages around. If __GFP_IO isn't set we'll still
fail, of course, but this will at least keep applications from
failing needlessly.



The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? / #kernelnewbies

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:15 EST