Re: [PATCH] fix free swap cache latency

From: Ingo Molnar
Date: Thu Mar 16 2006 - 17:07:34 EST



* Hugh Dickins <hugh@xxxxxxxxxxx> wrote:

> Lee Revell reported 28ms latency when process with lots of swapped memory
> exits.
>
> 2.6.15 introduced a latency regression when unmapping: in accounting the
> zap_work latency breaker, pte_none counted 1, pte_present PAGE_SIZE, but
> a swap entry counted nothing at all. We think of pages present as the
> slow case, but Lee's trace shows that free_swap_and_cache's radix tree
> lookup can make a lot of work - and we could have been doing it many
> thousands of times without a latency break.
>
> Move the zap_work update up to account swap entries like pages present.
> This does account non-linear pte_file entries, and unmap_mapping_range
> skipping over swap entries, by the same amount even though they're quick:
> but neither of those cases deserves complicating the code (and they're
> treated no worse than they were in 2.6.14).
>
> Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
> Acked-by: Nick Piggin <npiggin@xxxxxxx>

i've added this patch to the 2.6.16-rc6 based -rt kernel yesterday and
have ran an overnight stresstest on an SMP box (which creates heavy
swapping too, amongst other things), which found no problems whatsoever.
(not that we would expect any, but it's still nice to know.)

Acked-by: Ingo Molnar <mingo@xxxxxxx>

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