From patchwork Fri Nov 17 16:14:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13459123 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 EFF13C197A0 for ; Fri, 17 Nov 2023 16:15:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E20C6B04EB; Fri, 17 Nov 2023 11:15:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3933E6B04ED; Fri, 17 Nov 2023 11:15:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25A116B04EE; Fri, 17 Nov 2023 11:15:06 -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 11FC56B04EB for ; Fri, 17 Nov 2023 11:15:06 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D44168063C for ; Fri, 17 Nov 2023 16:15:05 +0000 (UTC) X-FDA: 81467945370.28.A740FA6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 2875820010 for ; Fri, 17 Nov 2023 16:15:03 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cP4vkMrj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700237704; 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=zgKIMNO9SoWoamx4nfeJw6ay/xwbZPsNF5ZtmzNQz8s=; b=7nz2s+HEVNnIQLbAY6DY6/0THUuNERPscqkv3wVufQJ8XCZjfyJA7NP0yo5uLoy1nKZaQ/ L6qQa6nsTH/YsVmmDz71oOeE03yHvv/uDMbmCdTNX7uvuF9aWQ7pbw3NXrVO/TFMTzywr7 rT4UZeKoom1YNsZ9jeGE02Fb4CXhd+4= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cP4vkMrj; dmarc=none; spf=none (imf03.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700237704; a=rsa-sha256; cv=none; b=SpxvxQXE+10u5czhSI/qX9ewzSgAArbyd+RX/lEgeChqr1g/1lzuVLsDqAttDaCajp8064 U/hPzh4t8f58W7/O569Lpt/hyURFCOKyKfJuyCFAP6Nb7ZhVv+OzWeSPpkYlqGARuf4Wqm Yc5mhI4r/ux98S1B6nQdAU5LKwShXc8= 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=zgKIMNO9SoWoamx4nfeJw6ay/xwbZPsNF5ZtmzNQz8s=; b=cP4vkMrj4ZpFOH9Q3bcgXCdmVK v7qVSAJdIVOD50Uf5a496mO7tImj5kJgldjKrv0Tq2fbmqV/M1sByRDx1dCoCvXxWLcOJ03Lh1EUB ozuILp2raG7J9TXGwKi+IYSpJOGltR0J3LlopzajD11deTId2zJl9cNtdudORtwEDgX/4DjCVvd+L QgQ0bISL9h9rL9OAq9h5Rt/Jdj7xciZsrukosx8e6sEb4mbv0vEGlNZu7aJECz1aDc8+M4UxhdhKA KdVD/Jx48zE+W3qXgwZSvHqC6drT4UJtm9xJzRsZWFZwKQaqoQHjuajoUGCS0dsQ6lo+nX5gUeEIs akTRRVmw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r41Uc-00AKXs-J5; Fri, 17 Nov 2023 16:14:54 +0000 From: "Matthew Wilcox (Oracle)" To: Naoya Horiguchi , Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/6] memory-failure: Use a folio in me_pagecache_dirty() Date: Fri, 17 Nov 2023 16:14:43 +0000 Message-Id: <20231117161447.2461643-3-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20231117161447.2461643-1-willy@infradead.org> References: <20231117161447.2461643-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2875820010 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: cknn8rq31bdmhk4hie3x5dung9o3uyph X-HE-Tag: 1700237703-166719 X-HE-Meta: U2FsdGVkX1/pDQGxAtN+GuJ/XntDdJ72G6DW6FJ/yfbTpN0RtTUwHn6hQAlYic2L/Mz7pbP63DZT+fkKb+kOe4UdOAEQ10lB8ZfQo9e2r404xtytrYO2bHf+zsN1ySkisO6pOCvI5WFDYWG5G41Z5AbGISni1M3BEdrLINdx2aKzq7L5blCcQ23tB0Du700z5Zu0KNgReIPUeVbR8EkhEr2FRVRDZowq5kQ26LddnTHCPUImKKd4TFp5zn0w48zeA7VdXT6q6FiiFv5VStja6Iq5YVIxKBuFFW1FLodsyt4xK3ME+gSiukgu1v/vlCG/6BwyothhZOD+19XKWev+fwcvV8DqYZPKG0vNpS21onTR4PFLH1HM2fpzuQdjRz5j/ovMf/OwWMGM6/g2RycTkXx4sL4lD2AEAwsXBiFOQMKu+eL0U88yqWoakIGsIGm6rK0a3vpX5PJfFtPL5rOFJLfrnMkP+2QcPcUgtPiSNzmvHuPi/qDb877vTZQM0je/PXDA1WmwnRD8+2kharjHg53Y/n0XdLjKtfX4uHTReowpr1zgAuVUIyO0VAb4BiEH5ik6zlClx92WBGxgCgHgzvQxSUPyxLPqMA7JFDFA2Gs27KuAKk+0GELTJJxW23xTArh3KHREMiYdTb29hxHLLkB4EpBAwKK+U/d8/jIxza5dnn6b+lRah2MIsm1BuOA63zNUab6+wx8dpzOb+e9vAyNnjVjsppce9gdPF/iude7w0rQnjgQPz7SxlQcTrWm/8EUVKqG7BHKEbVu4cbFJm9YZcfQa/giCuHCoOGTAm0lgkz2pdv73AG980aKzJe9LwxoCOdsduGrKk4Wku+OjQnrvocEHbUs9TzuAgcr7NVRzA4YFEeE2RSHfZzelC0a2D1G/Ar7t7PCQVobVFZSvrpXyN4GMw6YcfEuZ3Zo+hRI/pwEqspekJu3KW924r2+syYKknTyebRm7hu20DoN hSWlBqcr 9jW3MQ6jQ5/E8l32xp6PzS7dv3odOWziS1z7RvJSe96GqKHALSL3Bi8Adnuo83AP7iljcTdFbatzvBeU9lkp6xn/jITPnXZ4tuE8DlnP0YQLPhzzlNX/zNQ/X2UtiKMNOylaQuEacgHAQuL+07Frnyl/Tw5vw+odi0mHdQNRP9ByAIQjQS1rvGe2k6lFyTUbNXl4FRO5R7cAtXooeg4h19wB5cIDDJd1zqZj4 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: Replaces three hidden calls to compound_head() with one visible one. Signed-off-by: Matthew Wilcox (Oracle) --- mm/memory-failure.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 496e8ecd8496..d2764fd3e448 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1138,15 +1138,16 @@ static int me_pagecache_dirty(struct page_state *ps, struct page *p) */ static int me_swapcache_dirty(struct page_state *ps, struct page *p) { + struct folio *folio = page_folio(p); int ret; bool extra_pins = false; - ClearPageDirty(p); + folio_clear_dirty(folio); /* Trigger EIO in shmem: */ - ClearPageUptodate(p); + folio_clear_uptodate(folio); ret = delete_from_lru_cache(p) ? MF_FAILED : MF_DELAYED; - unlock_page(p); + folio_unlock(folio); if (ret == MF_DELAYED) extra_pins = true;