From patchwork Thu Jul 20 13:01:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13320496 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 E235FEB64DA for ; Thu, 20 Jul 2023 13:03:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78FCD280105; Thu, 20 Jul 2023 09:03:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7342C28004C; Thu, 20 Jul 2023 09:03:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5FC3E280105; Thu, 20 Jul 2023 09:03:14 -0400 (EDT) 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 4C85B28004C for ; Thu, 20 Jul 2023 09:03:14 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A9692B0D40 for ; Thu, 20 Jul 2023 13:03:13 +0000 (UTC) X-FDA: 81032005866.04.F83A243 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf20.hostedemail.com (Postfix) with ESMTP id 9D45F1C0215 for ; Thu, 20 Jul 2023 13:02:25 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689858148; 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=2wILzb2wdzx6gb3QQe8NCuw5mHGSyWx+uSmLft9oKJA=; b=w39qBGoNk6fLvXKpTpapFYzE2OK3lPUMpCZTuhgjt/9BTNojEqNNp9e9y9pKa+cNNBqpvu lPRNmK8UReGfYWCj8ZBNK2uzDW7FQiBtyQfQSM4N57an+3iEVCZClb4bSm/SA37vFKf/Zm AIaJr3XWX69WOMa1wFJj0qJosk5bKmg= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689858148; a=rsa-sha256; cv=none; b=j75I2061gZV9MrgBjzY2CP+z11qV5u9DRdrAl9A1DEcls+u+j8W+13YvAD4IR4sSyPK8Ir fdT09YjZqGkCbsmpI6cvsbz/CDUT6jCTPOR0qlSsZUND/xWauD43q7sx7XqxtmoY8rsLA0 7Z8PLtUaOAMjtPdLZPSXjW7JwtyfKoo= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R6CW05Zwzz18Lhl; Thu, 20 Jul 2023 21:01:32 +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 04/10] mm/page_io: use a folio in __end_swap_bio_write() Date: Thu, 20 Jul 2023 21:01:41 +0800 Message-ID: <20230720130147.4071649-5-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: 9D45F1C0215 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: hunbm4masd6xwg9afewnadarubtkuwn4 X-HE-Tag: 1689858145-562918 X-HE-Meta: U2FsdGVkX18MBag7tC5IAfpy+ykCt1UqSdSHcs6R7f+Zvhbx40z5PHlAzHGxJJpYpKS/Pi3MQksQpJS5u6K38DOyzA0MXB7jHUoazrAxjvdF1ocjlkrGd1wpYUhOg6Ydol5/WFAzEDdpNMghP21QVD8Mxtc+OcT0vBwbNy8ekc3Xc2qxGP4htrVibeENjHGC4MRx/klhhFPTFSQ9V25e80Zu3qX69FYtvMEQJKcg88pkJr7u7fLLVEZ1emL/JQIkgjgRwYt8WPbYSrGv7xqD/nIQCvfATJTFgUyPlEg8BmVzB5dEY6vzXC0tJ9mvzWuYZnGzD8o2pX8T+RZW0EPjb0eZNKuW5lCvYRnje2/0lKx7IptGNhi5l14qoqi4XYpShS9SkXNM9ll/W6RMYNSCP+oKJlBkZICgzwTXS1pU62pO9bETYmD+KURnBZnNBk9HSRy32faF7dUXtIiaa+EiOD0gA9nexO8xcl5zaUTvjlIvaCwYkb/IMch6Ukcl1l0sXjTboUpJSBNukQ9VZrEBI3aPnxZg2NGf6EwbYcMRhF164qWHVujeCTH0oLextcJlCIziZBmNZcfVC2ijS4eKo6jvMXGbRejYPf/SDFpTJJng5IckbItR8nQZBUnPunw15/xSGLzZ4H1SN4xIa3xXcOYLAWTZnHldNCzC8M668LJXOs1kL/OYWgvUoR5cOp/qShOYspj7FmwF7FGB8vhUMyOQDBRsaFt+wtBhQVOlLQ5ghfNCbn6bpDSdxeH9r9q0NGLpCz9Pz8Uq7GH5ukYfq9GK/YXS4BXbdRug1C+d+bJGZL+uw7MkVZnCmWGYANk3ai688ICPW2G/ekm+IbPS0lXT4oQ86E4ZfRQQCaMkdYt+D/ers/+hurYpkBh3PkheDkBOPf7qcDGO5W0nJ9/yfy/sUVPvUG7EZF4VXiriStOBvduLyA0o233hFXUk0+lR4QCEJ/KjIUpYuV6FA48 ZKy7vMLq pnJnfMcyXBsLzFuEAg2K+PGPdDqc+yXqcQZKXi1NAybDvBpa0mKMCNCRm2FDq4RWgfCDNUtb07r/vNcHiL7LXawFiuFpBVDfGLijRb8x2+wq2oC/WSPi6b68w9K+TTzDzv5ggxcLHe8nBEoyVUmf1WDT7Plh8MHdzpUJYyOKrBs+iV16ybbJJcoTvQsnMxYFzjoWE 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 two implicit call to compound_head(). Signed-off-by: ZhangPeng --- mm/page_io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 5ddb5d9c5013..d9f5fa5b7281 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -29,7 +29,7 @@ static void __end_swap_bio_write(struct bio *bio) { - struct page *page = bio_first_page_all(bio); + struct folio *folio = bio_first_folio_all(bio); if (bio->bi_status) { /* @@ -40,13 +40,13 @@ static void __end_swap_bio_write(struct bio *bio) * * Also clear PG_reclaim to avoid folio_rotate_reclaimable() */ - set_page_dirty(page); + folio_mark_dirty(folio); pr_alert_ratelimited("Write-error on swap-device (%u:%u:%llu)\n", MAJOR(bio_dev(bio)), MINOR(bio_dev(bio)), (unsigned long long)bio->bi_iter.bi_sector); - ClearPageReclaim(page); + folio_clear_reclaim(folio); } - end_page_writeback(page); + folio_end_writeback(folio); } static void end_swap_bio_write(struct bio *bio)