From 13362ab28eadf7062829032d497a74a7905911ca Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Sun, 11 Jul 2021 12:44:33 -0700 Subject: [PATCH] ANDROID: mm: page_pinner: add state of page_pinner To keep track of page migration failures, record the following page states to capture natural state transitions of a page during migration: * detected * put reference count * free With such transition change, it was a lot easier to analyze page migration failure issues. Since we already have annotation on the put_page side, this patch adds the record in free path and page migration failure path. Bug: 192475091 Signed-off-by: Minchan Kim Change-Id: I18182d3fd62850c5580c9e89a5362bdae630f153 --- mm/page_pinner.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/page_pinner.c b/mm/page_pinner.c index 64b1e4154561..f4a141aafac6 100644 --- a/mm/page_pinner.c +++ b/mm/page_pinner.c @@ -174,6 +174,8 @@ void __reset_page_pinner(struct page *page, unsigned int order, bool free) page_pinner = get_page_pinner(page_ext); if (free) { + /* record page free call path */ + __page_pinner_migration_failed(page); atomic_set(&page_pinner->count, 0); __clear_bit(PAGE_EXT_PINNER_MIGRATION_FAILED, &page_ext->flags); } else { @@ -363,6 +365,7 @@ void __page_pinner_mark_migration_failed_pages(struct list_head *page_list) if (unlikely(!page_ext)) continue; __set_bit(PAGE_EXT_PINNER_MIGRATION_FAILED, &page_ext->flags); + __page_pinner_migration_failed(page); } }