Re: [PATCH -mm 04/25] free swap space on swap-in/activation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Morton
Date: Friday, June 6, 2008 - 6:04 pm

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 :)


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH -mm 04/25] free swap space on swap-in/activation, Andrew Morton, (Fri Jun 6, 6:04 pm)