aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2014-01-23 18:53:40 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-23 19:36:53 -0500
commita5998061daab27802c418debe662be98a6e42874 (patch)
tree8ca230b5f9917c6cac82011d1b6feb12014341bc /mm/swapfile.c
parent0d8a4a3799ab007b7a5e50aff9da9558925e0c15 (diff)
mm/swapfile.c: do not skip lowest_bit in scan_swap_map() scan loop
In the second half of scan_swap_map()'s scan loop, offset is set to si->lowest_bit and then incremented before entering the loop for the first time, causing si->swap_map[si->lowest_bit] to be skipped. Signed-off-by: Jamie Liu <jamieliu@google.com> Cc: Shaohua Li <shli@fusionio.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d443dea95c27..c6c13b050a58 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -616,7 +616,7 @@ scan:
616 } 616 }
617 } 617 }
618 offset = si->lowest_bit; 618 offset = si->lowest_bit;
619 while (++offset < scan_base) { 619 while (offset < scan_base) {
620 if (!si->swap_map[offset]) { 620 if (!si->swap_map[offset]) {
621 spin_lock(&si->lock); 621 spin_lock(&si->lock);
622 goto checks; 622 goto checks;
@@ -629,6 +629,7 @@ scan:
629 cond_resched(); 629 cond_resched();
630 latency_ration = LATENCY_LIMIT; 630 latency_ration = LATENCY_LIMIT;
631 } 631 }
632 offset++;
632 } 633 }
633 spin_lock(&si->lock); 634 spin_lock(&si->lock);
634 635