mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Shiraz Hashim <shashim@codeaurora.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"oleg@redhat.com" <oleg@redhat.com>,
	"gorcunov@openvz.org" <gorcunov@openvz.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] mm: pagemap: limit scan to virtual region being asked
Date: Wed, 11 Feb 2015 14:09:15 -0800	[thread overview]
Message-ID: <20150211140915.760d9737099fa0f1669818a8@linux-foundation.org> (raw)
In-Reply-To: <20150114010830.GA16100@hori1.linux.bs1.fc.nec.co.jp>

On Wed, 14 Jan 2015 01:08:40 +0000 Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> wrote:

> On Tue, Jan 13, 2015 at 05:57:04PM +0530, Shiraz Hashim wrote:
> > pagemap_read scans through the virtual address space of a
> > task till it prepares 'count' pagemaps or it reaches end
> > of task.
> > 
> > This presents a problem when the page walk doesn't happen
> > for vma with VM_PFNMAP set. In which case walk is silently
> > skipped and no pagemap is prepare, in turn making
> > pagemap_read to scan through task end, even crossing beyond
> > 'count', landing into a different vma region. This leads to
> > wrong presentation of mappings for that vma.
> > 
> > Fix this by limiting end_vaddr to the end of the virtual
> > address region being scanned.
> > 
> > Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
> 
> This patch works in some case, but there still seems a problem in another case.
> 
> Consider that we have two vmas within some narrow (PAGEMAP_WALK_SIZE) region.
> One vma in lower address is VM_PFNMAP, and the other vma in higher address is not.
> Then a single call of walk_page_range() skips the first vma and scans the
> second vma, but the pagemap record of the second vma will be stored on the
> wrong offset in the buffer, because we just skip vma(VM_PFNMAP) without calling
> any callbacks (within which add_to_pagemap() increments pm.pos).
> 
> So calling pte_hole() for vma(VM_PFNMAP) looks a better fix to me.
> 

Can we get this finished off?  ASAP, please.

  parent reply	other threads:[~2015-02-11 22:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 12:27 Shiraz Hashim
2015-01-14  1:08 ` Naoya Horiguchi
2015-01-18 17:13   ` Shiraz Hashim
2015-02-11 22:09   ` Andrew Morton [this message]
2015-02-11 23:16     ` Naoya Horiguchi

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=20150211140915.760d9737099fa0f1669818a8@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=gorcunov@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=oleg@redhat.com \
    --cc=shashim@codeaurora.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

all inboxes | Powered by JetHome®