diff options
author | Jamie Liu <[email protected]> | 2014-01-23 15:53:40 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2014-01-23 16:36:53 -0800 |
commit | a5998061daab27802c418debe662be98a6e42874 (patch) | |
tree | 8ca230b5f9917c6cac82011d1b6feb12014341bc | |
parent | 0d8a4a3799ab007b7a5e50aff9da9558925e0c15 (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 <[email protected]>
Cc: Shaohua Li <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Akinobu Mita <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/swapfile.c | 3 |
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: } } offset = si->lowest_bit; - while (++offset < scan_base) { + while (offset < scan_base) { if (!si->swap_map[offset]) { spin_lock(&si->lock); goto checks; @@ -629,6 +629,7 @@ scan: cond_resched(); latency_ration = LATENCY_LIMIT; } + offset++; } spin_lock(&si->lock); |