diff options
-rw-r--r-- | mm/swap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/swap.c b/mm/swap.c index c370e59245f9..9649d99db5f9 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -597,13 +597,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); |