Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject:   Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file

To:        Muchun Song <songmuchun@xxxxxxxxxxxxx>, Mina Almasry <almasrymina@xxxxxxxxxx>

Cc:        Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Shuah Khan <shuah@xxxxxxxxxx>, Miaohe Lin <linmiaohe@xxxxxxxxxx>, Oscar Salvador <osalvador@xxxxxxx>, Michal Hocko <mhocko@xxxxxxxx>, David Rientjes <rientjes@xxxxxxxxxx>, Shakeel Butt <shakeelb@xxxxxxxxxx>, Jue Wang <juew@xxxxxxxxxx>, Yang Yao <ygyao@xxxxxxxxxx>, Joanna Li <joannali@xxxxxxxxxx>, Cannon Matthews <cannonmatthews@xxxxxxxxxx>, Linux Memory Management List <linux-mm@xxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>

Bcc:       

-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-

On 11/10/21 6:36 PM, Muchun Song wrote:

> On Thu, Nov 11, 2021 at 9:50 AM Mina Almasry <almasrymina@xxxxxxxxxx> wrote:

>>

>> +struct hugetlb_cgroup_per_node {

>> +       /* hugetlb usage in pages over all hstates. */

>> +       atomic_long_t usage[HUGE_MAX_HSTATE];

> 

> Why do you use atomic? IIUC, 'usage' is always

> increased/decreased under hugetlb_lock except

> hugetlb_cgroup_read_numa_stat() which is always

> reading it. So I think WRITE_ONCE/READ_ONCE

> is enough.



Thanks for continuing to work this, I was traveling and unable to

comment.



Unless I am missing something, I do not see a reason for WRITE_ONCE/READ_ONCE

and would suggest going back to the way this code was in v5.

-- 

Mike Kravetz





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux