Commit a5998061 authored by Jamie Liu's avatar Jamie Liu Committed by Linus Torvalds

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: default avatarJamie Liu <>
Cc: Shaohua Li <>
Acked-by: default avatarHugh Dickins <>
Cc: Minchan Kim <>
Cc: Akinobu Mita <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 0d8a4a37
......@@ -616,7 +616,7 @@ static unsigned long scan_swap_map(struct swap_info_struct *si,
offset = si->lowest_bit;
while (++offset < scan_base) {
while (offset < scan_base) {
if (!si->swap_map[offset]) {
goto checks;
......@@ -629,6 +629,7 @@ static unsigned long scan_swap_map(struct swap_info_struct *si,
latency_ration = LATENCY_LIMIT;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment