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 175B8C636D7 for ; Tue, 21 Feb 2023 13:35:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6559B6B0071; Tue, 21 Feb 2023 08:35:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DEB46B0072; Tue, 21 Feb 2023 08:35:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47FDB6B0073; Tue, 21 Feb 2023 08:35:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 35BC76B0071 for ; Tue, 21 Feb 2023 08:35:48 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0A1A3160332 for ; Tue, 21 Feb 2023 13:35:48 +0000 (UTC) X-FDA: 80491396776.03.FF128BD Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 67900140018 for ; Tue, 21 Feb 2023 13:35:45 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=no6zPNoy; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676986546; a=rsa-sha256; cv=none; b=Ytqv2yfFLg77p8As+ytxE0hc5XYSGIixPCw0UD3QhMiK1X25j+uuB4Vwa+QCQRVwVHizPb 5WQQEoHzvamqJsPa1gv1w6OOlV3PNwJf3NPg/Fdu0sfTtF2c4/Jzb/DMJpIYE6BNWcwVNx E+w68S3+b4gH2bNRVAn3XOY2QrOY8R4= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=no6zPNoy; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676986546; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ob2cxxBdXr81LLPpENIwzSSrtJCmjBBJ5S46KOzsjZw=; b=yg0enPIG+34cXSPv/BKemCVq26sC75fbGf8Btlj6COZlrfB5sCAgy9kYVyzLbwYcYbEWQj PKnbbTfbxNlgTb21ZjWYSi/VDyEglDHaUtJVXSLsSZpDOBqxgs9WkoIlVKes0OSO+DvbD8 aobbrj9rl/A7GE8sB86PMupeSbrmJTM= 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=ob2cxxBdXr81LLPpENIwzSSrtJCmjBBJ5S46KOzsjZw=; b=no6zPNoy3SCqUF7vV0UdJg0nL2 w7r3zESpgB4xoxy1RNWEvXGqevOZ90Gfv0aB0hSEVvBtJYCV/RvZWLO8cDKIQhtUqpzMVqSAykrTi l9RZY11PLwH+psnpcg+/zD9S1TGrnvsQgy+7OVI4fAV5t0K7S2jaPx712hfTXmGhicy4sk36r/rIR gLxHLoBYRetJKSH8uskNRKXnneTkXRGD9virQC4qe3euX4I4+fO7/OC78MWW13P0t20FDowcU+JeK kit1Fm6hw9RMcsfbBFJNazrxREh/nqjPhY4aLXA6sIiJoduqYpr6t5R+8QoQQRfOJZJWrZgBanpci afzWEhvQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUSnz-00Ce2L-I6; Tue, 21 Feb 2023 13:35:39 +0000 Date: Tue, 21 Feb 2023 13:35:39 +0000 From: Matthew Wilcox To: Naoya Horiguchi Cc: linux-mm@kvack.org, Andrew Morton , Miaohe Lin , David Hildenbrand , Vlastimil Babka , Hugh Dickins , Minchan Kim , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] mm/hwpoison: convert TTU_IGNORE_HWPOISON to TTU_HWPOISON Message-ID: References: <20230221085905.1465385-1-naoya.horiguchi@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230221085905.1465385-1-naoya.horiguchi@linux.dev> X-Rspam-User: X-Rspamd-Queue-Id: 67900140018 X-Rspamd-Server: rspam01 X-Stat-Signature: jekrqt5hjhe76munxfr1enj8hrcjq1ag X-HE-Tag: 1676986545-513834 X-HE-Meta: U2FsdGVkX19ob5z3st9CYmoGvAS38c4c6DauFK1bJjcrUvyF5iILIGORgOfuaAtJg57JaV3JFgbla+UDZ+dFk3P1uABY+gf/RF4Nj/2LdhTjCuc8BUUplC9tcNoPM7ud4JhxxmPNXo3HBDvTBNFHesB4Ghsf04S4jikwHQzKViM7anvlRStLwezfUaCWvPk7PY3q83+08xBY/PMlEBjH9Jbi6pcRL+cRilRkbW6By+IYkGpbxOt/i2ElfRfPEYy2gfKQWXU00RniNA3UoV3f+qQsBz1/bAfWjh6k94MqQlY34c0mGHA6QfoFOjtfwkB4e9DD3p4KhmvNIBAdFybtw3UTr2cZA5j0OZMmsTuIeQ60TekCtdkjQGbZdRmeYFaj8KqBkBaV9J1fQNy54Rjxr7YOL3SkPA+iBNwaaOouD8jBlvGjhBgfO1TMcT9f6E+/f5vxctqbh6aiJFCZwAURbIokAMmcjcLXFONSJ8te9QiO2X5ez8AraPr9WZhkWHXA540xQ71zWHlxTqdAkBnFpz/LnCC3ctZ2k//8pWyYDnHWfVVjZrwSG/XXzpoDJQkHBiN6xHWIoNL1qpV27whll1ZfroWo5Uj91MYJzpBRyV+YNlMaJNeeMEFziMf2SbHLVqd5WEm2WJ+Q+ZyoiCd13CQczcUQ9fmAnUGSIYcz2pG0JNe7d0czxfQWcNKT/tjKIf9pym/jhL/y4UhY4rvw5UhqpOz54tXbKaekI73ZX9Eu4/DVEae1CvIih3jl4uNNRY0I1wQZEmi4hB/jzcVNrD9FWrP1bDz9cJdg3NwYTAjbEnon1XnA3FQ+u94Dap/Wcd5Vv26oOlBuSf+c5rTaQ0IBKdbOtf9kSYCKgTKrE0FW/1erVV0Osu4PLvdhb+Tagie3kdzrS5NTogaMRuGFdb7YdJ/+Jifd0u5oChhdsyn3nb7/QQl5mJOrdPoYdVHevJ/Pwi3jiG4BAMZlhui 8tteqzi1 weYFyOUSiK76r+eJpAPOKsXDYAVpPdzEFitHgGr4OI1GNvXmp/kHeopjPHpCe+1IRt9S/L0Szw+UKJbospJqiryEvLjqdDcSodxz152u6LNR13MwK9xNHTZBIOw0WL243i5gnC3GYIkT9bCZqR3gCHLMXdACyewFxOuGt8XziKD4pp2/DBDyEJfSlEKIq1sMLy/UxWOp77l0gZOY= 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, Feb 21, 2023 at 05:59:05PM +0900, Naoya Horiguchi wrote: > After a memory error happens on a clean folio, a process unexpectedly > receives SIGBUS when it accesses to the error page. This SIGBUS killing > is pointless and simply degrades the level of RAS of the system, because > the clean folio can be dropped without any data lost on memory error > handling as we do for a clean pagecache. > > When memory_failure() is called on a clean folio, try_to_unmap() is called > twice (one from split_huge_page() and one from hwpoison_user_mappings()). > The root cause of the issue is that pte conversion to hwpoisoned entry is > now done in the first call of try_to_unmap() because PageHWPoison is already > set at this point, while it's actually expected to be done in the second > call. This behavior disturbs the error handling operation like removing > pagecache, which results in the malfunction described above. > > So convert TTU_IGNORE_HWPOISON into TTU_HWPOISON and set TTU_HWPOISON only > when we really intend to convert pte to hwpoison entry. This can prevent > other callers of try_to_unmap() from accidentally converting to hwpoison > entries. > > Fixes: a42634a6c07d ("readahead: Use a folio in read_pages()") How did you choose this Fixes tag?