Files
kernel/include/linux
David Gibson 9da61aef0f [PATCH] hugepage: Fix hugepage logic in free_pgtables()
free_pgtables() has special logic to call hugetlb_free_pgd_range() instead
of the normal free_pgd_range() on hugepage VMAs.  However, the test it uses
to do so is incorrect: it calls is_hugepage_only_range on a hugepage sized
range at the start of the vma.  is_hugepage_only_range() will return true
if the given range has any intersection with a hugepage address region, and
in this case the given region need not be hugepage aligned.  So, for
example, this test can return true if called on, say, a 4k VMA immediately
preceding a (nicely aligned) hugepage VMA.

At present we get away with this because the powerpc version of
hugetlb_free_pgd_range() is just a call to free_pgd_range().  On ia64 (the
only other arch with a non-trivial is_hugepage_only_range()) we get away
with it for a different reason; the hugepage area is not contiguous with
the rest of the user address space, and VMAs are not permitted in between,
so the test can't return a false positive there.

Nonetheless this should be fixed.  We do that in the patch below by
replacing the is_hugepage_only_range() test with an explicit test of the
VMA using is_vm_hugetlb_page().

This in turn changes behaviour for platforms where is_hugepage_only_range()
returns false always (everything except powerpc and ia64).  We address this
by ensuring that hugetlb_free_pgd_range() is defined to be identical to
free_pgd_range() (instead of a no-op) on everything except ia64.  Even so,
it will prevent some otherwise possible coalescing of calls down to
free_pgd_range().  Since this only happens for hugepage VMAs, removing this
small optimization seems unlikely to cause any trouble.

This patch causes no regressions on the libhugetlbfs testsuite - ppc64
POWER5 (8-way), ppc64 G5 (2-way) and i386 Pentium M (UP).

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Cc: William Lee Irwin III <wli@holomorphy.com>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-22 07:54:03 -08:00
..
2006-03-21 08:52:18 -08:00
2006-02-22 09:32:46 +00:00
2006-03-20 22:35:41 -08:00
2006-03-09 19:47:37 -08:00
2006-02-11 21:41:11 -08:00
2006-03-20 13:42:59 -08:00
2006-03-08 14:14:01 -08:00
2006-03-20 17:09:11 -08:00
2006-03-20 22:41:23 -08:00
2006-02-08 01:03:52 -05:00
2006-03-20 22:21:10 -08:00
2006-02-10 08:13:12 -08:00
2006-03-20 13:42:59 -08:00
2006-03-22 07:53:57 -08:00
2006-03-22 07:54:02 -08:00
2006-03-20 22:32:28 -08:00
2006-03-08 14:14:01 -08:00
2006-03-08 14:14:01 -08:00
2006-03-22 07:53:55 -08:00
2006-03-20 22:41:23 -08:00
2006-03-20 22:41:23 -08:00
2006-03-22 07:54:00 -08:00
2006-02-24 14:31:39 -08:00
2006-02-11 21:41:11 -08:00
2006-02-10 08:13:12 -08:00
2006-02-10 08:13:12 -08:00
2006-03-21 08:52:18 -08:00