From patchwork Wed Jul 19 09:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13318702 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 A1BC9EB64DA for ; Wed, 19 Jul 2023 09:59:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C0B5280048; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6F8CE280045; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59891280046; Wed, 19 Jul 2023 05:59:04 -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 48734280045 for ; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 21FAEB079B for ; Wed, 19 Jul 2023 09:59:04 +0000 (UTC) X-FDA: 81027913008.30.256484B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf11.hostedemail.com (Postfix) with ESMTP id 4342B4001A for ; Wed, 19 Jul 2023 09:59:00 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 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=1689760742; 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=8pEhW7UStfxXp+iiPvwXWB0BJn1hLUjlYFivcxoOpKU=; b=Zfq1lwA+LnGHdKXwqJuZidsmYnGIkA386kcxgavz+XkKXqSm04fYvL4TalRGatnqXQ8Bgw kTIl08zEwVl1HiPm3BfTUAdukbObqCAcDL/47MXcS85NPw9rRbgmqdisMY9v1Ri+ymgbw5 RXO3fg6sF1mkcSARUSLt8Zy8cSJn3PQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689760742; a=rsa-sha256; cv=none; b=2K5ZMcQGvvx95AKD31tqLOP5jDjA+lS+zC7AoZfMHx1pHun7+TThl1YQwlqcQarnhC5Bfq RYq+IzB4klRIE0BsOxCFgp4ytWEyaaUKVq3LegB4fqEYX6jqD5YBI+FSNXWswCBAdgi2UC 1aMyj4s+bLMhYbdx3s2dR+dIlJkxJKo= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R5WRB2t8dztR9M; Wed, 19 Jul 2023 17:55:50 +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; Wed, 19 Jul 2023 17:58:56 +0800 From: Peng Zhang To: , , CC: , , , , ZhangPeng Subject: [PATCH v2 4/9] mm/page_io: use a folio in __end_swap_bio_read() Date: Wed, 19 Jul 2023 17:58:43 +0800 Message-ID: <20230719095848.3422629-5-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230719095848.3422629-1-zhangpeng362@huawei.com> References: <20230719095848.3422629-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: 4342B4001A X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: kmumwaxbcmjtntspjca3nmc8gjrt8c7t X-HE-Tag: 1689760740-674560 X-HE-Meta: U2FsdGVkX18aO5df+6aMQ/XEoZ7RaQX26PRLTAbW8ts0OYl2H6D5SzOp19YLDYcL/rZelxrG9DnHRxQrBYTALf6viQYhbfMS9xMOQdO022Nweia9EzHu+Sq03p6DNoYjWD0MDJUW0AZURiUTSnE6hfydvpgJ+qDtoc11tLxZFkwjEgjQ943ujHzjVr/0ix73SWh+SMFk1kKfR8Z6Ys7BQzkaKGmiK4aU3/ScJeSTH11oui/SrROIhu44ODw69ImpZNkjXxu68nU8ZF0HgLkfmc7AmVOPHqzlU+g04tXc8xNZ99j2SvSzkYQOhisAcju0O1nPWv3B6FRypwW0Xrujg88Mve0/a+jWondK/RoBt1viGsz7lQlgxkL3sau/gj+OLi+gr3BfwMc/KiKCuVjF40CctmF7YDhIvJILKv1WClV2O/YF8lzRAkCtU7BIxjVoywdRuEDEWL8LboDtSJby2dR/saBJ0Cuao6snwZCc8OvgzJsJYq6UAI54sDE6GUkdfoYn9T94cQhxo3DAfib2qOd9FzyIpONwye9ggYLwuYGohf45ILc759Yspfmp6+PjjhsE74sE7SKgAIQHbSTuY0se4YJld0OvoLr+ggC5mRMteiGgALIsKjFmdeeFjDERxXCNw93Y+dF//W1EYcZ5twpkDl13zUs6UL9u3dcNDtkQwLj7OcgUpnzmWHyoVBsabNZVZaulDvcqtlTYG88nJXSPOXBei2PH7VW7prV2xU5BfFFPL7rSqLGd7nemfsvnzzXTKcJjv5OuKawCKRRTDGxZgtPkWfDK6GYbzBZ7SV8yhuM2bVuFcOunK6XyIEMXKK62khsaXqnzux4xIfYdZrAzVMwdtwQgXlkFzInGzvBpmmbTL/PnoOuqHEHvEWxoZNHt8vZjoy6iWr9cOUkg9A9ZnVaC+q9UmYGZNIT+xmQDPNdefSqPLplHBted807arURF8t0WzIc5hnDk70T zSt0kokm K80Ox7kNchK45fIGmvn/ox9PUiZWB9YjRYvzjn7tZMIRoAt5xq2/CZOgse8ohawMBllENOkq9RJtuuJPksqXdUWkJnK0X5fLT3VZbx6pk6y5CWeWjawlmNKYDkEvI3crVmUNCSFW0KKMxgbigQPvXqZMcrUOYxo624jQ92I5Qs0M/EmYapk95G2u6Ej+EE5t9zneY 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 e21d570c873d..6520687bd282 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_folio_all(bio)->page; + 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)