diff options
Diffstat (limited to 'mm/page_ext.c')
| -rw-r--r-- | mm/page_ext.c | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/page_ext.c b/mm/page_ext.c index 4548fcc66d74..95dd8ffeaf81 100644 --- a/mm/page_ext.c +++ b/mm/page_ext.c @@ -10,6 +10,7 @@  #include <linux/page_idle.h>  #include <linux/page_table_check.h>  #include <linux/rcupdate.h> +#include <linux/pgalloc_tag.h>  /*   * struct page extension @@ -82,6 +83,9 @@ static struct page_ext_operations *page_ext_ops[] __initdata = {  #if defined(CONFIG_PAGE_IDLE_FLAG) && !defined(CONFIG_64BIT)  	&page_idle_ops,  #endif +#ifdef CONFIG_MEM_ALLOC_PROFILING +	&page_alloc_tagging_ops, +#endif  #ifdef CONFIG_PAGE_TABLE_CHECK  	&page_table_check_ops,  #endif @@ -91,7 +95,16 @@ unsigned long page_ext_size;  static unsigned long total_usage; +#ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG +/* + * To ensure correct allocation tagging for pages, page_ext should be available + * before the first page allocation. Otherwise early task stacks will be + * allocated before page_ext initialization and missing tags will be flagged. + */ +bool early_page_ext __meminitdata = true; +#else  bool early_page_ext __meminitdata; +#endif  static int __init setup_early_page_ext(char *str)  {  	early_page_ext = true; @@ -501,7 +514,7 @@ void __meminit pgdat_page_ext_init(struct pglist_data *pgdat)   * Context: Any context.  Caller may not sleep until they have called   * page_ext_put().   */ -struct page_ext *page_ext_get(struct page *page) +struct page_ext *page_ext_get(const struct page *page)  {  	struct page_ext *page_ext;  |