From patchwork Fri Jul 21 03:44:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13321293 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 8888BEB64DD for ; Fri, 21 Jul 2023 03:45:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67D39280188; Thu, 20 Jul 2023 23:45:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 33184280187; Thu, 20 Jul 2023 23:45:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F38EA280189; Thu, 20 Jul 2023 23:45:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B844F28004C for ; Thu, 20 Jul 2023 23:45:17 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 74125A0132 for ; Fri, 21 Jul 2023 03:45:17 +0000 (UTC) X-FDA: 81034228674.29.D0582F1 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf15.hostedemail.com (Postfix) with ESMTP id ABD28A0010 for ; Fri, 21 Jul 2023 03:45:14 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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=1689911115; 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=Y64l8WDpxbcGG8Xry2gFMPMgbpKFAw8DYuJRZiQAZO2hp/syYldccvmfHsse25XgdEO0Z+ C7Fx4NepI9CrhoQAIk+Qu9xre/18Q9Ra13wUsfcA3euD56qU8TVBv2Q5Ym5aLVA5d6IS4L qEUYSdNu9LZY1g52HsAoXQbZv16tZnQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689911115; a=rsa-sha256; cv=none; b=Y1IuwiIHGt3ZioTaYtR4TNSmYxeAUFselQpNbY3Ea6cDKPwUepoDjSSWCInOYFv7irc1RP qWCRy20Yy5H7B2S1faKJwgTEehfMx3A87Ls2fPBmbLLnUhbYclzW3tauKIYD/6CKEZIVEe CB5YF9iRqPUP8FwE/ifVukYvuwleTX4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R6b4x0PtvzVjnQ; Fri, 21 Jul 2023 11:43:45 +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; Fri, 21 Jul 2023 11:45:10 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v4 04/10] mm/page_io: use a folio in __end_swap_bio_write() Date: Fri, 21 Jul 2023 11:44:45 +0800 Message-ID: <20230721034451.16412-5-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230721034451.16412-1-zhangpeng362@huawei.com> References: <20230721034451.16412-1-zhangpeng362@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Stat-Signature: hwxhy99gj8g5b3pfcrpk3j4q35tfpqoj X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: ABD28A0010 X-Rspam-User: X-HE-Tag: 1689911114-692830 X-HE-Meta: U2FsdGVkX18mw4wHvVIbtp8S3Ju6EvaB0GGV0CScD5zfV5rddKbLB3Kjj+9LSx0+zkz3tfbMIgqkZYn8LPC40U80vIYrz4Pzn8DyCh372VED2+crBkDQxYiVM2pjYsEA1Ab1FpqVzwTwJTQ2RcOzRNzcHlhI0NQlaH826g7nIouQlRqz5w0G7ovjrizuxsac7ckSsdagK83CoI2VA3ccF1UQiH4O8cFKKd0TthH3lUUEh4mihjbRMHRjgiTDEz8SsZutkLRSHMhOeELDcsSs9NuWH813ls+091Q8WoCM9t00AxVgc4bsnLOuneQ1//tLmbGhaPWk++LPgUz2ETAasVMdtsZ+q1te6jeU3QhyMLMvPjY6wsqQ9xpUUHjUzXIfSDY0YTl1+5GHdE4sBBllSRqvSZ4RLFGTH5dFdP3SYEbZXQEqaNKQaXD/tWSv1hz6/nK0KHv4P1dSYn7Mj2q5NIgT+uy5Vv/c/0FPYrhWnYAzpw4dKc9mDQz/vKjZiJvBXwwgk+Wz4j48OLCW9CbW/SMonjgKTGS2X4neyHwGKqWpqlfM4MzG1/XdDh5ysw9cdE3LSLr1eN4VtkWc1aWpXRNAcl9FzORnBfW7+RqWnQPYxlXSAov/kyC3hVHFpTvHoSlhP3nARTJaw0SWKyoyO5gkE6y5hjV22vwrgWMkMRqpCfR7YSQS/r3YCpeS7nLcAAdv9Kiuk/0tUtug3Uk/Mrqdvy4Law77rI7pFyH2/TugelJ6ekGm8T1eCVvDOWxraoQSqzRaK06rTXKFWVyEKa4E6fesIORz9nBhjpNV0hlwWxIKTFlQ6f8z4zdHo6Df4jR8vhVFSrSBU4FBAUqpE1MY6CKWt8XJf331HjYxVWMhfEVtpqTj3Ae49Gi5sVVo0LIMIYeyuBVL6miJs3JNWsclkBZ4slOJ6MDzxDjyt+Y1wI7WlZUpcE8EpimaxyQQ9Sv6SICkIWKd3fxaSOp JKRKKLK7 oysXwPr5T4o5xmQzwvt680IyspRxLUeVPvd8bX8pVxHRwFwDFdLE7E7Isd37btqkCJjON1n6Z8J5cnkheHoafA8j99Jx/youPkHwiGfYGMflT59P40jDFTZHxWo7COMi5UM73Ws0m8OIx/UsmSOd8k1aMI38ph2p9mWL8rTnIeJEQ3YbCromXL28f9UHXLK9ivpdF 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)