From 67f5ca801f96f21afc5bef07230a3261a934edc1 Mon Sep 17 00:00:00 2001 From: KAMEZAWA Hiroyuki Date: Mon, 9 Aug 2010 17:20:09 -0700 Subject: [PATCH] --- yaml --- r: 207284 b: refs/heads/master c: 966cca029f739716fbcc8068b8c6dfe381f86fc3 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/swapfile.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 07a10e8543dc..30dca803176e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 979f867191f80e74713394cf8c0a3c1b3662b648 +refs/heads/master: 966cca029f739716fbcc8068b8c6dfe381f86fc3 diff --git a/trunk/mm/swapfile.c b/trunk/mm/swapfile.c index 03aa2d55f1a2..f08d165871b3 100644 --- a/trunk/mm/swapfile.c +++ b/trunk/mm/swapfile.c @@ -318,8 +318,10 @@ static inline unsigned long scan_swap_map(struct swap_info_struct *si, if (offset > si->highest_bit) scan_base = offset = si->lowest_bit; - /* reuse swap entry of cache-only swap if not busy. */ - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { + /* reuse swap entry of cache-only swap if not hibernation. */ + if (vm_swap_full() + && usage == SWAP_HAS_CACHE + && si->swap_map[offset] == SWAP_HAS_CACHE) { int swap_was_freed; spin_unlock(&swap_lock); swap_was_freed = __try_to_reclaim_swap(si, offset);