summaryrefslogtreecommitdiffstats
path: root/mm/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap.c')
-rw-r--r--mm/swap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/swap.c b/mm/swap.c
index 30b6a37c74af..1fb25f8bb155 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -631,13 +631,15 @@ static void __lru_cache_add(struct page *page)
*/
void lru_cache_add_anon(struct page *page)
{
- ClearPageActive(page);
+ if (PageActive(page))
+ ClearPageActive(page);
__lru_cache_add(page);
}
void lru_cache_add_file(struct page *page)
{
- ClearPageActive(page);
+ if (PageActive(page))
+ ClearPageActive(page);
__lru_cache_add(page);
}
EXPORT_SYMBOL(lru_cache_add_file);