[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
reduce shrink_mmap rate of failure (initial attempt)
Hi all,
This is a trivial first attempt to reduce shrink_mmap failures
(leading to swap)
It is against 2.4.0-test1-ac7-riel3 but that is almost what
we have currently - and it is trivial to apply with an editor.
It might be possible to improve this further - but it is a start.
(Time for bed...)
/RogerL
--
Home page:
http://www.norran.net/nra02596/
--- /usr/src/linux/mm/filemap.c.orig Sat Jun 3 19:09:16 2000
+++ /usr/src/linux/mm/filemap.c Wed Jun 7 01:21:19 2000
@@ -332,6 +332,14 @@
if (page->age)
goto dispose_continue;
+ /*
+ * Page is from a zone we don't care about.
+ * Don't drop page cache entries in vain.
+ * Must be done before count - or do a count++
+ */
+ if (page->zone->free_pages > page->zone->pages_high)
+ goto dispose_continue;
+
count--;
/*
* Avoid unscalable SMP locking for pages we can
@@ -367,13 +375,6 @@
goto made_buffer_progress;
}
}
-
- /*
- * Page is from a zone we don't care about.
- * Don't drop page cache entries in vain.
- */
- if (page->zone->free_pages > page->zone->pages_high)
- goto unlock_continue;
/* Take the pagecache_lock spinlock held to avoid
other tasks to notice the page while we are looking at its