On Fri, 06 Jun 2008 16:28:42 -0400
Rik van Riel <riel@redhat.com> wrote:
The patch puts rather a lot of pressure onto vm_swap_full(). We might
want to look into optimising that.
- Is the 50% thing optimum? Could go higher and perhaps should be
based on amount-of-memory.
- Can precalculate the fraction rather than doing it inline all the time.
- Can make total_swap_pages __read_mostly and have a think about
nr_swap_pages too.
- Can completely optimise the thing away if !CONFIG_SWAP.
Has all this code been tested with CONFIG_SWAP=n?
What's going on here.
Normally we'll bump a page's refcount to account for its presence in a
pagevec. This code doesn't do that.
Is it safe? If so, how come?
Suitable code comments should be added which explain this unusual and
dangerous optimisation. Or fix the bug :)
--