Swap Attacks in 89-5

Andrew Lewycky (alewycky@globalserve.net)
Sun, 01 Mar 1998 19:18:29 -0500


I've been trying out pre-patch-2.1.89-5, and I've been experiencing swap
attacks, in which the kernel suddenly decides to page out as much as
24 megs all at once (on a 48 meg system). This occurs on working sets
that used to invoke less than 6 megs of swapping. (Additionally, when
this happens, the drive light goes on and the system locks up hard, but
there is no activity for 10-20 seconds before the paging starts.)

After the last attack, I was able to collect the following information
from shift-scroll lock: 24892kB of free pages, 7*4kB, 530*8kB, 589*16kB,
268*32kB, 37*64kB and 2*128kB.

Looking through the diff, it looks like this results from the
combination of two changes: the new free_memory_available, which only
returns true if there are two of the largest size blocks available, and
the removal of the MAX_SWAP_FAIL counter from kswapd.

It seems to me that the real problem is that free_memory_available will
not give up until two 128k blocks are free, but in order to satisfy this
demand, the paging system does LRU swapouts. So it has to swap out vast
amounts of memory before getting to the missing page from the 128k
blocks.

I guess we need two paging policies: "the usual", for when you just need
user-space pages or maybe small blocks, and "I want that page there",
for when you need to put together some huge block for a DMA buffer or
whatever.

In the meanwhile, I'm going to weaken free_memory_available, and put
the MAX_SWAP_FAIL counter back in, but maybe bump it up to around 12.

Andrew Lewycky
alewycky@globalserve.net

P.S. When replying, please CC to me, since I'm not subscribed to
linux-kernel at the moment.

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