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 X-Patchwork-Id: 13459117 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cP4vkMrj" Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AA2DA4 for ; Fri, 17 Nov 2023 08:15:01 -0800 (PST) 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> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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;