Re: [PATCH][2/2] do not OOM kill if we skip writing many pages

From: Andrea Arcangeli
Date: Sun Jan 02 2005 - 12:30:55 EST


On Mon, Dec 20, 2004 at 10:17:28AM -0500, Rik van Riel wrote:
> Simply running "dd if=/dev/zero of=/dev/hd<one you can miss>" will
> result in OOM kills, with the dirty pagecache completely filling up
> lowmem. This patch is part 2 to fixing that problem.
>
> Note that this test case demonstrates that the false OOM kills can
> also be reproduced with pages that are not "pinned" by the swap token
> at all, so there are some serious VM problems left still...
>
> If we cannot write out a number of pages because of congestion on
> the filesystem or block device, do not cause an OOM kill. These
> pages will become freeable later, when the congestion clears.

I don't like this one, it's much less obvious than 1/2. After your
obviously right 1/2 we're already guaranteed at least a percentage of
the ram will not be dirty. Is the below really needed even after 1/2 +
Andrew's fix? Are you sure this isn't a workaround for the lack of
Andrew's fix.

This 2/2 is absolutely generic, not related to highmem, and I'm at least
not having problem with Andrew's patch applied.

The conditional to out_of_memory especially looks not good, and I'm
scared it could generate livelocks.

I'm going to apply both your 1/2 and I already applied Andrew's
total_scanned, but from my part I'm not applying this 2/2. I believe to
be already safe with total_scanned + 1/2.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/