diff options
-rw-r--r-- | mm/swapfile.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 03aa2d55f1a2..f08d165871b3 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -318,8 +318,10 @@ checks: | |||
318 | if (offset > si->highest_bit) | 318 | if (offset > si->highest_bit) |
319 | scan_base = offset = si->lowest_bit; | 319 | scan_base = offset = si->lowest_bit; |
320 | 320 | ||
321 | /* reuse swap entry of cache-only swap if not busy. */ | 321 | /* reuse swap entry of cache-only swap if not hibernation. */ |
322 | if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) { | 322 | if (vm_swap_full() |
323 | && usage == SWAP_HAS_CACHE | ||
324 | && si->swap_map[offset] == SWAP_HAS_CACHE) { | ||
323 | int swap_was_freed; | 325 | int swap_was_freed; |
324 | spin_unlock(&swap_lock); | 326 | spin_unlock(&swap_lock); |
325 | swap_was_freed = __try_to_reclaim_swap(si, offset); | 327 | swap_was_freed = __try_to_reclaim_swap(si, offset); |