From: Weizhao Ouyang <o451686892@gmail.com>
To: John Hubbard <jhubbard@nvidia.com>, "Huang, Ying" <ying.huang@intel.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: Mon, 20 Sep 2021 17:14:48 +0800 [thread overview]
Message-ID: <c597ee80-2266-5345-16ba-c8c96cc5b341@gmail.com> (raw)
In-Reply-To: <cec9a286-f7b6-c80a-c518-480db65152fc@nvidia.com>
On 2021/9/19 13:38, John Hubbard wrote:
> On 9/18/21 00:03, Weizhao Ouyang wrote:
> ...
>> Anyway, I didn't find a simply way the build the "everywhere" relationship behind
>> the packaged TRACE_DEFINE_ENUM , what do you think.
>>
> It's actually pretty easy, unless I'm unknowingly violating some rule
> here. But I did review tracing a bit before diving in, and I think this
> is reasonable.
>
> The trace macros EM(), EMe(), and MIGRATE_REASON are flexible enough to
> get whatever you want, out of them. So, the trace header can be the one
> location for the definition of the enum-to-string mapping.
>
> The key is to move the enum to a common header file that both the trace
> system (trace/events/migrate.h) and the migrate header
> (include/linux/migrate.h) can include. Fortunately, that's already been
> started for enum migrate_mode: there is migrate_mode.h.
>
> So it all works approximately like this, below. (I'll attach a
> white-space-correct diff that you can apply directly, too). I've
> compiled tested and rebooted with it, but haven't checked much more
> than that yet.
Thanks for your detailed patch! Yeah, if we move the enum migrate_reason to
another header file it will attach it easily. The previous mail I said the
tricky point is that we build the "everywhere relationship" on the basis of
maintaining the original file structure, sorry for the confusing misleading.
I think we should not change a lot for a slight synchronization.
For now we can just apply the update in migrate_reason_name(maybe leave a
comment to notify) on this patch, I will send v2 patch soon include the "cma"
update. As for the trace_event synchronization, we can figure out a more
generic implementation in the future, so that other subsystem can use it to
catch a string info from its trace event header.
Thanks,
Weizhao
next prev parent reply other threads:[~2021-09-20 9:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-17 6:14 Weizhao Ouyang
2021-09-17 7:03 ` Huang, Ying
2021-09-17 7:27 ` John Hubbard
2021-09-17 9:48 ` Weizhao Ouyang
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 [this message]
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=c597ee80-2266-5345-16ba-c8c96cc5b341@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox