linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd()
Date: Thu, 16 Jun 2016 13:17:44 +0300	[thread overview]
Message-ID: <20160616101744.GC18137@node.shutemov.name> (raw)
In-Reply-To: <050301d1c7af$9cbe81b0$d63b8510$@alibaba-inc.com>

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

  reply	other threads:[~2016-06-16 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <050201d1c7ae$9dbf9370$d93eba50$@alibaba-inc.com>
2016-06-16  9:15 ` [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd() Hillf Danton
2016-06-16 10:17   ` Kirill A. Shutemov [this message]
2016-06-06 14:06 [PATCHv9 00/32] THP-enabled tmpfs/shmem using compound pages Kirill A. Shutemov
2016-06-15 20:06 ` [PATCHv9-rebased2 00/37] " Kirill A. Shutemov
2016-06-15 20:06   ` [PATCHv9-rebased2 11/37] mm: introduce do_set_pmd() Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160616101744.GC18137@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).