From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754413AbdEHKmp (ORCPT ); Mon, 8 May 2017 06:42:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38853 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754067AbdEHKmn (ORCPT ); Mon, 8 May 2017 06:42:43 -0400 Subject: Re: [PATCH v2 1/2] mm: Uncharge poisoned pages To: Balbir Singh , Michal Hocko , Andi Kleen , Johannes Weiner References: <1493130472-22843-1-git-send-email-ldufour@linux.vnet.ibm.com> <1493130472-22843-2-git-send-email-ldufour@linux.vnet.ibm.com> <20170427143721.GK4706@dhcp22.suse.cz> <87pofxk20k.fsf@firstfloor.org> <20170428060755.GA8143@dhcp22.suse.cz> <20170428073136.GE8143@dhcp22.suse.cz> <3eb86373-dafc-6db9-82cd-84eb9e8b0d37@linux.vnet.ibm.com> <20170428134831.GB26705@dhcp22.suse.cz> <20170502185507.GB19165@dhcp22.suse.cz> <1493860869.8082.1.camel@gmail.com> Cc: Naoya Horiguchi , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, Vladimir Davydov From: Laurent Dufour Date: Mon, 8 May 2017 12:42:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1493860869.8082.1.camel@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17050810-0008-0000-0000-0000043F4437 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050810-0009-0000-0000-00001D931412 Message-Id: <03a7ec34-106e-3eb6-0b05-f77a40a2d6b9@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-08_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705080061 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/05/2017 03:21, Balbir Singh wrote: >> @@ -5527,7 +5527,7 @@ static void uncharge_list(struct list_head *page_list) >> next = page->lru.next; >> >> VM_BUG_ON_PAGE(PageLRU(page), page); >> - VM_BUG_ON_PAGE(page_count(page), page); >> + VM_BUG_ON_PAGE(!PageHWPoison(page) && page_count(page), page); >> >> if (!page->mem_cgroup) >> continue; >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >> index 8a6bd3a9eb1e..4497d9619bb4 100644 >> --- a/mm/memory-failure.c >> +++ b/mm/memory-failure.c >> @@ -541,6 +541,13 @@ static int delete_from_lru_cache(struct page *p) >> */ >> ClearPageActive(p); >> ClearPageUnevictable(p); >> + >> + /* >> + * Poisoned page might never drop its ref count to 0 so we have to >> + * uncharge it manually from its memcg. >> + */ >> + mem_cgroup_uncharge(p); >> + > > Yep, that is the right fix > > https://lkml.org/lkml/2017/4/26/133 Sorry Balbir, You pointed this out since the beginning but I missed your comment. My mistake. Thanks, Laurent.