[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Nov 2021 18:59:21 -0800
From: Shakeel Butt <shakeelb@...gle.com>
To: Muchun Song <songmuchun@...edance.com>
Cc: Mina Almasry <almasrymina@...gle.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>,
Miaohe Lin <linmiaohe@...wei.com>,
Oscar Salvador <osalvador@...e.de>,
Michal Hocko <mhocko@...e.com>,
David Rientjes <rientjes@...gle.com>,
Jue Wang <juew@...gle.com>, Yang Yao <ygyao@...gle.com>,
Joanna Li <joannali@...gle.com>,
Cannon Matthews <cannonmatthews@...gle.com>,
Linux Memory Management List <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file
On Wed, Nov 10, 2021 at 6:36 PM Muchun Song <songmuchun@...edance.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.
Oh this is me misguiding Mina, sorry about that. Yes, READ_ONCE()
should be good enough in hugetlb_cgroup_read_numa_stat().
Powered by blists - more mailing lists