1
linux/mm
Hugh Dickins e0da382c92 [PATCH] freepgt: free_pgtables use vma list
Recent woes with some arches needing their own pgd_addr_end macro; and 4-level
clear_page_range regression since 2.6.10's clear_page_tables; and its
long-standing well-known inefficiency in searching throughout the higher-level
page tables for those few entries to clear and free: all can be blamed on
ignoring the list of vmas when we free page tables.

Replace exit_mmap's clear_page_range of the total user address space by
free_pgtables operating on the mm's vma list; unmap_region use it in the same
way, giving floor and ceiling beyond which it may not free tables.  This
brings lmbench fork/exec/sh numbers back to 2.6.10 (unless preempt is enabled,
in which case latency fixes spoil unmap_vmas throughput).

Beware: the do_mmap_pgoff driver failure case must now use unmap_region
instead of zap_page_range, since a page table might have been allocated, and
can only be freed while it is touched by some vma.

Move free_pgtables from mmap.c to memory.c, where its lower levels are adapted
from the clear_page_range levels.  (Most of free_pgtables' old code was
actually for a non-existent case, prev not properly set up, dating from before
hch gave us split_vma.) Pass mmu_gather** in the public interfaces, since we
might want to add latency lockdrops later; but no attempt to do so yet, going
by vma should itself reduce latency.

But what if is_hugepage_only_range?  Those ia64 and ppc64 cases need careful
examination: put that off until a later patch of the series.

What of x86_64's 32bit vdso page __map_syscall32 maps outside any vma?

And the range to sparc64's flush_tlb_pgtables?  It's less clear to me now that
we need to do more than is done here - every PMD_SIZE ever occupied will be
flushed, do we really have to flush every PGDIR_SIZE ever partially occupied? 
A shame to complicate it unnecessarily.

Special thanks to David Miller for time spent repairing my ceilings.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-19 13:29:15 -07:00
..
bootmem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
fadvise.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
filemap.c [PATCH] filemap_getpage can block when MAP_NONBLOCK specified 2005-04-16 15:24:05 -07:00
fremap.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
highmem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
hugetlb.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
internal.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
madvise.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
memory.c [PATCH] freepgt: free_pgtables use vma list 2005-04-19 13:29:15 -07:00
mempolicy.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mempool.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mincore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mlock.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmap.c [PATCH] freepgt: free_pgtables use vma list 2005-04-19 13:29:15 -07:00
mprotect.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mremap.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
msync.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
nommu.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
oom_kill.c [PATCH] oom-killer disable for iscsi/lvm2/multipath userland critical sections 2005-04-16 15:24:05 -07:00
page_alloc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
page_io.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
page-writeback.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pdflush.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
prio_tree.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
readahead.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
rmap.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
shmem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
slab.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
swap_state.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
swap.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
swapfile.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
thrash.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tiny-shmem.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
truncate.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmalloc.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmscan.c [PATCH] vmscan: pageout(): remove unneeded test 2005-04-16 15:24:06 -07:00