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 7A355C433FE for ; Mon, 14 Feb 2022 23:24:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADBAE6B0075; Mon, 14 Feb 2022 18:24:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A8B8A6B007B; Mon, 14 Feb 2022 18:24:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 979C36B007D; Mon, 14 Feb 2022 18:24:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 846DD6B0075 for ; Mon, 14 Feb 2022 18:24:12 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3E28F180AD837 for ; Mon, 14 Feb 2022 23:24:12 +0000 (UTC) X-FDA: 79142965944.30.3064E0D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf20.hostedemail.com (Postfix) with ESMTP id C5D7C1C0002 for ; Mon, 14 Feb 2022 23:24:11 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3ED9BB800C1; Mon, 14 Feb 2022 23:24:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98F46C340E9; Mon, 14 Feb 2022 23:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1644881049; bh=r0YrWh5FR1nHnNrxO+yE63GaWZtTclxK9OBUPdLb4D8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qqqkJhBik2hY3zZ5fXpl58TX1cENJ/7Zcjw4WS8oyiQdBwE2MeufhIjUufFqQMSKj 94ECCbzr0KM+AcQSB5yWAhuelD5IsLnZGC3AgdKJQSxqRcDNU9adB2tVnSvJJ86T1Y oMCrct6SR7P07jUh3bxXCVufzCLcnvIcWhF+g25I= Date: Mon, 14 Feb 2022 15:24:07 -0800 From: Andrew Morton To: Rik van Riel 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 Subject: Re: [PATCH v2] mm: clean up hwpoison page cache page in fault path Message-Id: <20220214152407.67e0d7dd1a532252c9dd203e@linux-foundation.org> In-Reply-To: <20220212213740.423efcea@imladris.surriel.com> References: <20220212213740.423efcea@imladris.surriel.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C5D7C1C0002 X-Stat-Signature: 5ur7ki1hu3fmf5ojwwdmm59jhp5sq7so Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=qqqkJhBi; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1644881051-37490 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: > Subject: [PATCH v2] mm: clean up hwpoison page cache page in fault path At first scan I thought this was a code cleanup. I think I'll do s/clean up/invalidate/. On Sat, 12 Feb 2022 21:37:40 -0500 Rik van Riel wrote: > Sometimes the page offlining code can leave behind a hwpoisoned clean > page cache page. Is this correct behaviour? > 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. > > 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. > > 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. Is this worth a cc:stable?