Re: [PATCH v2 5/9] mm, page_owner: track and print last migrate reason
From: Vlastimil Babka
Date: Thu Nov 26 2015 - 05:39:17 EST
On 11/25/2015 09:13 AM, Joonsoo Kim wrote:
>> + if (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]);
>> + if (ret >= count)
>> + goto err;
>> + }
>> +
>
> migrate_reason_names is defined if CONFIG_MIGRATION is enabled so
> it would cause build failure in case of !CONFIG_MIGRATION and
> CONFIG_PAGE_OWNER.
>
> Thanks.
Ugh right, linking gives warnings... Thanks.
I think instead of adding #ifdefs here, let's move migrate_reason_names to
mm/debug.c as we gradually do with these things. Also enum
migrate_reason is defined regardless of CONFIG_MIGRATION, so match that
for migrate_reason_names as well.
------8<------