On Sat 12-03-22 07:16:22, Wei Yang wrote: > There is no tree operation if mz is not on-tree. This doesn't explain problem you are trying to solve nor does it make much sense to me TBH. > Let's remove the extra check. What would happen if the mz was already in the excess tree and the excess has grown? > Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx> > --- > mm/memcontrol.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index d70bf5cf04eb..344a7e891bc5 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -545,9 +545,11 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) > unsigned long flags; > > spin_lock_irqsave(&mctz->lock, flags); > - /* if on-tree, remove it */ > - if (mz->on_tree) > - __mem_cgroup_remove_exceeded(mz, mctz); > + /* > + * remove it first > + * If not on-tree, no tree ops. > + */ > + __mem_cgroup_remove_exceeded(mz, mctz); > /* > * Insert again. mz->usage_in_excess will be updated. > * If excess is 0, no tree ops. > -- > 2.33.1 -- Michal Hocko SUSE Labs