Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp509044pxb; Tue, 15 Feb 2022 20:15:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOQd84NAGxvMLb+2XeRceiyxB1CT14l/fdOzp27759qVxfLNJQhVXwtC+63f60ipiN1kX/ X-Received: by 2002:a17:906:d8dc:b0:6cf:d1d1:db25 with SMTP id re28-20020a170906d8dc00b006cfd1d1db25mr819963ejb.285.1644984925288; Tue, 15 Feb 2022 20:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644984925; cv=none; d=google.com; s=arc-20160816; b=FiWME0KlarMw6sQGKqsqtj1w1ee+3ajVObuN0/gmdx6cQj0VVEMYXsrX0L/zpwpjb9 81r5XHUvsWXTH8wfIv3YDGL4mEtSJaA3M9MMnzeAhHvckcLoQT17u8FmVLVW3AKyfkMh WD2cumBq80ew10wEX4fuyzA80LwQrirjIWqNpj8lPGZ3WtBE8jxr1o6vYlRHb0oJcJpB 58UVPq14eHp8050ii9ruyj04GmK1yS+W1u/VfbDg07s8ZK6X9lxxSy0/JT+KTrR4ERKv BCTZlyOtY0RbSfqPoEAg1Okxbo7KNPT37pYNZlt1aQguuN3pW0cq5VaNDzxJ4S5N22zi Njhw== 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=ST3zqkyIak3lzvu2SS7WBDEZdQaA68ss6lKvpvrhc1s=; b=RYR5kSkBsb2x27oGcWwhxT2xkpoJZnG/ktvcAMlOl35w1Y0ntSbPOAqBW1OW/DsPn4 xvG+7Anw84W+4hMh/shShASA+yEjNe86ZU4Seyx88s9XLG1bmfKFKIp99ndDHHBDa/MP DeT9BIHBGVvhccrm2Z2vLyDwzPxhHgThQiXCbAt/ro6x16apgjMZrS3mFBvxFPGUr88s U/QB9CHQxqmEvbufTO6DDsa8O+AYF2bBrRITF2fa95a2CheE5KXnvKxSj49aU7FCK3Jj nj7PAnaGG7S5YIrqhdDUvrAZ70TTnLhT7mlb3fqK1s4IXrgMmAwCyJB89pBoXoS0yUJB nDGg== 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 g19si1103995edv.58.2022.02.15.20.15.03; Tue, 15 Feb 2022 20:15:25 -0800 (PST) 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 S1343571AbiBPCNb (ORCPT + 99 others); Tue, 15 Feb 2022 21:13:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230199AbiBPCN2 (ORCPT ); Tue, 15 Feb 2022 21:13:28 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72A617D000 for ; Tue, 15 Feb 2022 18:13:17 -0800 (PST) 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-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/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. >