--- a/mm/swapfile.c~swap_next-should-increase-position-index +++ a/mm/swapfile.c @@ -2737,10 +2737,10 @@ static void *swap_next(struct seq_file * else type = si->type + 1; + ++(*pos); for (; (si = swap_type_to_swap_info(type)); type++) { if (!(si->flags & SWP_USED) || !si->swap_map) continue; - ++*pos; return si; }