Messages in this thread | | | From | Shakeel Butt <> | Date | Wed, 10 Nov 2021 18:59:21 -0800 | Subject | Re: [PATCH v6] hugetlb: Add hugetlb.*.numa_stat file |
| |
On Wed, Nov 10, 2021 at 6:36 PM Muchun Song <songmuchun@bytedance.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().
| |