Re: 2.6.15-rc4 panic in __nr_to_section() with CONFIG_SPARSEMEM

From: David Gibson
Date: Thu Dec 08 2005 - 18:54:29 EST



On Thu, Dec 08, 2005 at 11:15:35AM -0800, Dave Hansen wrote:
> On Thu, 2005-12-08 at 08:07 -0800, Badari Pulavarty wrote:
> > No. It doesn't help. It looks like ppc pmd_huge() always returns 0.
> > Don't know why ? :(
>
> The ppc64 hugetlb pages don't line up on PMD boundaries like they do on
> i386. The entries are stored in regular old PTEs.
>
> I really don't like coding the two different hugetlb cases, but I can't
> think of a better way to do it. Anyone care to test on ppc64?

> - mss->resident += PAGE_SIZE;
> + page_size = PAGE_SIZE;
> + if (is_hugepage_only_range(vma->vm_mm, addr, end - addr))
> + page_size = HPAGE_SIZE;

This is an incorrect usage of is_hugepage_only_range(). Although it
will get the right answer by accident here, that function should
*only* be used for testing whether a range is suitable for normal
pages, never for determining if hugepages are actually in use here.
You have the VMA here, so test its flag instead here.

--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/