Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6177437pxb; Mon, 14 Feb 2022 17:47:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlOtpNxca7kUTjeWtSnN3sWEEUvpj6swVBn9DiZBVhu2YR/skYL1BT1pt41X6p42kPHV57 X-Received: by 2002:a63:3c6:: with SMTP id 189mr1578470pgd.549.1644889622651; Mon, 14 Feb 2022 17:47:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644889622; cv=none; d=google.com; s=arc-20160816; b=M+GQVNsCA7DUGiwbtj6JoxaQqR2LHN4EIR8YStexwKIBW1ICfu23Lel1CW0oRRZaLg Q1GXiRekwQjuI8NBiEp7ROUku+MWjIWrvHRGg66iYi9CSPDNOBeuZhjledQVD+UkKJfg 7UyvWhSYzEY+CO83oA+3YFP/V66Pdth05q3hbEnZCz13bNW57CHwZCNoyYPgxofQDVZH 4yU1ekTgyNht2StdCTa1844j3m2sgBjz240D2X/YDHcq63x+sWCtGQkBuBnHMPRgnaM5 kDFk4LPFVsbA8uFmNXeg8nTdJ3Ud448WpJsX8xsKCNm3/FDjtBHVoFMIyqUJVaRVEkib EjwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=T1Cp1PvRIHPkCFnO0gDGNuHNW864dt5UN1WnON8djpo=; b=lkIzc63cf1N1kiGKsp9zr6rmuAUrVJUg5Lkv/QcTskfJzCJVEfIunqC4FbLYSIISdR 3j9JOZDZApIJ9rVLAAUTo6gvH3RUWx2BNO9fe2ZMvwHGBwvYoqkK63satS26kUC0MPCv yiaqKYZAtvFf8eHe2J1cSmc2rByYIl3r2yEB+DRsCDij/6l7FmHVEzoNyvKCkUtHKdrV bQ3S7qeztvWnhp7ZO60ODSXtvEecXmeOonGvgplmesHOoGw2KK3gcvdBsm8IdNhO9JZ0 68Y+dFSp8z6291QNvfp0QII+K3kyEUlDtQqY/X9GyWD6fR7G3ZcdLBU5kxx0QgEmTRM0 lvxg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m14si1614021pgu.313.2022.02.14.17.46.45; Mon, 14 Feb 2022 17:47:02 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbiBOBhz (ORCPT + 99 others); Mon, 14 Feb 2022 20:37:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiBOBhy (ORCPT ); Mon, 14 Feb 2022 20:37:54 -0500 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F1151275C1 for ; Mon, 14 Feb 2022 17:37:41 -0800 (PST) Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nJmmV-0007om-I1; Mon, 14 Feb 2022 20:37:27 -0500 Message-ID: <6f70cc26ccc92d099f1080e4c57ab44709bafd68.camel@surriel.com> Subject: Re: [PATCH v2] mm: clean up hwpoison page cache page in fault path From: Rik van Riel To: Andrew Morton Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, Miaohe Lin , Mel Gorman , Johannes Weiner , Matthew Wilcox , Naoya Horiguchi , Naoya Horiguchi Date: Mon, 14 Feb 2022 20:37:26 -0500 In-Reply-To: <20220214152407.67e0d7dd1a532252c9dd203e@linux-foundation.org> References: <20220212213740.423efcea@imladris.surriel.com> <20220214152407.67e0d7dd1a532252c9dd203e@linux-foundation.org> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-b7zfiHYjDu/3wMt4SsyU" User-Agent: Evolution 3.42.3 (3.42.3-1.fc35) MIME-Version: 1.0 Sender: riel@shelob.surriel.com X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 --=-b7zfiHYjDu/3wMt4SsyU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2022-02-14 at 15:24 -0800, Andrew Morton wrote: >=20 > > Subject: [PATCH v2] mm: clean up hwpoison page cache page in fault > > path >=20 > At first scan I thought this was a code cleanup. >=20 > I think I'll do s/clean up/invalidate/. >=20 OK, that sounds good. > On Sat, 12 Feb 2022 21:37:40 -0500 Rik van Riel > wrote: >=20 > > Sometimes the page offlining code can leave behind a hwpoisoned > > clean > > page cache page. >=20 > Is this correct behaviour? It is not desirable, and the soft page offlining code tries to invalidate the page, but I don't think overhauling the way we lock and refcount page cache pages just to make offlining them more reliable would be worthwhile, when we already have a branch in the page fault handler to deal with these pages, anyway. > > 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. > >=20 > > This is particularly embarrassing when the page was offlined due to > > having too many corrected memory errors. Now we are killing tasks > > due to them trying to access memory that probably isn't even > > corrupted. > >=20 > > This problem can be avoided by invalidating the page from the page > > fault handler, which already has a branch for dealing with these > > kinds of pages. With this patch we simply pretend the page fault > > was successful if the page was invalidated, return to userspace, > > incur another page fault, read in the file from disk (to a new > > memory page), and then everything works again. >=20 > Is this worth a cc:stable? Maybe. I don't know how far back this issue goes... --=20 All Rights Reversed. --=-b7zfiHYjDu/3wMt4SsyU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEyBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAmILA9YACgkQznnekoTE 3oOFvAf1Eybcb8fqZjb7Qum00p9okDKc5SuiWsTTFGEsKIXcC7BlUhFblo2zFQEX 98tgwOw5KzXtj5iuvkEw2VLja8XbaH/uWDVMi8OOFwKyPhj2wmnDsS1z3bmhnFbM Gq36IigdymUctDQnUIJFkXsdVEB+O0LzG19JLbi6BEhnio1Qq6u5Zsu+1bwNvuP3 zOI2rM3Lk4o4++0WidG8W1jQ3aCmMXlZmCqciWkWl4dIP9Gqm21rSSHIhVfgCaKs PMXMjlX4XbEASBA3pvt2YBa3GRFoUxYlgGqwryzMnO4XZpudG4BfbIV9Ymkx9Rie Oun+LZjwhT+8180Ks+JvjU0o5Z9E =UKB2 -----END PGP SIGNATURE----- --=-b7zfiHYjDu/3wMt4SsyU--