lkml.org 
[lkml]   [2013]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 15/44] metag: Huge TLB
On 01/10/2013 07:30 AM, James Hogan wrote:
> +pte_t *huge_pte_alloc(struct mm_struct *mm,
> + unsigned long addr, unsigned long sz)
> +{
> + pgd_t *pgd;
> + pud_t *pud;
> + pmd_t *pmd;
> + pte_t *pte;
> +
> + pgd = pgd_offset(mm, addr);
> + pud = pud_offset(pgd, addr);
> + pmd = pmd_offset(pud, addr);
> + pte = pte_alloc_map(mm, NULL, pmd, addr);
> + pgd->pgd &= ~_PAGE_SZ_MASK;
> + pgd->pgd |= _PAGE_SZHUGE;
> +
> + return pte;
> +}

I'd be a bit surprised if you don't have to check for NULL during the
walk down the page tables. Is there a special reason on your
architecture that this is unnecessary?

(There are several of these, not just this one).



\
 
 \ /
  Last update: 2013-01-10 18:41    [W:0.474 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site