Please don't do this.
> do {
> int result;
> - tsk->swap_address = address + PAGE_SIZE;
> result = try_to_swap_out(tsk, vma, address, pte, gfp_mask);
> + address += PAGE_SIZE;
> + tsk->swap_address = address;
The above is horribly broken, and should be killed on sight.
"swap_address" _must_ be set before try_to_swap_out(), because otherwise
when try-to_swap_out() sleeps any other processes trying to free will
start from the wrong address - unfairly penalizing the process in
question, as the accessed bits have been cleared.
If the above help, it only does so because it is unfair - which _can_ help
simply because other processes run faster.
It looks like you tried to optimize away one add, at the expense of
getting the whole algorithm wrong.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/