Skip to content

mm: mempolicy: fix mbind()'s inconsistent behavior for unmovable pages

Yang Shi linux-api linux-mm lkml 3 versions – Applied

Status from this message: [merged] mm-mempolicy-handle-vma-with-unmovable-pages-mapped-correctly-in-mbind.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 6 repliesApplied 2/2
  2. v32 patches 4 repliesSuperseded
  3. v22 patches 15 repliesSuperseded

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm: mempolicy: make the behavior consistent when MPOL_MF_MOVE* and MPOL_MF_STRICT were specifiedmm/mempolicy.c+48 -200 repliesApplied
2/2mm: mempolicy: handle vma with unmovable pages mapped correctly in mbindmm/mempolicy.c+25 -76 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVlastimil Babka
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [v4 PATCH 0/2] mm: mempolicy: fix mbind()'s inconsistent behavior for unmovable pages

Changelog
v4: * Fixed the comments from Vlastimil.
* Collected Vlastimil's Reviewed-by.
v3: * Adopted the suggestions from Vlastimil. Saved another 20 lines.
Using flag in struct queue_pages looks not outperform renumbering retval too much since we still have to return 1 to tell the caller there are unmovable pages. So just renumber the retval.
* Manpage is not very clear about shared pages when MPOL_MF_MOVE is specified, just leave it as it is for now till it gets clarified.
v2: * Fixed the inconsistent behavior by not aborting !vma_migratable()
immediately by a separate patch (patch 1/2), and this is also the preparation for patch 2/2. For the details please see the commit log. Per Vlastimil.
* Not abort immediately if unmovable page is met. This should handle non-LRU movable pages and temporary off-LRU pages more friendly. Per Vlastimil and Michal Hocko.

Yang Shi (2):
mm: mempolicy: make the behavior consistent when MPOL_MF_MOVE* and MPOL_MF_STRICT were specified
mm: mempolicy: handle vma with unmovable pages mapped correctly in mbind

 mm/mempolicy.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 73 insertions(+), 27 deletions(-)