try_to_swap_out() return value problem?

Marcelo Tosatti (marcelo@conectiva.com.br)
Thu, 4 Jan 2001 03:23:10 -0200 (BRST)


Hi Linus,

Your latest changes to try_to_swap_out() does not seem to be obviously
correct.

- if (mm->swap_cnt)
- mm->swap_cnt--;
+ if (!mm->swap_cnt)
+ return 1;
+
+ mm->swap_cnt--;

Having swap_cnt == 0 does not necessarily mean that we successfully freed
a page (look at the page aging and locking checks in try_to_swap_out).

Now refill_inactive() relies on the assumption that swap_out() returning
1 means we successfully freed a page:

while (swap_out(priority, gfp_mask)) {
made_progress = 1;
if (--count <= 0)
goto done;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/