ANDROID: mm: add get_page_owner_handle function

Add and export get_page_owner_handle function which returns
the handle for the corresponding page_ext, this will be used
by the minidump module to get page_owner info.

Bug: 177374907
Change-Id: I7b3641f7c6ad918f4111c98d715904477f92185b
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
This commit is contained in:
Vijayanand Jitta
2021-01-12 00:15:31 +05:30
committed by Suren Baghdasaryan
parent 00f1d5d229
commit 8f302083dc
2 changed files with 21 additions and 0 deletions

View File

@@ -104,6 +104,25 @@ struct page_owner *get_page_owner(struct page_ext *page_ext)
}
EXPORT_SYMBOL_GPL(get_page_owner);
depot_stack_handle_t get_page_owner_handle(struct page_ext *page_ext, unsigned long pfn)
{
struct page_owner *page_owner;
depot_stack_handle_t handle;
if (!page_owner_enabled)
return 0;
page_owner = get_page_owner(page_ext);
/* skip handle for tail pages of higher order allocations */
if (!IS_ALIGNED(pfn, 1 << page_owner->order))
return 0;
handle = READ_ONCE(page_owner->handle);
return handle;
}
EXPORT_SYMBOL_GPL(get_page_owner_handle);
static inline bool check_recursive_alloc(unsigned long *entries,
unsigned int nr_entries,
unsigned long ip)