lkml.org 
[lkml]   [2020]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [External] Re: [PATCH v4] mm: memcontrol: Add the missing numa_stat interface for cgroup v2
From
Date
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

\
 
 \ /
  Last update: 2020-09-15 19:04    [W:0.036 / U:3.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site