From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759948AbaGPO6S (ORCPT ); Wed, 16 Jul 2014 10:58:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44617 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754903AbaGPO6P (ORCPT ); Wed, 16 Jul 2014 10:58:15 -0400 Date: Wed, 16 Jul 2014 10:57:36 -0400 From: Naoya Horiguchi To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , Hugh Dickins , Tejun Heo , Vladimir Davydov , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [patch 13/13] mm: memcontrol: rewrite uncharge API Message-ID: <20140716145736.GA9794@nhori.redhat.com> References: <1403124045-24361-14-git-send-email-hannes@cmpxchg.org> <20140715155537.GA19454@nhori.bos.redhat.com> <20140715160735.GB29269@dhcp22.suse.cz> <20140715173439.GU29639@cmpxchg.org> <20140715184358.GA31550@nhori.bos.redhat.com> <20140715190454.GW29639@cmpxchg.org> <20140715204953.GA21016@nhori.bos.redhat.com> <20140715214843.GX29639@cmpxchg.org> <20140716133050.GA4644@nhori.redhat.com> <20140716141447.GY29639@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140716141447.GY29639@cmpxchg.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 16, 2014 at 10:14:47AM -0400, Johannes Weiner wrote: ... > > > free_hot_cold_page(page, false); > > > } > > > > > > @@ -75,7 +75,10 @@ static void __put_compound_page(struct page *page) > > > { > > > compound_page_dtor *dtor; > > > > > > - __page_cache_release(page); > > > + if (!PageHuge(page)) { > > > + __page_cache_release(page); > > > + mem_cgroup_uncharge_page(page); > > I reverted all these mm/swap.c changes again as well. Instead, > mem_cgroup_uncharge() now does a preliminary check if the page is > charged before it touches page->lru. > > That should be much more robust: now the vetting whether a page is > valid for memcg happens at charge time only, all other operations > check first if a page is charged before doing anything else to it. > > These two places should be the only ones that need fixing then: This change also passed my testing, so the problem should be fixed. Thanks, Naoya Horiguchi From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by kanga.kvack.org (Postfix) with ESMTP id BB1436B00B0 for ; Wed, 16 Jul 2014 10:58:17 -0400 (EDT) Received: by mail-wi0-f182.google.com with SMTP id d1so1452104wiv.3 for ; Wed, 16 Jul 2014 07:58:12 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id hc6si24301586wjc.68.2014.07.16.07.58.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jul 2014 07:58:08 -0700 (PDT) Date: Wed, 16 Jul 2014 10:57:36 -0400 From: Naoya Horiguchi Subject: Re: [patch 13/13] mm: memcontrol: rewrite uncharge API Message-ID: <20140716145736.GA9794@nhori.redhat.com> References: <1403124045-24361-14-git-send-email-hannes@cmpxchg.org> <20140715155537.GA19454@nhori.bos.redhat.com> <20140715160735.GB29269@dhcp22.suse.cz> <20140715173439.GU29639@cmpxchg.org> <20140715184358.GA31550@nhori.bos.redhat.com> <20140715190454.GW29639@cmpxchg.org> <20140715204953.GA21016@nhori.bos.redhat.com> <20140715214843.GX29639@cmpxchg.org> <20140716133050.GA4644@nhori.redhat.com> <20140716141447.GY29639@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140716141447.GY29639@cmpxchg.org> Sender: owner-linux-mm@kvack.org List-ID: To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , Hugh Dickins , Tejun Heo , Vladimir Davydov , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org On Wed, Jul 16, 2014 at 10:14:47AM -0400, Johannes Weiner wrote: ... > > > free_hot_cold_page(page, false); > > > } > > > > > > @@ -75,7 +75,10 @@ static void __put_compound_page(struct page *page) > > > { > > > compound_page_dtor *dtor; > > > > > > - __page_cache_release(page); > > > + if (!PageHuge(page)) { > > > + __page_cache_release(page); > > > + mem_cgroup_uncharge_page(page); > > I reverted all these mm/swap.c changes again as well. Instead, > mem_cgroup_uncharge() now does a preliminary check if the page is > charged before it touches page->lru. > > That should be much more robust: now the vetting whether a page is > valid for memcg happens at charge time only, all other operations > check first if a page is charged before doing anything else to it. > > These two places should be the only ones that need fixing then: This change also passed my testing, so the problem should be fixed. Thanks, Naoya Horiguchi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Naoya Horiguchi Subject: Re: [patch 13/13] mm: memcontrol: rewrite uncharge API Date: Wed, 16 Jul 2014 10:57:36 -0400 Message-ID: <20140716145736.GA9794@nhori.redhat.com> References: <1403124045-24361-14-git-send-email-hannes@cmpxchg.org> <20140715155537.GA19454@nhori.bos.redhat.com> <20140715160735.GB29269@dhcp22.suse.cz> <20140715173439.GU29639@cmpxchg.org> <20140715184358.GA31550@nhori.bos.redhat.com> <20140715190454.GW29639@cmpxchg.org> <20140715204953.GA21016@nhori.bos.redhat.com> <20140715214843.GX29639@cmpxchg.org> <20140716133050.GA4644@nhori.redhat.com> <20140716141447.GY29639@cmpxchg.org> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <20140716141447.GY29639-druUgvl0LCNAfugRpC6u6w@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Weiner Cc: Michal Hocko , Andrew Morton , Hugh Dickins , Tejun Heo , Vladimir Davydov , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Wed, Jul 16, 2014 at 10:14:47AM -0400, Johannes Weiner wrote: ... > > > free_hot_cold_page(page, false); > > > } > > > > > > @@ -75,7 +75,10 @@ static void __put_compound_page(struct page *page) > > > { > > > compound_page_dtor *dtor; > > > > > > - __page_cache_release(page); > > > + if (!PageHuge(page)) { > > > + __page_cache_release(page); > > > + mem_cgroup_uncharge_page(page); > > I reverted all these mm/swap.c changes again as well. Instead, > mem_cgroup_uncharge() now does a preliminary check if the page is > charged before it touches page->lru. > > That should be much more robust: now the vetting whether a page is > valid for memcg happens at charge time only, all other operations > check first if a page is charged before doing anything else to it. > > These two places should be the only ones that need fixing then: This change also passed my testing, so the problem should be fixed. Thanks, Naoya Horiguchi