]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint
authorHailong liu <liu.hailong6@zte.com.cn>
Thu, 31 Dec 2020 22:03:52 +0000 (22:03 +0000)
committerJohannes Weiner <hannes@cmpxchg.org>
Thu, 31 Dec 2020 22:03:52 +0000 (22:03 +0000)
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 <liu.hailong6@zte.com.cn>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index bdbec4c981738dc4e821564d32abc0d897de29d1..fd741b0caca3a59ae91cff95efc5322222ffc923 100644 (file)
@@ -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;
 }