ANDROID: mm: page_pinner: add more struct page fields
While I was investigating CMA allocation latency, adding fields below were very useful to detect the CMA allocation latency issues. This patch adds following fields of struct page. for struct page: int count int mapcount struct address_space This patch removes page_mt since it was not useful ever for me. Bug: 192475091 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I312505901a227cd404555f845550d2a9c9ce89da
This commit is contained in:
@@ -29,9 +29,13 @@ struct captured_pinner {
|
||||
s64 ts_usec;
|
||||
s64 elapsed;
|
||||
};
|
||||
int page_mt;
|
||||
unsigned long page_flags;
|
||||
|
||||
/* struct page fields */
|
||||
unsigned long pfn;
|
||||
int count;
|
||||
int mapcount;
|
||||
struct address_space *mapping;
|
||||
unsigned long flags;
|
||||
};
|
||||
|
||||
struct longterm_pinner {
|
||||
@@ -117,9 +121,11 @@ static noinline depot_stack_handle_t save_stack(gfp_t flags)
|
||||
static void capture_page_state(struct page *page,
|
||||
struct captured_pinner *record)
|
||||
{
|
||||
record->page_flags = page->flags;
|
||||
record->page_mt = get_pageblock_migratetype(page);
|
||||
record->flags = page->flags;
|
||||
record->mapping = page_mapping(page);
|
||||
record->pfn = page_to_pfn(page);
|
||||
record->count = page_count(page);
|
||||
record->mapcount = page_mapcount(page);
|
||||
}
|
||||
|
||||
static void check_longterm_pin(struct page_pinner *page_pinner,
|
||||
@@ -238,11 +244,12 @@ print_page_pinner(bool longterm, char __user *buf, size_t count, struct captured
|
||||
|
||||
/* Print information relevant to grouping pages by mobility */
|
||||
ret += snprintf(kbuf + ret, count - ret,
|
||||
"PFN %lu Block %lu type %s Flags %#lx(%pGp)\n",
|
||||
"PFN 0x%lx Block %lu count %d mapcount %d mapping %pS Flags %#lx(%pGp)\n",
|
||||
record->pfn,
|
||||
record->pfn >> pageblock_order,
|
||||
migratetype_names[record->page_mt],
|
||||
record->page_flags, &record->page_flags);
|
||||
record->count, record->mapcount,
|
||||
record->mapping,
|
||||
record->flags, &record->flags);
|
||||
|
||||
if (ret >= count)
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user