lkml.org 
[lkml]   [2022]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 09/11] mm: memcontrol: use obj_cgroup APIs to charge the LRU pages
On Wed, Jun 01, 2022 at 07:34:38PM +0200, Michal Koutný wrote:
> Hello Muchun.
>
> On Mon, May 30, 2022 at 03:49:17PM +0800, Muchun Song <songmuchun@bytedance.com> wrote:
> > +static inline bool obj_cgroup_is_root(struct obj_cgroup *objcg)
> > +{
> > + return objcg == root_obj_cgroup;
> > +}
>
> Admittedly, this predicate alone caught my eye, why it did not also
> check root_mem_cgroup->objcg_list.
> However, deeper look reveals it's purpose is to avoid missing uncharges
> of pages that were charged in non-root memcg and later re-associated
> upwards after reparenting.

Right.

> So it's like obj_cgroup_root_origin() (I'm not suggesting a rename, just
> illustrating the understanding).
>
> get_obj_cgroup_from_current() gains some complexity but it still holds
> that in root memcg neither kernel objects nor LRU pages are charged.
> At the same time, reparented kernel objects or LRU pages are properly
> uncharged.
>
> These parts are
> Reviewed-by: Michal Koutný <mkoutny@suse.com>
>

Thanks Michal.

> (I did not look into the locking guarantees with the new API though.)
>
>

\
 
 \ /
  Last update: 2022-06-02 06:16    [W:0.252 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site