lkml.org 
[lkml]   [2021]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] memcg: add per-memcg vmalloc stat
On Tue, Dec 21, 2021 at 8:15 PM Muchun Song <songmuchun@bytedance.com> wrote:
>
[...]
> > +static inline void mod_memcg_page_state(struct page *page,
> > + int idx, int val)
> > +{
> > + struct mem_cgroup *memcg = page_memcg(page);
> > +
> > + if (!mem_cgroup_disabled() && memcg)
> > + mod_memcg_state(memcg, idx, val);
>
> It's not safe to access @memcg throughout mod_memcg_state() for the
> kmem charged through objcg infrastructure. It's supposed to be safe
> to access @memcg under rcu read lock. Otherwise, it looks good to
> me.

Indeed you are right. v2 coming.

\
 
 \ /
  Last update: 2021-12-22 06:23    [W:0.689 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site