linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mm, page_owner: only track migration if enabled
Date: Fri, 27 Nov 2015 14:58:37 +0100	[thread overview]
Message-ID: <3209032.Njpu4mxStH@wuerfel> (raw)

The newly added code to print page ownership in dump_page fails
to link when CONFIG_MIGRATION is disabled:

mm/built-in.o: In function `print_page_owner':
frame_vector.c:(.text+0x72358): undefined reference to `migrate_reason_names'

This changes the two users of migrate_reason_names to first check
CONFIG_MIGRATION, which avoids the error.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cf7ec391dae4 ("mm, page_owner: dump page owner info from dump_page()")
---
Found on yesterday's linux-next with ARM randconfig builds. The patch
that introduced this is currently in Andrews tree.

If you don't already have a fix, please apply this one on top, or fold
it into the original commit.

diff --git a/mm/page_owner.c b/mm/page_owner.c
index a81cfa0c13c3..4033542c3f5a 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -170,7 +170,8 @@ print_page_owner(char __user *buf, size_t count, unsigned long pfn,
 	if (ret >= count)
 		goto err;
 
-	if (page_ext->last_migrate_reason != -1) {
+	if (IS_ENABLED(CONFIG_MIGRATION) &&
+	    page_ext->last_migrate_reason != -1) {
 		ret += snprintf(kbuf + ret, count - ret,
 			"Page has been migrated, last migrate reason: %s\n",
 			migrate_reason_names[page_ext->last_migrate_reason]);
@@ -213,7 +214,8 @@ void __dump_page_owner(struct page *page)
 	dump_gfpflag_names(gfp_mask);
 	print_stack_trace(&trace, 0);
 
-	if (page_ext->last_migrate_reason != -1)
+	if (IS_ENABLED(CONFIG_MIGRATION) &&
+	    page_ext->last_migrate_reason != -1)
 		pr_alert("page has been migrated, last migrate reason: %s\n",
 			migrate_reason_names[page_ext->last_migrate_reason]);
 }

             reply	other threads:[~2015-11-27 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 13:58 Arnd Bergmann [this message]
2015-11-27 14:06 ` [PATCH] mm, page_owner: only track migration if enabled Vlastimil Babka

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=3209032.Njpu4mxStH@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).