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 37DA0C433F5 for ; Wed, 16 Feb 2022 02:13:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 79F8C6B0078; Tue, 15 Feb 2022 21:13:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 726A76B007B; Tue, 15 Feb 2022 21:13:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C66A6B007D; Tue, 15 Feb 2022 21:13:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 4A0056B0078 for ; Tue, 15 Feb 2022 21:13:22 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 191C12307E for ; Wed, 16 Feb 2022 02:13:22 +0000 (UTC) X-FDA: 79147021044.03.208175E Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf17.hostedemail.com (Postfix) with ESMTP id 012D740005 for ; Wed, 16 Feb 2022 02:13:19 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Jz1bV03xGz1FD0V; Wed, 16 Feb 2022 10:08:54 +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; Wed, 16 Feb 2022 10:13:14 +0800 Subject: Re: [PATCH v2] mm: clean up hwpoison page cache page in fault path To: Oscar Salvador , Rik van Riel CC: , , , Andrew Morton , Mel Gorman , Johannes Weiner , Matthew Wilcox References: <20220212213740.423efcea@imladris.surriel.com> From: Miaohe Lin Message-ID: Date: Wed, 16 Feb 2022 10:13:14 +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: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 012D740005 X-Stat-Signature: gsu5g9xdxq54prb3anc75s68n8ntd6kd X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-HE-Tag: 1644977599-718730 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/2/15 20:51, Oscar Salvador wrote: > On Sat, Feb 12, 2022 at 09:37:40PM -0500, Rik van Riel wrote: >> Sometimes the page offlining code can leave behind a hwpoisoned clean >> page cache page. This can lead to programs being killed over and over >> and over again as they fault in the hwpoisoned page, get killed, and >> then get re-spawned by whatever wanted to run them. > > Hi Rik, > > Do you know how that exactly happens? We should not be really leaving > anything behind, and soft-offline (not hard) code works with the premise > of only poisoning a page in case it was contained, so I am wondering > what is going on here. > > In-use pagecache pages are migrated away, and the actual page is > contained, and for clean ones, we already do the invalidate_inode_page() > and then contain it in case we succeed. > IIUC, this could not happen when soft-offlining a pagecache page. They're either invalidated or migrated away and then we set PageHWPoison. I think this may happen on a clean pagecache page when it's isolated. So it's !PageLRU. And identify_page_state treats it as me_unknown because it's non reserved, slab, swapcache and so on ...(see error_states for details). Or am I miss anything? Thanks. > One scenario I can imagine this can happen is if by the time we call > page_handle_poison(), someone has taken another refcount on the page, > and the put_page() does not really free it, but I am not sure that > can happen. >