* Re: FAILED: patch "[PATCH] proc/pagemap: walk page tables under pte lock" failed to apply to 3.10-stable tree
[not found] ` <54F49B56.5040705@google.com>
@ 2015-04-26 10:53 ` gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-04-26 10:53 UTC (permalink / raw)
To: Peter Feiner
Cc: Naoya Horiguchi, khlebnikov@yandex-team.ru,
a.ryabinin@samsung.com, akpm@linux-foundation.org,
gorcunov@openvz.org, kirill.shutemov@linux.intel.com,
stable@vger.kernel.org, torvalds@linux-foundation.org
On Mon, Mar 02, 2015 at 09:18:14AM -0800, Peter Feiner wrote:
>
> On 03/01/2015 10:28 PM, Naoya Horiguchi wrote:
> >On Sat, Feb 28, 2015 at 02:45:34PM -0800, gregkh@linuxfoundation.org wrote:
> >>The patch below does not apply to the 3.10-stable tree.
> >>If someone wants it applied there, or to any other stable or longterm
> >>tree, then please email the backport, including the original git commit
> >>id to <stable@vger.kernel.org>.
> >Basically a major reason of the conflict is the lack of the following patch:
> >
> > commit 81d0fa623c5b8dbd5279d9713094b0f9b0a00fb4
> > Author: Peter Feiner <pfeiner@google.com>
> > Date: Thu Oct 9 15:28:32 2014 -0700
> > mm: softdirty: unmapped addresses between VMAs are clean
> >
> >but unlike for v3.14, v3.10 doesn't have soft_dirty or split pmd lock, so
> >we need some manual resolution to apply 81d0fa623c5b and 05fbf357d941 on
> >top of v3.10.70.
> >
> >I think the resolution might be mainly cosmetic, but I'm not 100% sure that
> >the altered patches (attached) introduce no unstablity.
> >
> >Peter, Konstantin, could you check attached ones and find out whether these
> >patches work fine on v3.10.70? Or if there is any good reason to skip this
> >backporting safely, that's fine.
> Sorry about sending this patch twice to some of you!
>
> Naoya, I think those patches look fine. However, since 3.10 doesn't have
> softdirty, the backport of 81d0fa623c5b amounts to a bunch of cruft. I
> recommend applying a modified version of 05fbf357d941 on its own in order to
> keep the stable diff small.
>
> Signed-off-by: Peter Feiner <pfeiner@google.com>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 65fc60a..fad881b 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -903,7 +903,8 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long
> addr, unsigned long end,
> {
> struct vm_area_struct *vma;
> struct pagemapread *pm = walk->private;
> - pte_t *pte;
> + spinlock_t *ptl;
> + pte_t *pte, *orig_pte;
> int err = 0;
> pagemap_entry_t pme = make_pme(PM_NOT_PRESENT);
>
> @@ -926,7 +927,9 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long
> addr, unsigned long end,
>
> if (pmd_trans_unstable(pmd))
> return 0;
> - for (; addr != end; addr += PAGE_SIZE) {
> +
> + orig_pte = pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
> + for (; addr != end; addr += PAGE_SIZE, pte++) {
>
> /* check to see if we've left 'vma' behind
> * and need a new, higher one */
> @@ -939,15 +942,13 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long
> addr, unsigned long end,
> * and that it isn't a huge page vma */
> if (vma && (vma->vm_start <= addr) &&
> !is_vm_hugetlb_page(vma)) {
> - pte = pte_offset_map(pmd, addr);
> pte_to_pagemap_entry(&pme, vma, addr, *pte);
> - /* unmap before userspace copy */
> - pte_unmap(pte);
> }
> err = add_to_pagemap(addr, &pme, pm);
> if (err)
> - return err;
> + break;
> }
> + pte_unmap_unlock(orig_pte, ptl);
>
> cond_resched();
Naoya, can you resend these in a format that I can apply them in, after
you are able to test them, if you want them in the older kernel
releases.
thanks,
greg k-h
^ permalink raw reply [flat|nested] only message in thread