Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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 <jamieliu@google.com>
Cc: Shaohua Li <shli@fusionio.com>
Acked-by: default avatarHugh Dickins <hughd@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0d8a4a37
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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]) {
			spin_lock(&si->lock);
			goto checks;
@@ -629,6 +629,7 @@ static unsigned long scan_swap_map(struct swap_info_struct *si,
			cond_resched();
			latency_ration = LATENCY_LIMIT;
		}
		offset++;
	}
	spin_lock(&si->lock);