Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6313582pxb; Mon, 14 Feb 2022 22:37:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZpml6DCw9aDLWDDQP2YBnOgTLpqXCzKXep4TDLLFOGbmeFNnuw6oIHm3yDPbLbZvX4CRI X-Received: by 2002:aa7:d38b:: with SMTP id x11mr2364853edq.375.1644907048912; Mon, 14 Feb 2022 22:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644907048; cv=none; d=google.com; s=arc-20160816; b=lInsHIkTjwiBB4Z2oRrHDZ0+X6ZctW0JwbPCBVCvltLb/tFCJsvcFkRiVlBiOKiTr1 L9wl/QJMijIt6Em5QFm3omRVymfl2bTvt54c80I+OMDbvfjYHS7txuu4HLjCz0G4Y5q4 zFPGNPUk7bC9cf0zofAVNEcxN9ntpK5B96sJunUZwIaZdYf/MS26llgWsrpuSP0A7jkx 4VgNd0bXEpPMd+YoxDMknzmI+2sq0CdZm/822TR3YyTqGbUtLyFMvWVajkbZmQiHJm9j dLKjTQf3ZTnPralbTLxDnFwc2nr6tBBdLtOzYoUA0x1AJ8DQ3DdEfETKN6GkwmNWmfa1 Wzhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kOBKJycL81OOcnz/wzLWIHULrWAHHJ8TaoUqk5qW5QE=; b=sFNxuKeJUqvRrs902ru5LasjLviDIVuTAJcZ7XNr+k6R+U/FGto+1A9iISiuYPv88X 6JAXtP1ONkFtEoUutWduNuHf0e5YCyoiTf6dPU9FhIIlAhW41DMZjdPCP0gdU5OQUbCa 7pEjqencuUTy2UXgbkJY93bpH4B+JJNJTeM/kQBeY9y27R3Bmr75lf7Sq3OxSjBW8BK5 36yhQIrbNCkKXdKupba7FhthXh+jxflVwFpkQrGivJvrJcadiDHfCuXaAeqQ5Ahu1orc 9OFxXJiWSUimD7MMiWhYu93gUII8YIGvHvlTMcOCEhvOux49dtz4iluu6gDDOCJb59pu qJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=qqqkJhBi; 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 m4si5733426eja.182.2022.02.14.22.37.06; Mon, 14 Feb 2022 22:37:28 -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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=qqqkJhBi; 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 S232114AbiBNXYV (ORCPT + 99 others); Mon, 14 Feb 2022 18:24:21 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiBNXYU (ORCPT ); Mon, 14 Feb 2022 18:24:20 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA2E13C9D8 for ; Mon, 14 Feb 2022 15:24:11 -0800 (PST) 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 48409B816DD for ; 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-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, 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 > 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?