Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5605425rwp; Mon, 17 Jul 2023 06:55:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlHRirQfzJr/ia4OPJTE7s9+rLBUudpTPtKdFefxY4s90fN8KgYSaFlDlEdBXNnjpikVVknn X-Received: by 2002:a17:90b:e8a:b0:25e:a8ab:9157 with SMTP id fv10-20020a17090b0e8a00b0025ea8ab9157mr10269834pjb.22.1689602109184; Mon, 17 Jul 2023 06:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689602109; cv=none; d=google.com; s=arc-20160816; b=TfPrjdZBUT4xq2XOIorAPXs1A4G/j14b3pVWViX3FgDXMPUIsuWU4hSVL43mrUHSBo Z2907E9bsAnj+1h2yk+ZMyvquOze9/jVj5FTAgWG7VeztHPyI0qL5dHf6mzK0UMR866z sMk6bJE3qVRFEuhEaffKrrXeZ0QrQVk8womKHzHTYahzRZwr45uEmYq/A2i1M5dh3+6u dJ7TYA4zl/7Nsz+X88Di8DUvaWPAL8t033Ml496A1kHPcqDrxX2ZOkaYGTTTTTq/Ny30 UHvdnyQKAn6m43+WsPBtoXlKN+GP+hMtJvH/0mmlmG8R50V4DSQBddFAM2Jm6pxQLp4v kMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IYxz/hwKzYk9uuwe3O6nxmJnxJXAWQADQD0MlDZJ4Kw=; fh=VDvXH+NlXsy4uKRcyz6yvnpRC6UQTLJqNZtREhJ4J58=; b=jOlj2Jjql2N5F5tjk1hNF4xfhFJf2Hf0Vc4b6xP0ZfeGbgfMf1PaVZhe+7F51ptjo9 yp/ZH5ycXOBkvlax0gaoS37WyCcE6cE++NM9TD9zfXFo33hEkmhUturlkOCjjarbKUhm VsffipZL4dTNDNrmK0y+/C/AQeE2yOGOOsVinFs4F1dB9uCKwrbOl7OIHD/QskHpah0V 3omI9cjF1VnMhSeNa4uaNjjjF1h4og6INWT4h1vpblxYrhZT5x3KFG0jCwPDPlcgkUzt Pz27FzdoXzVBuzkqYuubX0gyF1bKs0MlQUrHFW09DbfBYkzd/OTpDr4gYQgOFEz5d/fW FdcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a17090b070a00b00262fa96d9e6si5680185pjz.142.2023.07.17.06.54.55; Mon, 17 Jul 2023 06:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231626AbjGQN1P (ORCPT + 99 others); Mon, 17 Jul 2023 09:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231623AbjGQN07 (ORCPT ); Mon, 17 Jul 2023 09:26:59 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E186CC for ; Mon, 17 Jul 2023 06:26:37 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R4N9z6YCzzrRmJ; Mon, 17 Jul 2023 21:25:27 +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; Mon, 17 Jul 2023 21:26:09 +0800 From: Peng Zhang To: , CC: , , , , , ZhangPeng Subject: [PATCH 1/6] mm/page_io: use a folio in __end_swap_bio_read() Date: Mon, 17 Jul 2023 21:25:57 +0800 Message-ID: <20230717132602.2202147-2-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230717132602.2202147-1-zhangpeng362@huawei.com> References: <20230717132602.2202147-1-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: ZhangPeng Saves three 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 684cd3c7b59b..ebf431e5f538 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -58,18 +58,18 @@ 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 = page_folio(bio_first_page_all(bio)); if (bio->bi_status) { - SetPageError(page); - ClearPageUptodate(page); + folio_set_error(folio); + folio_clear_uptodate(folio); 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) -- 2.25.1