lkml.org 
[lkml]   [2015]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/1] mm: pagemap: limit scan to virtual region being asked
Date
On Wed, Feb 11, 2015 at 02:09:15PM -0800, Andrew Morton wrote:
> 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.

Yes, I think so.
The patch "mm: pagewalk: call pte_hole() for VM_PFNMAP during walk_page_range"
(replacing this patch) is already in mainline.

Thanks,
Naoya Horiguchi

\
 
 \ /
  Last update: 2015-02-12 00:41    [W:0.064 / U:1.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site