From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Subject: Re: [PATCH 3/3] mm/memcg: add next_mz back if not reclaimed yet Date: Tue, 8 Mar 2022 09:17:58 +0100 Message-ID: References: <20220308012047.26638-1-richard.weiyang@gmail.com> <20220308012047.26638-3-richard.weiyang@gmail.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1646727481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lVmEixqpuJvqpe4IHKN+rIuyorY+AJrE8NHUQyQr4Js=; b=ao5dkugfz7BsUWyZQdmyUiUpvjVl+MyShWu+tmWxVWcOIksv0OiGkegrzjfru2LSNV7wmD A0iTPnr5VU00LshqEMNkjtOn/mkwjbjWGsIhJnMXUpjgcnG4tx/dBbIdFNBxflqUX570dw CP76Zz+Nr4VW1Rg7dcSuU01nTducrYc= Content-Disposition: inline In-Reply-To: <20220308012047.26638-3-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Wei Yang Cc: hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org On Tue 08-03-22 01:20:47, Wei Yang wrote: > next_mz is removed from rb_tree, let's add it back if no reclaim has > been tried. Could you elaborate more why we need/want this? > Signed-off-by: Wei Yang > --- > mm/memcontrol.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 344a7e891bc5..e803ff02aae2 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -3493,8 +3493,13 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, > loop > MEM_CGROUP_MAX_SOFT_LIMIT_RECLAIM_LOOPS)) > break; > } while (!nr_reclaimed); > - if (next_mz) > + if (next_mz) { > + spin_lock_irq(&mctz->lock); > + excess = soft_limit_excess(next_mz->memcg); > + __mem_cgroup_insert_exceeded(next_mz, mctz, excess); > + spin_unlock_irq(&mctz->lock); > css_put(&next_mz->memcg->css); > + } > return nr_reclaimed; > } > > -- > 2.33.1 -- Michal Hocko SUSE Labs