Skip to contentSkip to conversation

mm, page_alloc: inline pageblock lookup in page free fast paths

PATCH New [email protected] 1 participant 1 message May 20, 2016

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 111/117 mm, page_alloc: inline pageblock lookup in page free fast paths

From: Mel Gorman <[email protected]>
Subject: mm, page_alloc: inline pageblock lookup in page free fast paths

The function call overhead of get_pfnblock_flags_mask() is measurable in the page free paths. This patch uses an inlined version that is faster.

---

 include/linux/mmzone.h |    7 -
 mm/page_alloc.c        |  188 ++++++++++++++++++++-------------------
 mm/page_owner.c        |    2 
 mm/vmstat.c            |    2 
 4 files changed, 102 insertions(+), 97 deletions(-)
include/linux/mmzone.h renamed from include/linux/mmzone.h~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths +0 -7
diff -puN include/linux/mmzone.h~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths include/linux/mmzone.h
@@ -85,13 +85,6 @@ extern int page_group_by_mobility_disabl
 	get_pfnblock_flags_mask(page, page_to_pfn(page),		\
 			PB_migrate_end, MIGRATETYPE_MASK)
 
-static inline int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
-{
-	BUILD_BUG_ON(PB_migrate_end - PB_migrate != 2);
-	return get_pfnblock_flags_mask(page, pfn, PB_migrate_end,
-					MIGRATETYPE_MASK);
-}
-
 struct free_area {
 	struct list_head	free_list[MIGRATE_TYPES];
 	unsigned long		nr_free;
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths +100 -88

200 lines not on this page · raw message

mm/page_owner.c renamed from mm/page_owner.c~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths +1 -1
diff -puN mm/page_owner.c~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths mm/page_owner.c
@@ -143,7 +143,7 @@ print_page_owner(char __user *buf, size_
 		goto err;
 
 	/* Print information relevant to grouping pages by mobility */
-	pageblock_mt = get_pfnblock_migratetype(page, pfn);
+	pageblock_mt = get_pageblock_migratetype(page);
 	page_mt  = gfpflags_to_migratetype(page_ext->gfp_mask);
 	ret += snprintf(kbuf + ret, count - ret,
 			"PFN %lu type %s Block %lu type %s Flags %#lx(%pGp)\n",
mm/vmstat.c renamed from mm/vmstat.c~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths +1 -1
diff -puN mm/vmstat.c~mm-page_alloc-inline-pageblock-lookup-in-page-free-fast-paths mm/vmstat.c
@@ -1041,7 +1041,7 @@ static void pagetypeinfo_showmixedcount_
 		block_end_pfn = min(block_end_pfn, end_pfn);
 
 		page = pfn_to_page(pfn);
-		pageblock_mt = get_pfnblock_migratetype(page, pfn);
+		pageblock_mt = get_pageblock_migratetype(page);
 
 		for (; pfn < block_end_pfn; pfn++) {
 			if (!pfn_valid_within(pfn))

_