lkml.org 
[lkml]   [2021]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file
From
Date
Subject:   Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file

To: Muchun Song <songmuchun@bytedance.com>, Mina Almasry <almasrymina@google.com>

Cc: Andrew Morton <akpm@linux-foundation.org>, Shuah Khan <shuah@kernel.org>, Miaohe Lin <linmiaohe@huawei.com>, Oscar Salvador <osalvador@suse.de>, Michal Hocko <mhocko@suse.com>, David Rientjes <rientjes@google.com>, Shakeel Butt <shakeelb@google.com>, Jue Wang <juew@google.com>, Yang Yao <ygyao@google.com>, Joanna Li <joannali@google.com>, Cannon Matthews <cannonmatthews@google.com>, Linux Memory Management List <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>

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@google.com> 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

\
 
 \ /
  Last update: 2021-11-13 00:37    [W:0.067 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site