From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932198AbdK1UAK (ORCPT ); Tue, 28 Nov 2017 15:00:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:57285 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932106AbdK1UAJ (ORCPT ); Tue, 28 Nov 2017 15:00:09 -0500 Date: Tue, 28 Nov 2017 21:00:05 +0100 From: Michal Hocko To: Shakeel Butt Cc: Huang Ying , Vladimir Davydov , Greg Thelen , Johannes Weiner , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs Message-ID: <20171128200005.67grhk2arm2ivgug@dhcp22.suse.cz> References: <20171128161941.20931-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171128161941.20931-1-shakeelb@google.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 28-11-17 08:19:41, Shakeel Butt wrote: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Very well spotted! Have you seen this triggering or you found it by the code inspection? > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") To be honest I am not really happy how the whole THP swapout thing has been rushed in without a proper review. I am partly guildy for not find time for the proper review but this is not something that really had to be merged without a single ack or reviewed-by. > Signed-off-by: Shakeel Butt > Cc: stable@vger.kernel.org Acked-by: Michal Hocko Thanks! > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** > -- > 2.15.0.417.g466bffb3ac-goog -- Michal Hocko SUSE Labs