lkml.org 
[lkml]   [2016]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd()
On Thu, Jun 16, 2016 at 05:15:22PM +0800, Hillf Danton wrote:
> > +
> > +static int do_set_pmd(struct fault_env *fe, struct page *page)
> > +{
> > + struct vm_area_struct *vma = fe->vma;
> > + bool write = fe->flags & FAULT_FLAG_WRITE;
> > + unsigned long haddr = fe->address & HPAGE_PMD_MASK;
> > + pmd_t entry;
> > + int i, ret;
> > +
> > + if (!transhuge_vma_suitable(vma, haddr))
> > + return VM_FAULT_FALLBACK;
> > +
> > + ret = VM_FAULT_FALLBACK;
> > + page = compound_head(page);
> > +
> > + fe->ptl = pmd_lock(vma->vm_mm, fe->pmd);
> > + if (unlikely(!pmd_none(*fe->pmd)))
> > + goto out;
>
> Can we reply to the caller that fault is handled correctly(by
> resetting ret to zero before jump)?

It's non necessary handled. It's handled only if the pmd if huge. If it
points to pte table, we need to check relevant pte entry.

If pmd is huge it will caught by pte_alloc_one_map() later.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2016-06-16 13:01    [W:0.383 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site