[PATCH 11/16] mm/migration: remove unneeded lock page and PageMovable check

From: Miaohe Lin
Date: Fri Mar 04 2022 - 04:36:02 EST


When non-lru movable page was freed from under us, __ClearPageMovable must
have been done. Even if it's not done, __ClearPageIsolated here won't hurt
as page will be freed soon. So we can thus remove unneeded lock page and
PageMovable check here.

Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
---
mm/migrate.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 1de5289a4af0..e0db06927f02 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1074,12 +1074,8 @@ static int unmap_and_move(new_page_t get_new_page,
/* page was freed from under us. So we are done. */
ClearPageActive(page);
ClearPageUnevictable(page);
- if (unlikely(__PageMovable(page))) {
- lock_page(page);
- if (!PageMovable(page))
- __ClearPageIsolated(page);
- unlock_page(page);
- }
+ if (unlikely(__PageMovable(page)))
+ __ClearPageIsolated(page);
goto out;
}

--
2.23.0