From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D664BC433F5 for ; Thu, 28 Apr 2022 07:16:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1FE46B0071; Thu, 28 Apr 2022 03:16:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCDA86B0072; Thu, 28 Apr 2022 03:16:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBD466B0073; Thu, 28 Apr 2022 03:16:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id BC1A76B0071 for ; Thu, 28 Apr 2022 03:16:08 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 78C5981A4B for ; Thu, 28 Apr 2022 07:16:08 +0000 (UTC) X-FDA: 79405428816.12.79709AF Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf11.hostedemail.com (Postfix) with ESMTP id A32B14005D for ; Thu, 28 Apr 2022 07:16:04 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kpn051JdrzGpN9; Thu, 28 Apr 2022 15:13:25 +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; Thu, 28 Apr 2022 15:16:02 +0800 Subject: Re: [RFC PATCH v1 4/4] mm, memory_hotplug: fix inconsistent num_poisoned_pages on memory hotremove To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= CC: Naoya Horiguchi , Andrew Morton , Mike Kravetz , Yang Shi , Oscar Salvador , Muchun Song , "linux-kernel@vger.kernel.org" , Linux-MM References: <20220427042841.678351-1-naoya.horiguchi@linux.dev> <20220427042841.678351-5-naoya.horiguchi@linux.dev> <828cc111-40e8-88ed-bb50-fb185e5f0304@huawei.com> <20220428040556.GA3945421@hori.linux.bs1.fc.nec.co.jp> From: Miaohe Lin Message-ID: <4cae9c00-a048-2c0a-9a45-d7abb956fde7@huawei.com> Date: Thu, 28 Apr 2022 15:16:01 +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: <20220428040556.GA3945421@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: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Stat-Signature: ic3oce3m6bgc7gsckzbyt6srssomjdy5 Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A32B14005D X-HE-Tag: 1651130164-603530 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 2022/4/28 12:05, HORIGUCHI NAOYA(堀口 直也) wrote: > On Thu, Apr 28, 2022 at 11:20:16AM +0800, Miaohe Lin wrote: >> On 2022/4/27 12:28, Naoya Horiguchi wrote: >>> From: Naoya Horiguchi >>> >>> When offlining memory section with hwpoisoned pages, the hwpoisons are >>> canceled. But num_poisoned_pages is not updated for that event, so the >>> counter becomes inconsistent. >> >> IIUC, this work is already done via clear_hwpoisoned_pages when __remove_pages. >> Or am I miss something? > > Actually I had the same question when writing this patch, and found that > __remove_pages() seems to be called from device memory or HMM, but not from It seems remove_memory (which calls __remove_pages) will be called as .detach callback of memory_device_handler in drivers/acpi/acpi_memhotplug.c. So the hwpoison info will also be clear for that memory ? > offline_pages(). If you mean that we could make offline_pages() call > clear_hwpoisoned_pages(), that seems possible and I'll consider it. > > But as David and Oscar pointed out for 0/4, removing PageHWPoison flags > in offlining seems not to be right thing, so I'd like to have some consensus > on what way to go first. Agree. We should have some consensus first. Thanks! > > Thanks, > Naoya Horiguchi >