Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4406610pxb; Mon, 21 Feb 2022 20:33:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzU6lrSCCZ6zn9FmkLvEcqXN/z2g1OdjA5ZJ4Q5sxGZ+DRIOw/DF+MYDhrAFwbC+Tv2lpdd X-Received: by 2002:a17:90a:aa0a:b0:1b4:e1e3:9651 with SMTP id k10-20020a17090aaa0a00b001b4e1e39651mr2205113pjq.235.1645504428710; Mon, 21 Feb 2022 20:33:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645504428; cv=none; d=google.com; s=arc-20160816; b=J9+wC74ph8RbK6Dm3CdLJbxVUqESg/eOz8a8gIbZcgN+NiI4BXOYA7Ba6BcUCA/Sq/ Madi45TLXjEXqKYSWbb8NPdCktd4EbyV8eCXl667JsD5yxbgPAOHG+QTQPQ+3U5qhYXm hFmQRqzenYEdn6NFEqAgbhIfdDF4saqrWGC1LKDg4MVjZgh5vmuC7eFxJL5yR6jjLmmU HGO6GdE5gfnWp/MuhuupVzZOUxj5jHxB0zpJpVQiCArECwZtz8FBffBbc1yf/WHG0BlB xkq9UzA3xv1WaDU73RWzXi/ehfwIz3l3t2maKwicqrrPZaf3smKdmrEkzs2HvaAhX4xH rC1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=/higosCrBUuXIuVYTJ7LCuG8ecVfQi49Y+r3KOpXDYw=; b=nLDF+z9LWFZLDCEuCgOZTE4GIux6rPLDhn4J2sZT5FbxEz+cHVlVeIugxlUu9A14tY tMyOSXDXZCvs4O7yGfXgRRU9r2ps89tCL1X1ydbkdMNUn4dTZtiCLTBSvtscMtDrTkUB TJIrOrYu+Ni8idY+4QI2EuiVphoAeKzUnnGO9GbIw++xC9iC6X7gp9E/SVtcnYv4IH32 7Je4Yi9sjK+9VBU2HWrWW5UnL9HRz68xGTJT2lTa/bpvCH2E3YnMYqja9McKSeirfNmR NgE2KPaZJJtuO/dLoK/VuQXUXByd0kkbG3MPZqKOhnc6Rc3I6QbsHDMr3ZGwYcFPmeKH iqyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="FhPRUsm/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="p4Hp/xKW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mw1-20020a17090b4d0100b001bc5f4208b8si1129572pjb.51.2022.02.21.20.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 20:33:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="FhPRUsm/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="p4Hp/xKW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D1A42E0CD; Mon, 21 Feb 2022 20:22:19 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358391AbiBUM4M (ORCPT + 99 others); Mon, 21 Feb 2022 07:56:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233385AbiBUM4K (ORCPT ); Mon, 21 Feb 2022 07:56:10 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACB791C10F for ; Mon, 21 Feb 2022 04:55:47 -0800 (PST) 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-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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