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 52D7FC433F5 for ; Mon, 21 Feb 2022 12:55:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C5F3C8D0003; Mon, 21 Feb 2022 07:55:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BE6B68D0001; Mon, 21 Feb 2022 07:55:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A60B18D0003; Mon, 21 Feb 2022 07:55:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 93DCB8D0001 for ; Mon, 21 Feb 2022 07:55:48 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4A9BB8249980 for ; Mon, 21 Feb 2022 12:55:48 +0000 (UTC) X-FDA: 79166783976.13.78BC9B7 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf17.hostedemail.com (Postfix) with ESMTP id A905D40009 for ; Mon, 21 Feb 2022 12:55:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6A0981F38E; Mon, 21 Feb 2022 12:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1645448146; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/higosCrBUuXIuVYTJ7LCuG8ecVfQi49Y+r3KOpXDYw=; b=FhPRUsm/gmghU9uqZ6FAnV1p2ZSemf7kzM7clgU/oArWBxl2JP94Hh6zkd61ucx8piZeEi f9azSOSowLKhZznlft1Fgt/RG0RrOq1I+9nKNfvfDr7+LMb1q5Zf7OWtiocjjDqtwbHqUI CvG5AfXD9RLUnLkTqVKGxj+Dfl5faUI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1645448146; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/higosCrBUuXIuVYTJ7LCuG8ecVfQi49Y+r3KOpXDYw=; b=p4Hp/xKWbw3LFVNNbQYG7uyCOYZ2HzKX3LPvJcUObu2LihGJMvkgCfy2tv3T1mBs3dttG3 p5IWTB9EYE1dJ/Dw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E20E013AD5; Mon, 21 Feb 2022 12:55:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id kotdNNGLE2KjcgAAMHmgww (envelope-from ); Mon, 21 Feb 2022 12:55:45 +0000 Date: Mon, 21 Feb 2022 13:55:44 +0100 From: Oscar Salvador To: Rik van Riel Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-mm@kvack.org, Miaohe Lin , Andrew Morton , Mel Gorman , Johannes Weiner , Matthew Wilcox Subject: Re: [PATCH v2] mm: clean up hwpoison page cache page in fault path Message-ID: References: <20220212213740.423efcea@imladris.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220212213740.423efcea@imladris.surriel.com> X-Stat-Signature: 5mt6nxkb55o4xy6tew4cyrs4bwzpxc6o X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="FhPRUsm/"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="p4Hp/xKW"; spf=pass (imf17.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A905D40009 X-HE-Tag: 1645448147-958257 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 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. > > 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. > > Signed-off-by: Rik van Riel > Reviewed-by: Miaohe Lin Although I would really loved to understand how we got there, it fixes the problem, so: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs