[PATCH] fix free swap cache latency
Hugh Dickins authored

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: default avatarHugh Dickins <hugh@veritas.com>
Acked-by: default avatarNick Piggin <npiggin@suse.de>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.or...
6f5e6b9e
Name Last commit Last update
..
Kconfig [PATCH] Swap Migration V5: Add CONFIG_MIGRATION for page migration support
Makefile [PATCH] slob: introduce the SLOB allocator
bootmem.c [PATCH] FRV: Clean up bootmem allocator's page freeing algorithm
fadvise.c [PATCH] fadvise: return ESPIPE on FIFO/pipe
filemap.c [PATCH] mm: migration page refcounting fix
filemap.h [PATCH] xip: reduce code duplication
filemap_xip.c [PATCH] replace inode_update_time with file_update_time
fremap.c VM: add common helper function to create the page tables
highmem.c [PATCH] gfp_t: the rest
hugetlb.c [PATCH] compound page: use page[1].lru
internal.h [PATCH] FRV: Clean up bootmem allocator's page freeing algorithm
madvise.c [PATCH] madvise MADV_DONTFORK/MADV_DOFORK
memory.c [PATCH] fix free swap cache latency
memory_hotplug.c [PATCH] memory hotadd: pgdat->node_present_pages fix
mempolicy.c [PATCH] page migration: Fail with error if swap not setup
mempool.c [PATCH] gfp_t: mm/* (easy parts)
mincore.c [PATCH] freepgt: sys_mincore ignore FIRST_USER_PGD_NR
mlock.c [PATCH] move capable() to capability.h
mmap.c [PATCH] move capable() to capability.h
mprotect.c [PATCH] unpaged: private write VM_RESERVED
mremap.c [PATCH] move capable() to capability.h
msync.c [PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
nommu.c [PATCH] nommu: implement vmalloc_node()
oom_kill.c [PATCH] out_of_memory() locking fix
page-writeback.c [PATCH] mm: dirty_exceeded speedup
page_alloc.c
page_io.c
pdflush.c
prio_tree.c
readahead.c
rmap.c
shmem.c
slab.c
slob.c
sparse.c
swap.c
swap_state.c
swapfile.c
thrash.c
tiny-shmem.c
truncate.c
util.c
vmalloc.c
vmscan.c