Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423905

Re: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd()

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd()
Date 2016-06-16 12:20 +0200
Message-ID <rKCyZ-75H-17@gated-at.bofh.it> (permalink)
References <rKBCV-6wx-5@gated-at.bofh.it> <rKBCV-6wx-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd() "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-06-16 11:20 +0200
  Re: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd() "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-06-16 12:20 +0200

csiph-web