Re: [PATCH 2/3 htlb-fault] Demand faulting for huge pages

From: Andrew Morton
Date: Thu Sep 29 2005 - 01:11:20 EST


Adam Litke <agl@xxxxxxxxxx> wrote:
>
> +int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
> + unsigned long address, int write_access)
> +{
> + pte_t *ptep;
> + int rc = VM_FAULT_MINOR;
> +
> + spin_lock(&mm->page_table_lock);
> +
> + ptep = huge_pte_alloc(mm, address);
> + if (!ptep) {
> + rc = VM_FAULT_SIGBUS;
> + goto out;
> + }
> + if (pte_none(*ptep))
> + rc = hugetlb_pte_fault(mm, vma, address, write_access);
> +out:
> + if (rc == VM_FAULT_MINOR)
> + flush_tlb_page(vma, address);
> +
> + spin_unlock(&mm->page_table_lock);
> + return rc;
> +}

label `out' can be moved down a couple of lines.

-
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/