From patchwork Wed Jul 19 09:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13318703 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 9BF17C001DC for ; Wed, 19 Jul 2023 09:59:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C79ED280046; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB388280045; 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 98F91280049; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 71F01280046 for ; Wed, 19 Jul 2023 05:59:04 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3A3634020F for ; Wed, 19 Jul 2023 09:59:04 +0000 (UTC) X-FDA: 81027913008.28.4059647 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf04.hostedemail.com (Postfix) with ESMTP id B1C4F40014 for ; Wed, 19 Jul 2023 09:59:01 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.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=7iJ8RQalvU29tR6/0DVQL0+l89i13Wo4PPDJ7dZu1gI=; b=i9g1GHxGaLdZklhSSxRHEvIZqIqfyz3AVDenwWdpDwT/WEYfmIK3WpvmCDGDf5btYtY9Lo cukQUHPPvcsyYmTv+mn4HGcnO8cIh1hmT5L2Lgxje/a3NTLf9gfyH/+Lxur1ceIhRc4juv JraGQDoVYnmzDq+sh7mwT+JV54JXbuY= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.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=hvtuxP0+SRwJV7a6fYkCUmVFoo9hYey6Xu7Aml/ZFNkheYxP80gqYziEJPqmfm+tk5/bZ3 v8wsQmaaaEYmlgkII0D3KXi9ln5X6/0FpSTeXdIUCiw0GaFJB6mcxS4ge6WBGpUmhZPooA rRZByQeAABIDp44Qe2Xzg5SOGCFWHl4= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R5WRC0MkCztQlV; Wed, 19 Jul 2023 17:55:51 +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:57 +0800 From: Peng Zhang To: , , CC: , , , , ZhangPeng Subject: [PATCH v2 5/9] mm/page_io: use a folio in sio_read_complete() Date: Wed, 19 Jul 2023 17:58:44 +0800 Message-ID: <20230719095848.3422629-6-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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B1C4F40014 X-Stat-Signature: hjpkuweapcxb7jpq8nezpbuqqbagu1e6 X-HE-Tag: 1689760741-268239 X-HE-Meta: U2FsdGVkX18joMV0PqRy8BLXJCLSb57zEYKvNv9dDwfxzOspkVWdvER8CT5yi/2EQ/O2TlbqqwgpJTw51tRvw5mSmtxjj+cAoOe8VyqrKkE0uJVLF22mOg/B2Vy9r6Qia2AKQ3OA6FwHry56yI6oilsLpifyVA2SjqJNHBggjKMayi2UDtk3mr++s1noztEzb9ECOiq66Kfo92QM67nDLedLGaGWfVqdngN9bJESSv9qlSQFWTmIzLd0Zxm2l20wotUuLkkY+oMxozniL95N6en5fbGFVFWrzpXHxT3fsfEID1eRhNWc3/9dcgMF6bLjpBbsd5Pb4EmdDsHAp/C/Zz6EXUaDA4tz6AbYSes18+Jq7H9M1GLMAaUnZdThl9wJe6Mr7kLbWeNDISzh+p+2iD8m6jbMdR+0EpioY7ioPaahq7fkO184nCHBWMKykmJGJQRjHy4NnMj/wX4PSQcl/JEp9JjAQXK6yh4Uki/CxzOO+wosZyM2W+YY9kwrWA+lkTn0PyCBpDz4CRympXmtnSzoJP+11LDE6OcWCWwcgW7dUMpbn760sv1dGUUNxgtSKVCVhTsDv5xfTmmCkWJQQXjZiSEfJLEmv+2dRBzmaEgFsymckkJf+UqwE+YFflJWzwNVHSc4GbEoseViam7mbx3yqtj9umGw7GNxFmEnSpSUBBsl4WsTMNcx88rxLntELo7I4oWKVKktuV+Pmo1p+MY421ZCwbZlJRdApIrpUo9Iv8X/peNYqDKb3SsHLhzJujO/KWWncnw5v91vWzI5I6AwGZW84kIqVWtoMvGw2MoBVWzSL0IJw7g3nI3XQGy8G71e04KRUAJPfZkIlWa6WDO4+ki7qVUFclXvzSIhgIASJ5yJmyb79fvPoywe7RMT1oqeqQPcJovsM6w5uWolDgAGc2ol7O2UwvqLECpUh1aE9Il9BrrelnrN5h0PqT5HBwP2iPIhd+6sYQTZu/o eBLhXZpq inr5CzuZYJbsTz9nWm+0472jXPDFkcSy1/+FqTuOuxe1kAnGocmtv/s3hvysQVJLAZ+14nJ9I6vQhNiqMdR0T5sZPDmx2T7EI2Rgv5NjMiqEOyvA6f+frfxLmlLfIA5sbAIUwkZ7ofc0UuWto1dxYck3ChGfx1USlCOKHthKR6T5k604K6dohE4pxFyRL/FE2UGTT 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 6520687bd282..92f21f380ee8 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -403,17 +403,17 @@ static void sio_read_complete(struct kiocb *iocb, long ret) if (ret == sio->len) { for (p = 0; p < sio->pages; p++) { - struct page *page = sio->bvec[p].bv_page; + struct folio *folio = page_folio(sio->bvec[p].bv_page); - SetPageUptodate(page); - unlock_page(page); + folio_mark_uptodate(folio); + folio_unlock(folio); } count_vm_events(PSWPIN, sio->pages); } else { for (p = 0; p < sio->pages; p++) { - struct page *page = sio->bvec[p].bv_page; + struct folio *folio = page_folio(sio->bvec[p].bv_page); - unlock_page(page); + folio_unlock(folio); } pr_alert_ratelimited("Read-error on swap-device\n"); }