Re: Magic in swap code. :-)

Chirayu Patel (chirayu@wipro.tcpn.com)
Tue, 31 Mar 1998 18:01:39 +0530 (GMT+0530)


On Mon, 30 Mar 1998, Rik van Riel wrote:

> On Fri, 27 Mar 1998, Chirayu Patel wrote:
>
> > Please let me have your comments on it. I am working on a patch for
> > 2.1.90, which is almost complete.
>
> It would be best to reserve the SWAP_READONLY behaviour
> for swapping-from-a-tasks-context, since we don't really
> care about kswapd blocking for disk I/O...
>
> I'll test it and implement the swapping-RO-from-user-context
> idea at the same time...
>

I have a 16MB machine. What happens is that whenever I have used up a
considerable amount of swap space...and say I open a Netscape preference
window. It takes a lot of time and there is a lot of hard-disk activity
and my mouse control becomes jerky.

What I feel is happening is - kswapd does a asychronous write of the dirty
pages to the disk and frees the required number of pages. But by the time
the Netscape preference window gets loaded in memory we have already
started writing the dirty pages to the swapdevice..and this increases the
load in the hard disk.

My fix proposes to delay the freeing of the dirty pages to the disk ..and
only do the writes (asynchronously ofcourse!) when the system is IDLE or
enough read only pages are not available.

I have put the patch for this in my system and I am observing a noticable
improvement in the interactive-ness.

The other thing which I had proposed is to determine if the system is
sufficiently IDLE we can pre-swap the dirty pages and reset the dirty bit.
So even these pages can be swapped out (as they are no longer dirty) when
kswapd executes. Ofcourse the sort of behaviour depends on a lot of
parameters as described in my previous mail.

Comments please.......

--
Chirayu

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu