From: Randy Dunlap <rdunlap@infradead.org>
To: Muchun Song <songmuchun@bytedance.com>
Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan@huawei.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Jonathan Corbet <corbet@lwn.net>,
Michal Hocko <mhocko@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shakeel Butt <shakeelb@google.com>, Roman Gushchin <guro@fb.com>,
Cgroups <cgroups@vger.kernel.org>,
linux-doc@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [External] Re: [PATCH v4] mm: memcontrol: Add the missing numa_stat interface for cgroup v2
Date: Tue, 15 Sep 2020 09:19:49 -0700 [thread overview]
Message-ID: <f2ec1c19-b86b-887e-186a-3a8c3014857d@infradead.org> (raw)
In-Reply-To: <CAMZfGtVQtsFmU_5DVSZ1mFCnqZrPHrJFKT81Zg8TXDM7c74TDQ@mail.gmail.com>
On 9/15/20 9:01 AM, Muchun Song wrote:
> On Tue, Sep 15, 2020 at 11:45 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>>> +static int __init numa_stats_init(void)
>>> +{
>>> + int i;
>>> +
>>> + for (i = 0; i < ARRAY_SIZE(numa_stats); i++) {
>>> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>> + if (numa_stats[i].idx == NR_ANON_THPS)
>>> + numa_stats[i].ratio = HPAGE_PMD_SIZE;
>>> +#endif
>>> + }
>>
>> Although the loop may be needed sometime in the future due to
>> other changes.. why couldn't it be like this for now?
>
> The compiler is so smart, so there is nothing difference between
> them. I disassemble the numa_stats_init when
> !CONFIG_TRANSPARENT_HUGEPAGE.
>
> Dump of assembler code for function numa_stats_init:
> 0xffffffff8273b061 <+0>: callq 0xffffffff81057490 <__fentry__>
> 0xffffffff8273b066 <+5>: xor %eax,%eax
> 0xffffffff8273b068 <+7>: retq
>
Of course! Thanks.
>>
>>
>>> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>> + for (i = 0; i < ARRAY_SIZE(numa_stats); i++) {
>>> + if (numa_stats[i].idx == NR_ANON_THPS)
>>> + numa_stats[i].ratio = HPAGE_PMD_SIZE;
>>> + }
>>> +#endif
>>
>>
>>> +
>>> + return 0;
>>> +}
>>> +pure_initcall(numa_stats_init);
--
~Randy
prev parent reply other threads:[~2020-09-15 16:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 5:58 Muchun Song
2020-09-15 13:53 ` Shakeel Butt
2020-09-15 15:44 ` Randy Dunlap
2020-09-15 16:01 ` [External] " Muchun Song
2020-09-15 16:19 ` Randy Dunlap [this message]
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=f2ec1c19-b86b-887e-186a-3a8c3014857d@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan@huawei.com \
--cc=mhocko@kernel.org \
--cc=shakeelb@google.com \
--cc=songmuchun@bytedance.com \
--cc=tj@kernel.org \
--cc=vdavydov.dev@gmail.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