RFC: PPC64 hugepage rework

Joel Schopp jschopp at austin.ibm.com
Tue Sep 21 02:30:24 EST 2004


> The patch below reworks the ppc64 hugepage code.  Instead of using
> specially marked pmd entries in the normal pagetables to represent
> hugepages, use normal pte_t entries, in a special set of pagetables
> used for hugepages only.
> 
> Using pte_t instead of a special hugepte_t makes the code more similar
> to that for other architecturess, allowing more possibilities for
> consolidating the hugepage code.

Excellent!


> -static void flush_hash_hugepage(mm_context_t context, unsigned long ea,
> -				hugepte_t pte, int local);
> -

If you remove this you might fix up flush_hash_page so it works with 
huge pages.  Or did you do that and I just missed it?


> -int
> -follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
> -		    struct page **pages, struct vm_area_struct **vmas,
> -		    unsigned long *position, int *length, int i)
> +int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
> +			struct page **pages, struct vm_area_struct **vmas,
> +			unsigned long *position, int *length, int i)
>  {

This seems like unnecessary churn.

> -struct page *
> -follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
> +struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
> +			      int write)
>  {

Again, seems like a little extra churn.

> -struct page *
> -follow_huge_pmd(struct mm_struct *mm, unsigned long address,
> -		pmd_t *pmd, int write)
> +struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
> +			     pmd_t *pmd, int write)

Ditto.

>  {
> -	struct page *page;
> -
> -	BUG_ON(! pmd_hugepage(*pmd));
> -
> -	page = hugepte_page(*(hugepte_t *)pmd);
> -	if (page)
> -		page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT);
> -	return page;
> +	BUG();
> +	return NULL;
>  }

Why not just remove the function and let the compiler catch any errors 
instead of catching them at runtime?




More information about the Linuxppc64-dev mailing list