From: Hailong liu Date: Thu, 31 Dec 2020 22:03:52 +0000 (+0000) Subject: mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint X-Git-Tag: howlett/maple_spf/20210104~187 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1727d2253d804498535b3710e78a071cbf920bdf;p=users%2Fjedix%2Flinux-maple.git mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint The trace point *trace_mm_page_alloc_zone_locked()* in __rmqueue() does not currently cover all branches. Add the missing tracepoint and check the page before do that. Link: https://lkml.kernel.org/r/20201228132901.41523-1-carver4lio@163.com Signed-off-by: Hailong liu Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index bdbec4c98173..fd741b0caca3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2873,7 +2873,7 @@ __rmqueue(struct zone *zone, unsigned int order, int migratetype, zone_page_state(zone, NR_FREE_PAGES) / 2) { page = __rmqueue_cma_fallback(zone, order); if (page) - return page; + goto out; } #endif retry: @@ -2886,8 +2886,9 @@ retry: alloc_flags)) goto retry; } - - trace_mm_page_alloc_zone_locked(page, order, migratetype); +out: + if (page) + trace_mm_page_alloc_zone_locked(page, order, migratetype); return page; }