All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weizhao Ouyang <o451686892@gmail.com>
To: "Huang, Ying" <ying.huang@intel.com>, John Hubbard <jhubbard@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Oscar Salvador <osalvador@suse.de>,
	Yang Shi <shy828301@gmail.com>, Zi Yan <ziy@nvidia.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/debug: sync up latest migrate_reason to migrate_reason_names
Date: Fri, 17 Sep 2021 17:48:53 +0800	[thread overview]
Message-ID: <89a06743-b37a-b85a-1c04-5d863a1d2cb4@gmail.com> (raw)
In-Reply-To: <871r5nptt7.fsf@yhuang6-desk2.ccr.corp.intel.com>

Thank you both.
On 2021/9/17 下午3:03, Huang, Ying wrote:
> Weizhao Ouyang <o451686892@gmail.com> writes:
>
>> After related migrate page updates, sync up latest migrate_reason to
>> migrate_reason_names, page_owner use it to parse the page migrate
>> reason.
>>
>> Fixes: d1e153fea2a8 ("mm/gup: migrate pinned pages out of movable zone")
>> Fixes: 26aa2d199d6f ("mm/migrate: demote pages during reclaim")
>> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
>> ---
>>  mm/debug.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/mm/debug.c b/mm/debug.c
>> index e73fe0a8ec3d..733770b0ed0c 100644
>> --- a/mm/debug.c
>> +++ b/mm/debug.c
>> @@ -25,6 +25,8 @@ const char *migrate_reason_names[MR_TYPES] = {
>>  	"mempolicy_mbind",
>>  	"numa_misplaced",
>>  	"cma",
>> +	"longterm_pin",
>> +	"demotion",
>>  };
>>  
>>  const struct trace_print_flags pageflag_names[] = {
> Good catch!  Thanks!
>
> Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
>
> It may be better to use BUILD_BUG_ON() to capture similar issue earlier?

How about move migrate_reason_names into mm/page_owner.c and make it size uninitialized(get rid of MR_TYPES).
Then use BUILD_BUG_ON(ARRAY_SIZE(migrate_reason_names != MR_TYPES)) to check it?

>
> Best Regards,
> Huang, Ying

  parent reply	other threads:[~2021-09-17  9:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  6:14 [PATCH] mm/debug: sync up latest migrate_reason to migrate_reason_names Weizhao Ouyang
2021-09-17  7:03 ` Huang, Ying
2021-09-17  7:03   ` Huang, Ying
2021-09-17  7:27   ` John Hubbard
2021-09-17  9:48   ` Weizhao Ouyang [this message]
2021-09-18  0:30     ` John Hubbard
2021-09-18  7:03       ` Weizhao Ouyang
2021-09-19  5:38         ` John Hubbard
2021-09-20  9:14           ` Weizhao Ouyang
2021-09-19 23:35 ` Andrew Morton
2021-09-20  9:16   ` Weizhao Ouyang

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=89a06743-b37a-b85a-1c04-5d863a1d2cb4@gmail.com \
    --to=o451686892@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=pasha.tatashin@soleen.com \
    --cc=shy828301@gmail.com \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.