The patch titled Subject: mm-page_owner-make-init_pages_in_zone-faster-fix2 has been added to the -mm tree. Its filename is mm-page_owner-make-init_pages_in_zone-faster-fix2.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-page_owner-make-init_pages_in_zone-faster-fix2.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-page_owner-make-init_pages_in_zone-faster-fix2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Vlastimil Babka <vbabka@xxxxxxx> Subject: mm-page_owner-make-init_pages_in_zone-faster-fix2 Create statically allocated fake stack trace for early allocated pages, per Michal Hocko. Link: http://lkml.kernel.org/r/45813564-2342-fc8d-d31a-f4b68a724325@xxxxxxx Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Mel Gorman <mgorman@xxxxxxxxxxxxxxxxxxx> Cc: Yang Shi <yang.shi@xxxxxxxxxx> Cc: Laura Abbott <labbott@xxxxxxxxxx> Cc: Vinayak Menon <vinmenon@xxxxxxxxxxxxxx> Cc: zhong jiang <zhongjiang@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/page_owner.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff -puN mm/page_owner.c~mm-page_owner-make-init_pages_in_zone-faster-fix2 mm/page_owner.c --- a/mm/page_owner.c~mm-page_owner-make-init_pages_in_zone-faster-fix2 +++ a/mm/page_owner.c @@ -30,6 +30,7 @@ DEFINE_STATIC_KEY_FALSE(page_owner_inite static depot_stack_handle_t dummy_handle; static depot_stack_handle_t failure_handle; +static depot_stack_handle_t early_handle; static void init_early_allocated_pages(void); @@ -53,7 +54,7 @@ static bool need_page_owner(void) return true; } -static noinline void register_dummy_stack(void) +static __always_inline depot_stack_handle_t create_dummy_stack(void) { unsigned long entries[4]; struct stack_trace dummy; @@ -64,21 +65,22 @@ static noinline void register_dummy_stac dummy.skip = 0; save_stack_trace(&dummy); - dummy_handle = depot_save_stack(&dummy, GFP_KERNEL); + return depot_save_stack(&dummy, GFP_KERNEL); } -static noinline void register_failure_stack(void) +static noinline void register_dummy_stack(void) { - unsigned long entries[4]; - struct stack_trace failure; + dummy_handle = create_dummy_stack(); +} - failure.nr_entries = 0; - failure.max_entries = ARRAY_SIZE(entries); - failure.entries = &entries[0]; - failure.skip = 0; +static noinline void register_failure_stack(void) +{ + failure_handle = create_dummy_stack(); +} - save_stack_trace(&failure); - failure_handle = depot_save_stack(&failure, GFP_KERNEL); +static noinline void register_early_stack(void) +{ + early_handle = create_dummy_stack(); } static void init_page_owner(void) @@ -88,6 +90,7 @@ static void init_page_owner(void) register_dummy_stack(); register_failure_stack(); + register_early_stack(); static_branch_enable(&page_owner_inited); init_early_allocated_pages(); } @@ -529,13 +532,10 @@ static void init_pages_in_zone(pg_data_t unsigned long pfn = zone->zone_start_pfn, block_end_pfn; unsigned long end_pfn = pfn + zone->spanned_pages; unsigned long count = 0; - depot_stack_handle_t init_handle; /* Scan block by block. First and last block may be incomplete */ pfn = zone->zone_start_pfn; - init_handle = save_stack(0); - /* * Walk the zone in pageblock_nr_pages steps. If a page block spans * a zone boundary, it will be double counted between zones. This does @@ -582,7 +582,7 @@ static void init_pages_in_zone(pg_data_t continue; /* Found early allocated page */ - __set_page_owner_handle(page_ext, init_handle, 0, 0); + __set_page_owner_handle(page_ext, early_handle, 0, 0); count++; } } _ Patches currently in -mm which might be from vbabka@xxxxxxx are mm-page_owner-make-init_pages_in_zone-faster.patch mm-page_owner-make-init_pages_in_zone-faster-fix.patch mm-page_owner-make-init_pages_in_zone-faster-fix2.patch mm-page_ext-periodically-reschedule-during-page_ext_init.patch mm-page_owner-dont-grab-zone-lock-for-init_pages_in_zone.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html