]> Git Repo - linux.git/commit
[PATCH] mm: ZAP_BLOCK causes redundant work
authorRobin Holt <[email protected]>
Mon, 14 Nov 2005 00:06:42 +0000 (16:06 -0800)
committerLinus Torvalds <[email protected]>
Mon, 14 Nov 2005 02:14:12 +0000 (18:14 -0800)
commit51c6f666fceb3184eeff045dad4432b602cd648e
tree33e29916e0fea872ba6f29eba698219a740b078f
parent885036d32f5d3c427c3e2b385b5a5503805e3e52
[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 <[email protected]>

  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 <[email protected]>

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 <[email protected]>
Signed-off-by: Nick Piggin <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/hugetlb.h
mm/memory.c
This page took 0.057471 seconds and 4 git commands to generate.