Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1434798AbdDZDpR (ORCPT ); Tue, 25 Apr 2017 23:45:17 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:35683 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1431487AbdDZDpI (ORCPT ); Tue, 25 Apr 2017 23:45:08 -0400 Message-ID: <1493178300.4828.5.camel@gmail.com> Subject: Re: [PATCH v2 1/2] mm: Uncharge poisoned pages From: Balbir Singh To: Naoya Horiguchi Cc: Laurent Dufour , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" Date: Wed, 26 Apr 2017 13:45:00 +1000 In-Reply-To: <20170426023410.GA11619@hori1.linux.bs1.fc.nec.co.jp> References: <1493130472-22843-1-git-send-email-ldufour@linux.vnet.ibm.com> <1493130472-22843-2-git-send-email-ldufour@linux.vnet.ibm.com> <1493171698.4828.1.camel@gmail.com> <20170426023410.GA11619@hori1.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 780 Lines: 21 > > > static int delete_from_lru_cache(struct page *p) > > > { > > > + if (memcg_kmem_enabled()) > > > + memcg_kmem_uncharge(p, 0); > > > + > > > > The changelog is not quite clear, so we are uncharging a page using > > memcg_kmem_uncharge for a page in swap cache/page cache? > > Hi Balbir, > > Yes, in the normal page lifecycle, uncharge is done in page free time. > But in memory error handling case, in-use pages (i.e. swap cache and page > cache) are removed from normal path and they don't pass page freeing code. > So I think that this change is to keep the consistent charging for such a case. I agree we should uncharge, but looking at the API name, it seems to be for kmem pages, why are we not using mem_cgroup_uncharge()? Am I missing something? Balbir Singh.