Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1320846rwb; Fri, 19 Aug 2022 01:16:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fKyIuSCH/3wwv2ZJtZCY2S/TIio4Ke8SeYkKujPfCbPezEKPX/O7Rc6A0WLGp7cJYNdjb X-Received: by 2002:aa7:dbd7:0:b0:43e:8c3b:f444 with SMTP id v23-20020aa7dbd7000000b0043e8c3bf444mr5126069edt.83.1660896995094; Fri, 19 Aug 2022 01:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660896995; cv=none; d=google.com; s=arc-20160816; b=zYYV0ZfLqxQHsH7hRKEuivSb4pLpe6XaHe2VSHAig1263Dx5gISZxVpzT1BKugAUSd 8ux7V2VS9b98RnH9UH3FMF6uHJSJHP4BBoVYJtK6tn6JSnF/Dp3Q98+qC4bLQGOrlToM iQggEj2kss2oFtQHGHuwn3fwc5UPBBser1K1tZL4szuL4fMfyVnxvxSvlIgD14418TGZ LaH2BFfUA2+iWCcq0zZrPY2J0z4J0KaMLOuIq0KCcUGn9CakG29EkT/4fDaQppSeYQIa 7RZX27hMHPoWXytr9RoZDtIhnQM4bbykgQbZKY17WJV8qwZiF07/eN+2Xwzx4zrMuLEC Up1Q== 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=2/rndPwins26MX5vUwuvMsY/xB3ZxFqz6RPwKL+PM0w=; b=ufm12P8MOQ6HKSWWu75+Kebx1aHUWzB7IUuYeI7q71jWsBz5dYC8XU3B8G3RIFUIEc xeXm7/R8/hyGQm6NGgXF0XP3W8AjUm1MIEn6WpkpS5gG5xrVYikN/ytaZFgtNFrYoeSX ++1Sk8lv72hV25edX8DIJOdPcruGtPj4J9jJ8r9ZOyyWg2veHcHps5d2S2UMrhCCUHdn HMrTuXwfAVDK+KLOgIDulZbcQJIk2dUiHoWXn3fH7pg3wIS5l0hBcF35WIS00GcdixA/ /YJASM7elxNBAvxVy9L8dmBpKD+UPyFKwVyS5yPmlkZux5S+4ZfM/Qu5C+FKH/s/zO/o y1zQ== 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 c21-20020a1709060fd500b007306dde08desi2331538ejk.448.2022.08.19.01.16.08; Fri, 19 Aug 2022 01:16:35 -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 S1346806AbiHSHhg (ORCPT + 99 others); Fri, 19 Aug 2022 03:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346845AbiHSHh2 (ORCPT ); Fri, 19 Aug 2022 03:37:28 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41F84CCD6A for ; Fri, 19 Aug 2022 00:37:26 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4M8D721sdPznTWm; Fri, 19 Aug 2022 15:35:10 +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.2375.24; Fri, 19 Aug 2022 15:37:23 +0800 Subject: Re: [PATCH 5/6] mm, hwpoison: kill procs if unmap fails To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" References: <20220818130016.45313-1-linmiaohe@huawei.com> <20220818130016.45313-6-linmiaohe@huawei.com> <20220819052431.GE613144@hori.linux.bs1.fc.nec.co.jp> From: Miaohe Lin Message-ID: <3043d61b-468b-58a3-b6b8-081f4663fbac@huawei.com> Date: Fri, 19 Aug 2022 15:37:23 +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: <20220819052431.GE613144@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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/8/19 13:24, HORIGUCHI NAOYA(堀口 直也) wrote: > On Thu, Aug 18, 2022 at 09:00:15PM +0800, Miaohe Lin wrote: >> If try_to_unmap() fails, the hwpoisoned page still resides in the address >> space of some processes. We should kill these processes or the hwpoisoned >> page might be consumed later. collect_procs() is always called to collect >> relevant processes now so they can be killed later if unmap fails. >> >> Signed-off-by: Miaohe Lin >> --- >> mm/memory-failure.c | 9 ++++----- >> 1 file changed, 4 insertions(+), 5 deletions(-) >> >> diff --git a/mm/memory-failure.c b/mm/memory-failure.c >> index a2f4e8b00a26..5f9615a86296 100644 >> --- a/mm/memory-failure.c >> +++ b/mm/memory-failure.c >> @@ -1396,7 +1396,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, >> struct address_space *mapping; >> LIST_HEAD(tokill); >> bool unmap_success; >> - int kill = 1, forcekill; >> + int forcekill; >> bool mlocked = PageMlocked(hpage); >> >> /* >> @@ -1437,7 +1437,6 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, >> if (page_mkclean(hpage)) { >> SetPageDirty(hpage); >> } else { >> - kill = 0; >> ttu |= TTU_IGNORE_HWPOISON; >> pr_info("%#lx: corrupted page was clean: dropped without side effects\n", >> pfn); >> @@ -1452,8 +1451,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, >> * Error handling: We ignore errors here because >> * there's nothing that can be done. > > This above comment might be deprecated now (I'm not sure what this really mean), > so could you drop or update this? Do you mean remove the below comment? In fact, this doesn't make much sense for me. * Error handling: We ignore errors here because * there's nothing that can be done. > > Anyway, the patch looks good to me. > > Acked-by: Naoya Horiguchi Many thanks for review. Thanks, Miaohe Lin