mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hailong liu <carver4lio@163.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	liu.hailong6@zte.com.cn
Subject: [PATCH] mm/page_alloc:add a missing mm_page_alloc_zone_locked tracepoint
Date: Mon, 28 Dec 2020 21:29:01 +0800	[thread overview]
Message-ID: <20201228132901.41523-1-carver4lio@163.com> (raw)

From: Hailong liu <liu.hailong6@zte.com.cn>

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.

Signed-off-by: Hailong liu <liu.hailong6@zte.com.cn>
---
 mm/page_alloc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7a2c89b21115..8cfa58bcf21a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2871,7 +2871,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:
@@ -2884,8 +2884,9 @@ __rmqueue(struct zone *zone, unsigned int order, int migratetype,
 								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;
 }
 
-- 
2.17.1



             reply	other threads:[~2020-12-28 13:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:29 Hailong liu [this message]
2020-12-29 21:23 ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201228132901.41523-1-carver4lio@163.com \
    --to=carver4lio@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liu.hailong6@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®