[PATCH 1/7] unevictable lru: Remember page's active state

Lee Schermerhorn
2008-07-30T20:06:24Z

Fix to unevictable-lru-infrastructure.patch

Not sure this is absolutely required, but:

Preserve page's incoming active flag across retries in
putback_lru_page().

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>

mm/vmscan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.27-rc1-mmotm-30jul/mm/vmscan.c
===================================================================
--- linux-2.6.27-rc1-mmotm-30jul.orig/mm/vmscan.c 2008-07-30 12:57:31.000000000 -0400
+++ linux-2.6.27-rc1-mmotm-30jul/mm/vmscan.c 2008-07-30 12:58:41.000000000 -0400
@@ -483,12 +483,12 @@ int remove_mapping(struct address_space
void putback_lru_page(struct page *page)
{
int lru;
+ int active = !!TestClearPageActive(page);
int was_unevictable = PageUnevictable(page);

VM_BUG_ON(PageLRU(page));

redo:
- lru = !!TestClearPageActive(page);
ClearPageUnevictable(page);

if (page_evictable(page, NULL)) {
@@ -498,7 +498,7 @@ redo:
* unevictable page on [in]active list.
* We know how to handle that.
*/
- lru += page_is_file_cache(page);
+ lru = active + page_is_file_cache(page);
lru_cache_add_lru(page, lru);
} else {
/*