Skip to contentSkip to conversation

mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu

PATCH New [email protected] 1 participant 1 message May 3, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 50/102 mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu

From: Minchan Kim <[email protected]>
Subject: mm: remove SWAP_MLOCK check for SWAP_SUCCESS in ttu

If the page is mapped and rescue in try_to_unmap_one, page_mapcount(page) == 0 cannot be true so page_mapcount check in try_to_unmap is enough to return SWAP_SUCCESS. IOW, SWAP_MLOCK check is redundant so remove it.

Cc Anshuman Khandual <[email protected]>
Cc Hillf Danton <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kirill A. Shutemov <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 mm/rmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/rmap.c renamed from mm/rmap.c~mm-remove-swap_mlock-check-for-swap_success-in-ttu +1 -1
diff -puN mm/rmap.c~mm-remove-swap_mlock-check-for-swap_success-in-ttu mm/rmap.c
@@ -1535,7 +1535,7 @@ int try_to_unmap(struct page *page, enum
 	else
 		ret = rmap_walk(page, &rwc);
 
-	if (ret != SWAP_MLOCK && !page_mapcount(page))
+	if (!page_mapcount(page))
 		ret = SWAP_SUCCESS;
 	return ret;
 }

_