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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3E39C433E6 for ; Tue, 16 Mar 2021 16:52:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 699066510F for ; Tue, 16 Mar 2021 16:52:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 699066510F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7F7B6B006E; Tue, 16 Mar 2021 12:52:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E43846B0070; Tue, 16 Mar 2021 12:52:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D327C6B0071; Tue, 16 Mar 2021 12:52:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id B7DAF6B006E for ; Tue, 16 Mar 2021 12:52:25 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6EF7B181AF5F4 for ; Tue, 16 Mar 2021 16:52:25 +0000 (UTC) X-FDA: 77926330650.12.CC9C615 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf24.hostedemail.com (Postfix) with ESMTP id 28E63A0049DC for ; Tue, 16 Mar 2021 16:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=dTxMrP36v2qN52/fl8EFPrSzXZJCup6aA6+qUs8MasE=; b=tsuC5GFEq/h2/tBX5qEGg0nf+O 2JCwhZRCmfC8fLmgw+oUfy/NhDLNn1sIumkGyxdYf5hBLVYKQf3saz7NT4yXpbpQ/rE0yEx9zHGEJ Hc+KPtqtrR2jWKwqN9TKzUdqju84VUyKUdMdU2b9YpJz6t2xy9Z2Q4Lxc+6fTYvKIHIqkAt7L+gfF RiqqYxE3gM4pcisyiQrWaYdUMqZNApcnO7zZ+JDbxY3juAFDOGKyJvJxKRJ2AU2XnCV29+mgtScbb VVBwrtuYbQck+ry/jj4ESVyZkuXyUcHayYdTM3GBijzA/qA3fPhflww9IQEQgPfTte8P3PjG5YsgN ZRpbFiqg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lMCvQ-000KzP-9s; Tue, 16 Mar 2021 16:52:11 +0000 Date: Tue, 16 Mar 2021 16:52:08 +0000 From: Matthew Wilcox To: Andi Kleen Cc: linux-mm@kvack.org, "Kirill A. Shutemov" , Hugh Dickins Subject: Re: File THP and HWPoison Message-ID: <20210316165208.GC3420@casper.infradead.org> References: <20210316140947.GA3420@casper.infradead.org> <20210316163649.GR203350@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210316163649.GR203350@tassilo.jf.intel.com> X-Stat-Signature: og4bo46uywtfxndthddrcub6qwj5j43a X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 28E63A0049DC Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615913542-322618 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 Tue, Mar 16, 2021 at 09:36:49AM -0700, Andi Kleen wrote: > > So we now map the PMD-sized page into userspace, even though it has a > > HWPoison in it. > > Yes that's bad. It might panic the system. > > > > > I think there are two things that we should be doing: > > > > 1. Attempt to split THPs which are file-backed. That makes most of this > > problem disappear because there won't be THPs with HWPoison, mostly. > > That seems simple and sensible. > > > 2. When the THP fails to split, use a spare page flag to indicate that > > the THP contains a HWPoison bit in one of its subpages. There are a > > lot of PF_SECOND flags available for this purpose. > > Why should it fail? I thought splitting always succeeds. If somebody has a temporary reference to it, splitting will fail. eg a process is currently doing a read() from it, so filemap_read() has a reference on the page. This is why THPs support a delayed split (currently used under memory pressure, but we could do something using that delayed list to schedule the page for splitting later if it has HWPoison).