kernel-ark/mm
Robin Holt 51c6f666fc [PATCH] mm: ZAP_BLOCK causes redundant work
The address based work estimate for unmapping (for lockbreak) is and always
was horribly inefficient for sparse mappings.  The problem is most simply
explained with an example:

If we find a pgd is clear, we still have to call into unmap_page_range
PGDIR_SIZE / ZAP_BLOCK_SIZE times, each time checking the clear pgd, in
order to progress the working address to the next pgd.

The fundamental way to solve the problem is to keep track of the end
address we've processed and pass it back to the higher layers.

From: Nick Piggin <npiggin@suse.de>

  Modification to completely get away from address based work estimate
  and instead use an abstract count, with a very small cost for empty
  entries as opposed to present pages.

  On 2.6.14-git2, ppc64, and CONFIG_PREEMPT=y, mapping and unmapping 1TB
  of virtual address space takes 1.69s; with the following patch applied,
  this operation can be done 1000 times in less than 0.01s

From: Andrew Morton <akpm@osdl.org>

With CONFIG_HUTETLB_PAGE=n:

mm/memory.c: In function `unmap_vmas':
mm/memory.c:779: warning: division by zero

Due to

			zap_work -= (end - start) /
					(HPAGE_SIZE / PAGE_SIZE);

So make the dummy HPAGE_SIZE non-zero

Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-13 18:14:12 -08:00
..
bootmem.c [PATCH] core remove PageReserved 2005-10-29 21:40:39 -07:00
fadvise.c [PATCH] xip: madvice/fadvice: execute in place 2005-06-24 00:06:42 -07:00
filemap_xip.c [PATCH] mm: rmap with inner ptlock 2005-10-29 21:40:41 -07:00
filemap.c [PATCH] fs: error case fix in __generic_file_aio_read 2005-10-30 17:37:22 -08:00
filemap.h [PATCH] xip: reduce code duplication 2005-06-24 00:06:41 -07:00
fremap.c [PATCH] mm: ptd_alloc take ptlock 2005-10-29 21:40:40 -07:00
highmem.c [PATCH] gfp_t: the rest 2005-10-28 08:16:51 -07:00
hugetlb.c [PATCH] unexport hugetlb_total_pages 2005-11-07 07:54:06 -08:00
internal.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Kconfig [PATCH] Suppress split ptlock on arches which may use one page for multiple page tables 2005-11-07 07:53:23 -08:00
madvise.c [PATCH] core remove PageReserved 2005-10-29 21:40:39 -07:00
Makefile [PATCH] memory hotplug: sysfs and add/remove functions 2005-10-29 21:40:44 -07:00
memory_hotplug.c [PATCH] memory hotplug: call setup_per_zone_pages_min after hotplug 2005-10-29 21:40:44 -07:00
memory.c [PATCH] mm: ZAP_BLOCK causes redundant work 2005-11-13 18:14:12 -08:00
mempolicy.c [PATCH] cpusets: automatic numa mempolicy rebinding 2005-10-30 17:37:22 -08:00
mempool.c [PATCH] gfp_t: mm/* (easy parts) 2005-10-28 08:16:47 -07:00
mincore.c [PATCH] freepgt: sys_mincore ignore FIRST_USER_PGD_NR 2005-04-19 13:29:20 -07:00
mlock.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mmap.c [PATCH] mm/{mmap,nommu}.c: several unexports 2005-11-07 07:54:06 -08:00
mprotect.c [PATCH] mm: pte_offset_map_lock loops 2005-10-29 21:40:40 -07:00
mremap.c [PATCH] mm: split page table lock 2005-10-29 21:40:42 -07:00
msync.c [PATCH] mm: pte_offset_map_lock loops 2005-10-29 21:40:40 -07:00
nommu.c [PATCH] mm/{mmap,nommu}.c: several unexports 2005-11-07 07:54:06 -08:00
oom_kill.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
page_alloc.c [PATCH] mm: __GFP_NOFAIL fix 2005-11-13 18:14:12 -08:00
page_io.c [PATCH] mm: split page table lock 2005-10-29 21:40:42 -07:00
page-writeback.c [PATCH] unexport clear_page_dirty_for_io 2005-11-07 07:54:06 -08:00
pdflush.c [PATCH] cpusets: confine pdflush to its cpuset 2005-10-30 17:37:21 -08:00
prio_tree.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
readahead.c [PATCH] readahead commentary 2005-11-07 07:53:37 -08:00
rmap.c [PATCH] mm: update comments to pte lock 2005-10-29 21:40:42 -07:00
shmem.c [PATCH] mm: split page table lock 2005-10-29 21:40:42 -07:00
slab.c mm/slab.c: fix a comment typo 2005-11-08 16:44:08 +01:00
sparse.c [PATCH] memory hotplug: move section_mem_map alloc to sparse.c 2005-10-29 21:40:44 -07:00
swap_state.c [PATCH] mm/swap_state.c: unexport swapper_space 2005-11-07 07:54:07 -08:00
swap.c [PATCH] mm/swap.c: unexport vm_acct_memory 2005-11-07 07:54:07 -08:00
swapfile.c [PATCH] mm/swapfile.c: unexport total_swap_pages 2005-11-07 07:54:07 -08:00
thrash.c [PATCH] swaptoken tuning 2005-10-29 21:40:35 -07:00
tiny-shmem.c [PATCH] Error checks omitted in init_tmpfs() in mm/tiny-shmem.c 2005-10-30 17:37:27 -08:00
truncate.c [PATCH] ext3: Fix unmapped buffers in transaction's lists 2005-10-30 17:37:17 -08:00
vmalloc.c [PATCH] kernel-doc: fix warnings in vmalloc.c 2005-11-07 07:53:56 -08:00
vmscan.c [PATCH] mm: split page table lock 2005-10-29 21:40:42 -07:00