From 3a71ca149650ea1d7072c9a3771725529eabb95b Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Fri, 21 May 2021 11:43:54 -0700 Subject: [PATCH] ANDROID: mm: page_pinner: skip marking failure on freeable pages Sometime, pages are temporarily pinnned during migration and the migration fails. However, putback_movable_pages will end up freeing them if their page refcount are 1. Thus, it doesn't need to mark them as failure, which just consumes page_pinner logbuffer to lose old history. Bug: 188908895 Signed-off-by: Minchan Kim Change-Id: I8564b72b212a5095cfe3ba6bf5622a9b62f5b455 --- mm/page_pinner.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/page_pinner.c b/mm/page_pinner.c index 9bf41de47e9a..5bd7364b4a91 100644 --- a/mm/page_pinner.c +++ b/mm/page_pinner.c @@ -334,6 +334,9 @@ void __page_pinner_mark_migration_failed_pages(struct list_head *page_list) struct page_ext *page_ext; list_for_each_entry(page, page_list, lru) { + /* The page will be freed by putback_movable_pages soon */ + if (page_count(page) == 1) + continue; page_ext = lookup_page_ext(page); if (unlikely(!page_ext)) continue;