Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5633341rwp; Mon, 17 Jul 2023 07:15:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlEp9gRwkb+uvpu6+3fDcFB8Ic4ZD1K5dnmqmxzgH/1gFFnSa9ecmRO8kLoqZYSSJX3jwSg7 X-Received: by 2002:a17:90a:b297:b0:263:5333:ca26 with SMTP id c23-20020a17090ab29700b002635333ca26mr9933323pjr.29.1689603348128; Mon, 17 Jul 2023 07:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689603348; cv=none; d=google.com; s=arc-20160816; b=cNgeuf+KlOeaHClrWqWXuyfwfC86xUv8JnzJGYP4nc/olBsDuu6f4HbveDdRM+89T/ BPKfXNIS1UsBqp6t1K6me8VEwCPlC980GydouqaXPgEXAn2/KnSE9R7onoXNz821vi80 ewtk0cGJDZrs6OoSQy5XwKGxRNO7AL0ddo8SQSOZwaxsKltESMWJUT6GEoBBe1aRJipV jgT2ESdYYtACSHFOe6S6y0o2v4qDgMGyVM5cO87tsxVS4KGSEBsZb+SGhtEu7OekWNnL oStwoOVqBV7CVKvlNcUnUth/+oZV6PwMLzCMqnp+RvYRWmsHctyJNPcGzXeMjJiLu7JK ZZTQ== 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=V7vHzbTqeW7JilGe8vNV9ImKVDt34goczj++N2ksBns=; fh=VDvXH+NlXsy4uKRcyz6yvnpRC6UQTLJqNZtREhJ4J58=; b=doo6C/jDktqcRoe2CHRaHE8GBAj5zPHzshcYxU8PIpaPcqPZntUsAkr8kDuweM9+Gg tggDX6lN3ZImj9kghEoQzXqOgvHuKR48Cru2XdJBy6exwV6MFSV3OQ+qOtgU71bX3xtk SCL703mTadGF7NpFgnH9wj2cpFMwWPuBGWE8uU6dcvweYMaKNmTe58xU+rG2ZsaEwvsT DaytWyyUtkQJ4xu850HsTTh6molVFyB1xc0mvycR7AA5TGyMElgd3DfL4PE5U5yGYfY6 BVjyMdSSxiIlXqKF42gCfTgCdEZaPNqyuV+bJo9tQmwZRqzmxhfgwh7s5ccjnBQnNXag o56Q== 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 gl20-20020a17090b121400b00262e6b05c92si5700237pjb.150.2023.07.17.07.15.35; Mon, 17 Jul 2023 07:15:48 -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 S229525AbjGQN13 (ORCPT + 99 others); Mon, 17 Jul 2023 09:27:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231518AbjGQN06 (ORCPT ); Mon, 17 Jul 2023 09:26:58 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F42C2115 for ; Mon, 17 Jul 2023 06:26:36 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R4N810KhdzLngj; Mon, 17 Jul 2023 21:23: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; Mon, 17 Jul 2023 21:26:09 +0800 From: Peng Zhang To: , CC: , , , , , ZhangPeng Subject: [PATCH 2/6] mm/page_io: use a folio in sio_read_complete() Date: Mon, 17 Jul 2023 21:25:58 +0800 Message-ID: <20230717132602.2202147-3-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,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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index ebf431e5f538..438d0c7c2194 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -406,19 +406,19 @@ 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); - SetPageError(page); - ClearPageUptodate(page); - unlock_page(page); + folio_set_error(folio); + folio_clear_uptodate(folio); + folio_unlock(folio); } pr_alert_ratelimited("Read-error on swap-device\n"); } -- 2.25.1