diff mbox series

[3/3] mm: mempolicy: check negative error of isolate_hugetlb() when failed to isolate a hugetlb

Message ID db2459c4a8c31cba597680bd9dd7c868534e00be.1676342827.git.baolin.wang@linux.alibaba.com (mailing list archive)
State New
Headers show
Series Some cleanups for page isolation | expand

Commit Message

Baolin Wang Feb. 14, 2023, 3:18 a.m. UTC
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(-)
diff mbox series

Patch

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 0919c7a719d4..e3d87b21516b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -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