Re: kswapd failed under 2.1.63

Gadi Oxman (gadio@netvision.net.il)
Sun, 16 Nov 1997 01:40:44 +0300 (IST)


On Sat, 15 Nov 1997, Nicholas J. Leon wrote:

> Whilst running 'badblocks -vw -o ....' on an 2.4GB RAID5 device (across
> 3 drives) on
...
> I got loads of these
>
> Kswapd failed: got 27/96
>
> Out of memory for kswapd<c3800fc8/bf7ff90>

The following patch is essentially the same buffer cache fix which
we introduced in 2.0.31 for the above condition.

Gadi

--- linux/fs/buffer.c~ Sun Nov 16 01:11:49 1997
+++ linux/fs/buffer.c Sun Nov 16 01:11:49 1997
@@ -781,18 +781,12 @@
return;

/* Too bad, that was not enough. Try a little harder to grow some. */
- if (nr_free_pages > min_free_pages + 5) {
+ if (nr_free_pages > (min_free_pages + free_pages_low) / 2) {
if (grow_buffers(GFP_BUFFER, size)) {
obtained += PAGE_SIZE;
goto repeat;
}
}
-
- /*
- * Make one more attempt to allocate some buffers.
- */
- if (grow_buffers(GFP_ATOMIC, size))
- obtained += PAGE_SIZE;

/*
* If we got any buffers, or another task freed some,