[3/3] mm: mempolicy: check negative error of isolate_hugetlb() when failed to isolate a hugetlb
Commit Message
Better to check the negative error of isolate_hugetlb() when failed to
isolate a hugetlb page, which makes the code more clear.
No functional changes.
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
---
mm/mempolicy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -609,7 +609,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask,
if (flags & (MPOL_MF_MOVE_ALL) ||
(flags & MPOL_MF_MOVE && folio_estimated_sharers(folio) == 1 &&
!hugetlb_pmd_shared(pte))) {
- if (isolate_hugetlb(folio, qp->pagelist) &&
+ if (isolate_hugetlb(folio, qp->pagelist) < 0 &&
(flags & MPOL_MF_STRICT))
/*
* Failed to isolate folio but allow migrating pages