Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947355AbdDYORG (ORCPT ); Tue, 25 Apr 2017 10:17:06 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33517 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1431525AbdDYOQx (ORCPT ); Tue, 25 Apr 2017 10:16:53 -0400 Subject: Re: [RFC 2/2] mm: skip HWPoisoned pages when onlining pages To: Naoya Horiguchi References: <1492680362-24941-1-git-send-email-ldufour@linux.vnet.ibm.com> <1492680362-24941-3-git-send-email-ldufour@linux.vnet.ibm.com> <20170425080052.GB18194@hori1.linux.bs1.fc.nec.co.jp> Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" From: Laurent Dufour Date: Tue, 25 Apr 2017 16:16:42 +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: <20170425080052.GB18194@hori1.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17042514-0012-0000-0000-000005167C0A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042514-0013-0000-0000-0000183350CA Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-25_09:,, 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-1704250260 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1377 Lines: 38 On 25/04/2017 10:00, Naoya Horiguchi wrote: > On Thu, Apr 20, 2017 at 11:26:02AM +0200, Laurent Dufour wrote: >> The commit b023f46813cd ("memory-hotplug: skip HWPoisoned page when >> offlining pages") skip the HWPoisoned pages when offlining pages, but >> this should be skipped when onlining the pages too. >> >> Signed-off-by: Laurent Dufour >> --- >> mm/memory_hotplug.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >> index 6fa7208bcd56..20e1fadc2369 100644 >> --- a/mm/memory_hotplug.c >> +++ b/mm/memory_hotplug.c >> @@ -942,6 +942,8 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, >> if (PageReserved(pfn_to_page(start_pfn))) >> for (i = 0; i < nr_pages; i++) { >> page = pfn_to_page(start_pfn + i); >> + if (PageHWPoison(page)) >> + continue; > > Is it OK that PageReserved (set by __offline_isolated_pages for non-buddy > hwpoisoned pages) still remains in this path? To be honest, I've no clue. > If online_pages_range() is the reverse operation of __offline_isolated_pages(), > ClearPageReserved seems needed here. I added a call to ClearPageReserved in the if (PageHWPoison(..)) and run some tests. This seems to work fine as well, but I'm not sure about the side effect. I'll add it to my next version. Thanks, Laurent.