All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: peterx@redhat.com, aarcange@redhat.com,
	akpm@linux-foundation.org, stable@vger.kernel.org,
	torvalds@linux-foundation.org, willy@infradead.org
Subject: Re: FAILED: patch "[PATCH] mm/hugetlb: fix calculation of" failed to apply to 4.4-stable tree
Date: Mon, 24 Aug 2020 10:10:29 +0200	[thread overview]
Message-ID: <20200824081029.GA92813@kroah.com> (raw)
In-Reply-To: <ca0c6c8e-0d90-9614-d7e4-c5a8c3372352@oracle.com>

On Thu, Aug 20, 2020 at 01:04:24PM -0700, Mike Kravetz wrote:
> On 8/19/20 5:21 AM, gregkh@linuxfoundation.org wrote:
> > 
> > The patch below does not apply to the 4.4-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>.
> > 
> > thanks,
> > 
> > greg k-h
> 
> >From d43b8a81c7f921aa52d55817390384053cd7be21 Mon Sep 17 00:00:00 2001
> From: Peter Xu <peterx@redhat.com>
> Date: Thu, 20 Aug 2020 10:38:02 -0700
> Subject: [PATCH] mm/hugetlb: fix calculation of
>  adjust_range_if_pmd_sharing_possible
> 
> commit 75802ca66354a39ab8e35822747cd08b3384a99a upstream
> 
> This is found by code observation only.
> 
> Firstly, the worst case scenario should assume the whole range was covered
> by pmd sharing.  The old algorithm might not work as expected for ranges
> like (1g-2m, 1g+2m), where the adjusted range should be (0, 1g+2m) but the
> expected range should be (0, 2g).
> 
> Since at it, remove the loop since it should not be required.  With that,
> the new code should be faster too when the invalidating range is huge.
> 
> Mike said:
> 
> : With range (1g-2m, 1g+2m) within a vma (0, 2g) the existing code will only
> : adjust to (0, 1g+2m) which is incorrect.
> :
> : We should cc stable.  The original reason for adjusting the range was to
> : prevent data corruption (getting wrong page).  Since the range is not
> : always adjusted correctly, the potential for corruption still exists.
> :
> : However, I am fairly confident that adjust_range_if_pmd_sharing_possible
> : is only gong to be called in two cases:
> :
> : 1) for a single page
> : 2) for range == entire vma
> :
> : In those cases, the current code should produce the correct results.
> :
> : To be safe, let's just cc stable.
> 
> Fixes: 017b1660df89 ("mm: migration: fix migration of huge PMD shared pages")
> Signed-off-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Cc: Matthew Wilcox <willy@infradead.org>
> Cc: <stable@vger.kernel.org>
> Link: http://lkml.kernel.org/r/20200730201636.74778-1-peterx@redhat.com
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
> ---
>  mm/hugetlb.c | 25 +++++++++++--------------

Thanks for all of the backports, now queued up.

greg k-h

      reply	other threads:[~2020-08-24  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 12:21 FAILED: patch "[PATCH] mm/hugetlb: fix calculation of" failed to apply to 4.4-stable tree gregkh
2020-08-20 20:04 ` Mike Kravetz
2020-08-24  8:10   ` Greg KH [this message]

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=20200824081029.GA92813@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=mike.kravetz@oracle.com \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.