Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1323106
| From | "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/2] mempolicy: do not try to queue pages from !vma_migratable() |
| Date | 2016-02-01 14:30 +0100 |
| Message-ID | <qXmIj-3oo-25@gated-at.bofh.it> (permalink) |
| References | <qXmIi-3oo-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Maybe I miss some point, but I don't see a reason why we try to queue
pages from non migratable VMAs.
The only case when we can queue pages from such VMA is MPOL_MF_STRICT
plus MPOL_MF_MOVE or MPOL_MF_MOVE_ALL for VMA which has pages on LRU,
but gfp mask is not sutable for migaration (see mapping_gfp_mask() check
in vma_migratable()). That's looks like a bug to me.
Let's filter out non-migratable vma at start of queue_pages_test_walk()
and go to queue_pages_pte_range() only if MPOL_MF_MOVE or
MPOL_MF_MOVE_ALL flag is set.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
mm/mempolicy.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 27d135408a22..4c4187c0e1de 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -548,8 +548,7 @@ retry:
goto retry;
}
- if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
- migrate_page_add(page, qp->pagelist, flags);
+ migrate_page_add(page, qp->pagelist, flags);
}
pte_unmap_unlock(pte - 1, ptl);
cond_resched();
@@ -625,7 +624,7 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,
unsigned long endvma = vma->vm_end;
unsigned long flags = qp->flags;
- if (vma->vm_flags & VM_PFNMAP)
+ if (!vma_migratable(vma))
return 1;
if (endvma > end)
@@ -644,16 +643,13 @@ static int queue_pages_test_walk(unsigned long start, unsigned long end,
if (flags & MPOL_MF_LAZY) {
/* Similar to task_numa_work, skip inaccessible VMAs */
- if (vma_migratable(vma) &&
- vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
+ if (vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE))
change_prot_numa(vma, start, endvma);
return 1;
}
- if ((flags & MPOL_MF_STRICT) ||
- ((flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) &&
- vma_migratable(vma)))
- /* queue pages from current vma */
+ /* queue pages from current vma */
+ if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
return 0;
return 1;
}
--
2.7.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] Fix another VM_BUG_ON_PAGE(PageTail(page)) on mbind(2) "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-02-01 14:30 +0100
[PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-02-01 14:30 +0100
Re: [PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() Michal Hocko <mhocko@kernel.org> - 2016-02-01 15:30 +0100
Re: [PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-02-01 15:40 +0100
Re: [PATCH 1/2] mm: fix bogus VM_BUG_ON_PAGE() in isolate_lru_page() Michal Hocko <mhocko@kernel.org> - 2016-02-02 14:30 +0100
[PATCH 2/2] mempolicy: do not try to queue pages from !vma_migratable() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-02-01 14:30 +0100
Re: [PATCH 2/2] mempolicy: do not try to queue pages from !vma_migratable() Andrew Morton <akpm@linux-foundation.org> - 2016-02-01 23:30 +0100
csiph-web