Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4709365pxb; Mon, 28 Mar 2022 01:47:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzejVIj7nHcDRi/hmU9dXZIfSbJa67Nccq8ZK1gDTOE+OIHS5miG/KnqfzhLYqY4J6x0rBg X-Received: by 2002:a17:907:9506:b0:6da:b4cd:515b with SMTP id ew6-20020a170907950600b006dab4cd515bmr26636400ejc.602.1648457243124; Mon, 28 Mar 2022 01:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648457243; cv=none; d=google.com; s=arc-20160816; b=Jkx/tWsiCykYJPdx7vJn01voJL3HlwQuvTzYb+lbcRKkbA/YRVdlXp7yqu+P2LZH3A Hb8XXEckz9K2jKNhvEYJZOstHooZuDumui5+fVSAxpLoumwJzBlv6k60Td3hIib69lGN A1ZblsShPZRjYjrYASyxNXkKff5THy0vPLTHpK8XbQzIJa57evUAECU37o3lhYuXaXcI oKLebvc+AZkjAfAEJU+d2qc5mB5w3ihPRMrEpSc9CWp6N/lRDrKLR92bbYhNUkDerTxx iPXTX+GMrVSqql4UAB37t4Lzw6lO6odjybLajkHcz04RQCYbj4WovY/nLYxaXr69bU9V GkIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ayZ+QlCweyLIlS62Z+/nGi29mX0NSXK48vpYBjkvODI=; b=HGBTGHczJaW/UVy/lIPbzStcKx760eZxiy/PCBfOMuQwhjOTTdieVLvRpzpMqMXDCQ 8kB4TOHRWb4yonyio+fDWQn8oc4EKUkTozILT1b+ZTv5dymwFbYjDeiT3+T4oHfZdFwK 2Ar8k4nQV1ZYdaS44fIoM5AOSenVlxLGLy5WgbFbp1mCvRJnV4QWb+OvUXgdWR9BA/an pORpCT+fK49jywCdd0Nx7xgjLu7xTFgUW+u3GzeALfnf8SvAGthIaUyFFPDdlsv0LF2Y lZBXuJIxr21+cRyh3Th73ds8w2vLcFCkvoekdYkiLJdwSRszJoTGJda1nBTr4JdoHK2R VGiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs32-20020a1709073ea000b006df93b0aef7si14665945ejc.462.2022.03.28.01.46.57; Mon, 28 Mar 2022 01:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237642AbiC1Cnd (ORCPT + 99 others); Sun, 27 Mar 2022 22:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbiC1Cnc (ORCPT ); Sun, 27 Mar 2022 22:43:32 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B52FB3FBC6; Sun, 27 Mar 2022 19:41:51 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KRcNV69NBzCrBW; Mon, 28 Mar 2022 10:39:38 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 28 Mar 2022 10:41:49 +0800 Subject: Re: [PATCH] mm,hwpoison: unmap poisoned page before invalidation To: Rik van Riel CC: , , Oscar Salvador , Naoya Horiguchi , Mel Gorman , Johannes Weiner , Andrew Morton , , linux-kernel References: <20220325161428.5068d97e@imladris.surriel.com> <5b734809fef4d76944490d5ac3ea816f0756b90a.camel@surriel.com> <1d4dc5f732e8da263c2a2e783e4550419cfb0c7b.camel@surriel.com> From: Miaohe Lin Message-ID: Date: Mon, 28 Mar 2022 10:41:49 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1d4dc5f732e8da263c2a2e783e4550419cfb0c7b.camel@surriel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/3/28 10:24, Rik van Riel wrote: > On Mon, 2022-03-28 at 10:14 +0800, Miaohe Lin wrote: >> On 2022/3/27 4:14, Rik van Riel wrote: >> >> >>> >>>>>                         /* Retry if a clean page was removed >>>>> from >>>>> the cache. */ >>>>> -                       if (invalidate_inode_page(vmf->page)) >>>>> -                               poisonret = 0; >>>>> -                       unlock_page(vmf->page); >>>>> +                       if (invalidate_inode_page(page)) >>>>> +                               poisonret = VM_FAULT_NOPAGE; >>>>> +                       unlock_page(page); >>> >> >> Sure, but when I think more about this, it seems this fix isn't >> ideal: >> If VM_FAULT_NOPAGE is returned with page table unset, the process >> will >> re-trigger page fault again and again until invalidate_inode_page >> succeeds >> to evict the inode page. This might hang the process a really long >> time. >> Or am I miss something? >> > If invalidate_inode_page fails, we will return > VM_FAULT_HWPOISON, and kill the task, instead > of looping indefinitely. Oh, really sorry! It's a drowsy Monday morning. :) This patch looks good to me. Thanks! Reviewed-by: Miaohe Lin >