stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Yang Shi <yang.shi@linux.alibaba.com>
Cc: sashal@kernel.org, osalvador@suse.de, chrubis@suse.cz,
	kirill@shutemov.name, aquini@redhat.com, rientjes@google.com,
	vbabka@suse.cz, akpm@linux-foundation.org,
	torvalds@linux-foundation.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [4.14-stable PATCH] mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
Date: Wed, 3 Apr 2019 16:05:56 +0200	[thread overview]
Message-ID: <20190403140556.GE8633@kroah.com> (raw)
In-Reply-To: <1554160580-5848-1-git-send-email-yang.shi@linux.alibaba.com>

On Tue, Apr 02, 2019 at 07:16:20AM +0800, Yang Shi wrote:
> commit a7f40cfe3b7ada57af9b62fd28430eeb4a7cfcb7 upstream
> 
> When MPOL_MF_STRICT was specified and an existing page was already on a
> node that does not follow the policy, mbind() should return -EIO.  But
> commit 6f4576e3687b ("mempolicy: apply page table walker on
> queue_pages_range()") broke the rule.
> 
> And commit c8633798497c ("mm: mempolicy: mbind and migrate_pages support
> thp migration") didn't return the correct value for THP mbind() too.
> 
> If MPOL_MF_STRICT is set, ignore vma_migratable() to make sure it
> reaches queue_pages_to_pte_range() or queue_pages_pmd() to check if an
> existing page was already on a node that does not follow the policy.
> And, non-migratable vma may be used, return -EIO too if MPOL_MF_MOVE or
> MPOL_MF_MOVE_ALL was specified.
> 
> Tested with https://github.com/metan-ucw/ltp/blob/master/testcases/kernel/syscalls/mbind/mbind02.c
> 
> [akpm@linux-foundation.org: tweak code comment]
> Link: http://lkml.kernel.org/r/1553020556-38583-1-git-send-email-yang.shi@linux.alibaba.com
> Fixes: 6f4576e3687b ("mempolicy: apply page table walker on queue_pages_range()")
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> Reported-by: Cyril Hrubis <chrubis@suse.cz>
> Suggested-by: Kirill A. Shutemov <kirill@shutemov.name>
> Acked-by: Rafael Aquini <aquini@redhat.com>
> Reviewed-by: Oscar Salvador <osalvador@suse.de>
> Acked-by: David Rientjes <rientjes@google.com>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
>  mm/mempolicy.c | 40 +++++++++++++++++++++++++++++++++-------
>  1 file changed, 33 insertions(+), 7 deletions(-)

All 3 of these now queued up, thanks.

greg k-h

           reply	other threads:[~2019-04-03 14:06 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1554160580-5848-1-git-send-email-yang.shi@linux.alibaba.com>]

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=20190403140556.GE8633@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=aquini@redhat.com \
    --cc=chrubis@suse.cz \
    --cc=kirill@shutemov.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osalvador@suse.de \
    --cc=rientjes@google.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=yang.shi@linux.alibaba.com \
    /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).