From patchwork Wed Nov 8 18:28:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 13450382 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 4A8EEC4332F for ; Wed, 8 Nov 2023 18:28:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 817B78D00C2; Wed, 8 Nov 2023 13:28:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7C7F78D0073; Wed, 8 Nov 2023 13:28:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6906A8D00C2; Wed, 8 Nov 2023 13:28:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 558508D0073 for ; Wed, 8 Nov 2023 13:28:20 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2B45D80442 for ; Wed, 8 Nov 2023 18:28:20 +0000 (UTC) X-FDA: 81435621960.28.B9A2DFE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 5D68380025 for ; Wed, 8 Nov 2023 18:28:16 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=R3yxSlyq; spf=none (imf30.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=1699468098; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nKQ7Bn5WXdb5w70KcBh9auGo0P3KFj8JXeXSo8T8LYs=; b=jYrSqL0NZPcxloUx5ZYAXXcpC66qH6/uIfiHVq/YNutTult7GptRp/8INUJep3+PN0StrT W8kutcPd9N5r8gyCJjhHVFnpKm+Mqvq6A4ugQ2cnSp0v6DiGVIEE40aTVLoztk0PeK/dHt iw6w0dKAM3Z6S7FsbX/d8vsdB499LFs= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=R3yxSlyq; spf=none (imf30.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=1699468098; a=rsa-sha256; cv=none; b=IlDVL6T2yOiB8qyokrAAzhoirA7Oanna529rVM6tA//FIqHvc8s+NPrCpfqEQCb+a6YDyR D6R4Hw1387F9I9lpQ3mWVaIyBRCsb1kK5dQYz7gV0QFOkTPStss6a5dSoOQPRdT2LFg6SL AECANngwd0kaYJa5WxTnNExWtAVRJLs= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=nKQ7Bn5WXdb5w70KcBh9auGo0P3KFj8JXeXSo8T8LYs=; b=R3yxSlyqS8iNOg9n2SRGPjum9p //nxbgsGM+1HtpS1x/LFpeDo8MkqicXUNJj9yN7VRWKanozAtWurYGpn2d5rREIBm35x94z2WjXYn UuonLQo0IEJ7IUkx/cAtP+Cv419tiYde7ST1AZOO5YHXr7Bz5C12xdNqaZ4YhGXmOAvWRNVRaGtSw afNXCs9miAltzZ0Ss4vKPgu3pqp0BiglLxkLX+zUmLvhRRmlQSMZtVI1eqpR07/CthWb2V8GdgUpZ XudhdnmFRFRNMezrNBwfvkZbd9BQE5dtpXx9NDksQ3qctKkk02LZEZtwMhfbfeL3rOmR6c2lfxf1o H6E1dTHQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0nHf-002WdK-3w; Wed, 08 Nov 2023 18:28:11 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , Naoya Horiguchi , linux-mm@kvack.org Subject: [PATCH 3/6] mm: Use mapping_evict_folio() in truncate_error_page() Date: Wed, 8 Nov 2023 18:28:06 +0000 Message-Id: <20231108182809.602073-4-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231108182809.602073-1-willy@infradead.org> References: <20231108182809.602073-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5D68380025 X-Rspam-User: X-Stat-Signature: i7wa7mr94xo7ohe1nek11yqkgtichmgc X-Rspamd-Server: rspam01 X-HE-Tag: 1699468096-18402 X-HE-Meta: U2FsdGVkX1/MVohcnavZM6s/4f5BMbg3+Q4CXki46OIy6cKs6VKOAoZCQVhCpX8ZsBTSmKpfs2iCF64Z3DqKgu2s2TOwfYLCsWN3IBOnqWllNxeA2ALUa2fjvP8WSV7Bdc8iOSRVW2H4S3mDsyNglibFeyQxV50E/XsXIEgUeBNDJl9iUyfc/k0Cxr5W61Nvk4aBTUNsdf4tD8Kf/JZOXO/mri+04OvFNROT9fN9mf4D3YaMr97d+vwcL9Xxt9/gFrjcbPDl3m80HxqCTK/qWa0Ss8z1lIVTx+lxx/nyJWJGX/7zRIHWbfu8DWKS7HEA68UGmvY394KVP0EZHvTw1V8UCDfXeNZvRC5evlX/c7UL+b1A/oIV/AkgXa02hhTu0j5bcDnoSPcQCm1Y1xpVTY8rGVE5qrJx4pQJ3F+1NZAd5eRkkJzp3n8Nlsc+vu/ha0Dq5KzKfcx3Cs1cFwHxrfqfkoou1Ao1XN3uhEp5WvdJShDZWF6QmU1xDCLDfuzEqECMYf+sGtV2kAMWdMfz2EI8vV30+yPjNea3CwScdyxLT+Hfj+zTKDUNh+gUi2TMjSrIAtSUqkYe6PfJ/ikkbWP8QRZAOcgkyv7+Mq3GhvCgBODxz8TecXs80G5v4TCuE/X0wHHWdcUPuhzyrqzZ/f/KmT6xCwYjnSghWgMENDLHsAFnu8rk7J6Lyb92rrYwFweGGL4L0qT7j6+P0I1a+vKQ87o5E65y17gIyO9JrRGu30jnYyY9J9JOKs4YrITlX3qDUf+JMsy0iUbfgnvoSWGc39gYlj5TcYTjN4E+Hre8p/JJ9EIQWYHn7sKkM7aUfgCS9sEEMLCBzU2lLG2nLCoRHL7KKg52EEeMaLoGUp1Yn5zMvpfd7s6LP4/dcWn+qWfFzdKhqkjH2nvyYfot6lICBb4sMGTIBTnuA81/22OYsad2njb6cP5qXkU97Ya9xHBt8tKKyErHRje4tif 6clV3iZm OmHdDizzowj0/0kZAOJ6xmbWSyK/zK0Or3V3uKmCqOE0gFV2CZTf6wAtlTcaidhM/Qdqe0ElEGzMkmPaIVpLEbfSUwh0u1UlYC75Au+IRwfstKQaz4rjJh9ugjLXN7lMs+eLEw9MnzE8Ke32KVikiTj5PN7nzb38tHWg4fcrW2ARn+Q7YPw4r5MrPMknOPX3mD1KBfhSzHmGNgBRRqMOTRGWKBgZJ+VykNceV 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: List-Subscribe: List-Unsubscribe: We already have the folio and the mapping, so replace the call to invalidate_inode_page() with mapping_evict_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory-failure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 660c21859118..9f03952e6d38 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -930,10 +930,10 @@ static int delete_from_lru_cache(struct page *p) static int truncate_error_page(struct page *p, unsigned long pfn, struct address_space *mapping) { + struct folio *folio = page_folio(p); int ret = MF_FAILED; if (mapping->a_ops->error_remove_page) { - struct folio *folio = page_folio(p); int err = mapping->a_ops->error_remove_page(mapping, p); if (err != 0) @@ -947,7 +947,7 @@ static int truncate_error_page(struct page *p, unsigned long pfn, * If the file system doesn't support it just invalidate * This fails on dirty or anything with private pages */ - if (invalidate_inode_page(p)) + if (mapping_evict_folio(mapping, folio)) ret = MF_RECOVERED; else pr_info("%#lx: Failed to invalidate\n", pfn);