From patchwork Thu Jul 20 13:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13320495 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 33309EB64DA for ; Thu, 20 Jul 2023 13:03:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF086280104; Thu, 20 Jul 2023 09:03:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA22428004C; Thu, 20 Jul 2023 09:03:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A68E8280104; Thu, 20 Jul 2023 09:03:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9510728004C for ; Thu, 20 Jul 2023 09:03:06 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 62F38120247 for ; Thu, 20 Jul 2023 13:03:06 +0000 (UTC) X-FDA: 81032005572.28.35FD6B6 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id 45425A0269 for ; Thu, 20 Jul 2023 13:02:22 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689858144; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CB+qHE2AIiaz5vX2bP273n+UcyM/xFYJgaKztaFkiuE=; b=CgGbxf4uUHlUPHQC9eQZHdkvEwOdNubAvws+7GneAZP6NwhSEhVySv1juQaBtflCplymEk mpGaptfTcktBQjKcq5fyiWOqobByHEP6XI4DoU5Iz9Fz7WBdME3jGPeRLTfWWY1yIi7THZ h1Eyr8pNJc0zgLebgg5LpNnD5QF73HM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689858144; a=rsa-sha256; cv=none; b=NcKpiJbyANx84AN0gIiVxTlPUmQYAO/7bOE8Wr1ThxalDSfFM2PTNeOU+xG2HVCx7e6L1a SBZnYqnO07eRKr26siXf+AxwSEN8Tecv/S0V7gK4I9gVPR5VFPJX8QLRSixwcGNXjVW/96 NRA2uTHyM+jDKOJR0834AE3/wKxTIqk= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R6CSG5GfNztRdc; Thu, 20 Jul 2023 20:59:10 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 20 Jul 2023 21:02:17 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v3 05/10] mm/page_io: use a folio in __end_swap_bio_read() Date: Thu, 20 Jul 2023 21:01:42 +0800 Message-ID: <20230720130147.4071649-6-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720130147.4071649-1-zhangpeng362@huawei.com> References: <20230720130147.4071649-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 45425A0269 X-Rspam-User: X-Stat-Signature: sgkpxcudhtmj1467zsey1pwitanodajy X-Rspamd-Server: rspam03 X-HE-Tag: 1689858142-26185 X-HE-Meta: U2FsdGVkX18pYu2+C3JJNkheAk2sgLR+CKoyh+KvvhpU6WI+ljQEtDo361XaIz/wTjZ1P9empV6Mp8pbFHQ3DFIpCP2zj54hYyWBB4UmiTXE313yThIxhyiQr+R85ZgnbF7NCz7CSSDclt4Qp8QTFt+Sqh1oV7cYNIgE8T0JZ0NIo4pSWYDIgFxPbnD2giBU4QCGN09h2CAotJbSO47e9tUHd+0seCdImSROM26ZmzJI/TOiTxsU1wxnQ9N6COt7UDTRTob+BBRgljNqNHB0Ly/E3Bj32wW3N+ZDIqrp5vQ0szNYIyS/89QMWCh38U6qDg/qX66XlIZiF8ox0720D+ayASQZxDw0/QEl+A3DnyF7qWeV2N1qJWLx052s2R9FbpeGpE2kL2LOjqqXuxddT/aDLpLUjCiorMewBl+d+FEGoHBVvilgJsz9TqMmMubVK5xqDthMD9pEN3CjhrAZZmqqMgUW0Fxkep8bt1bFY3a0k1zPRj51Z2TL9bM1Q6jTgCQQuuojv9VXTBMIxsP9NwdIfGDKLv6I+oaP/FP2acu908XxOV+iVcYOb1ABYMQwsObUDs8/1jaWzakeMZRVKU3moOwIaTaFU/sE1f/hEKOHDEsHpuQaiIn67lzoi/ooMULt0nV3k7wKF8Or0tw0JXIyYz6YgcDlk3n4J/z8k/t/U74z1DY843pK/IZY2+9mpRB5Zk5cKF9X3yMcw/oBPwnFGPOQdXf7YuVtzo5hF6CkQI/WU0BJ/QDieFsIzgBWqVpZzPJ34hqrnJ9dAISBJ6lggXpNueCZm1G9ArdEwYTWYExj+RZQ0OkNAs0ZwFYfz4pKtKRKuEtiocZBUvGMR9J7AcHFDyDF5b04Q3vaOmrVm9ve0CjhFUBwpVHtFCGSb9YQyxiflwSsWTL5XR6MxNrWPc72Q2bkVCRoG/vKlRyg+MjJB2t8o1xi/3vrg8wGR8bRrF9grWm32nnF6Me f+6K8GDJ N+Byngkk0B2l1gcVssKUQ819jU/DCoLy6FzAyGJ+3pPmFzYX1l6tAkWIC/P9oixPWb1C2tsF9kEKFjZGQ1MEM6qodbDYUNi1nXge13HML8hb3q+NyWfUDYhNwFs4c78yKRgTKJRTqEhqk9LxkMAaVsXsnmuB7BE91auXThY61m2mB43UiI3vlq/F/i3Vz1l2qmXSP 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: From: ZhangPeng Saves one implicit call to compound_head(). Signed-off-by: ZhangPeng --- mm/page_io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index d9f5fa5b7281..3b97289153f9 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -57,16 +57,16 @@ static void end_swap_bio_write(struct bio *bio) static void __end_swap_bio_read(struct bio *bio) { - struct page *page = bio_first_page_all(bio); + struct folio *folio = bio_first_folio_all(bio); if (bio->bi_status) { pr_alert_ratelimited("Read-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); } else { - SetPageUptodate(page); + folio_mark_uptodate(folio); } - unlock_page(page); + folio_unlock(folio); } static void end_swap_bio_read(struct bio *bio)