Skip to contentSkip to conversation

mm-hugetlbc-remove-the-unnecessary-non_swap_entry.patch removed from -mm tree

merged [email protected] 1 participant 1 message Oct 14, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/hugetlb.c: remove the unnecessary non_swap_entry()
has been removed from the -mm tree. Its filename was
mm-hugetlbc-remove-the-unnecessary-non_swap_entry.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Baoquan He <[email protected]>
Subject: mm/hugetlb.c: remove the unnecessary non_swap_entry()

If a swap entry tests positive for either is_[migration|hwpoison]_entry(), then its swap_type() is among SWP_MIGRATION_READ, SWP_MIGRATION_WRITE and SWP_HWPOISON. All these types >= MAX_SWAPFILES, exactly what is asserted with non_swap_entry().

So the checking non_swap_entry() in is_hugetlb_entry_migration() and is_hugetlb_entry_hwpoisoned() is redundant.

Let's remove it to optimize code.

---

 mm/hugetlb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlbc-remove-the-unnecessary-non_swap_entry +2 -2
@@ -3799,7 +3799,7 @@ bool is_hugetlb_entry_migration(pte_t pt
 	if (huge_pte_none(pte) || pte_present(pte))
 		return false;
 	swp = pte_to_swp_entry(pte);
-	if (non_swap_entry(swp) && is_migration_entry(swp))
+	if (is_migration_entry(swp))
 		return true;
 	else
 		return false;
@@ -3812,7 +3812,7 @@ static bool is_hugetlb_entry_hwpoisoned(
 	if (huge_pte_none(pte) || pte_present(pte))
 		return false;
 	swp = pte_to_swp_entry(pte);
-	if (non_swap_entry(swp) && is_hwpoison_entry(swp))
+	if (is_hwpoison_entry(swp))
 		return true;
 	else
 		return false;

_

Patches currently in -mm which might be from [email protected] are