[patch] readahead must be stopped when OOM

Andrea Arcangeli (andrea@suse.de)
Mon, 20 Sep 1999 20:44:17 +0200 (CEST)


This is a part of my new oom-patch updated to 2.3.18ac6:

diff -urN 2.3.18ac6/mm/filemap.c 2.3.18ac6-oom/mm/filemap.c
--- 2.3.18ac6/mm/filemap.c Mon Sep 20 01:15:46 1999
+++ 2.3.18ac6-oom/mm/filemap.c Mon Sep 20 02:42:38 1999
@@ -923,7 +923,8 @@
ahead = 0;
while (ahead < max_ahead) {
ahead += PAGE_CACHE_SIZE;
- page_cache_read(filp, raend + ahead);
+ if (page_cache_read(filp, raend + ahead) < 0)
+ break;
}
/*
* If we tried to read ahead some pages,

The above was missing from the filemap.c oom fixes in 2.3.18ac6.

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/