diff options
author | Yang Shi <[email protected]> | 2019-03-28 20:43:55 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-03-29 10:01:37 -0700 |
commit | a7f40cfe3b7ada57af9b62fd28430eeb4a7cfcb7 (patch) | |
tree | 6a4f0cd417d878f5a6e7b04d4db1a5305590bcf3 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | a953e7721fa9999fd628885ed451e16641a23d1e (diff) |
mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
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
[[email protected]: tweak code comment]
Link: http://lkml.kernel.org/r/[email protected]
Fixes: 6f4576e3687b ("mempolicy: apply page table walker on queue_pages_range()")
Signed-off-by: Yang Shi <[email protected]>
Signed-off-by: Oscar Salvador <[email protected]>
Reported-by: Cyril Hrubis <[email protected]>
Suggested-by: Kirill A. Shutemov <[email protected]>
Acked-by: Rafael Aquini <[email protected]>
Reviewed-by: Oscar Salvador <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions