Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5606190rwp; Mon, 17 Jul 2023 06:56:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlGxIB6z4kmtwhcFESDOKUknWnpmnsIkVR6Jj1/nuQyA2cbRYqXAMDSDXcutxBqo1JGmDit3 X-Received: by 2002:a17:906:20dd:b0:98d:5293:55f7 with SMTP id c29-20020a17090620dd00b0098d529355f7mr11032413ejc.6.1689602162772; Mon, 17 Jul 2023 06:56:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689602162; cv=none; d=google.com; s=arc-20160816; b=lJq/kiRmDDySLh+wbgB5uYk9S3IY9N9wUqLE4hlbVGylVWJ0d92XH8gjU2Kblwllls kgWLpe3knTLj/UqhviqrPrdpvShs1pF0IM0R8CurLQflr8tm2TcPss8g5aGxp6C+fGVD MBVbigUAdodQE+cKhRUTfAlcm8X3Pbv6Ajqjr/wZAr0k3GL3PtQAP7mB9mQTAF3srd1V wGBa940Flp9hJmU6xtZFxME3vpJS4hiiMe/FEyYjz47p+2vJ1c/Tqna9pf2oi4g3RdT0 J70aDJHmtgDX6/DWtQZCgAbA5+3NCmfJYzlk2C145bSfKWyWsU/7KcIPD5dc1O+ZO6VF mKkw== 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=4sSpnbOCGI0f8tYl5oWsmEUitL7U2pCM9ujFaXA0EZk=; fh=VDvXH+NlXsy4uKRcyz6yvnpRC6UQTLJqNZtREhJ4J58=; b=tOUt43JnYLtElOiSA80/FQBBv7OPZ9JTzu7JmubCnabgI1wI/WqKAg/jCkO1mzbOWt 6mmk6ij6ZWgl1TJuQL/4ipktjmPJFXcDkshg16s+AgVnlumwc2sf4cWnuRXlRCSbflmV G1e+wkjyaMG5x9yJ5G10NIuBvpC/OCrOIYyhphrZBIAsjl7KiJT3f9QJsR1mHveBio+1 ebcHJPjMEi5HqkLktzsVnSO+/NpGo0aYEl3NG6rRlMEGR+0sglFiD2uccXd6Krx/Hypi xn5mUGfBXnC8le89KfmPZTbAhcZ1m9V5pKxPW6Xn+jJ8LIvUaL21qTZ6682pBIX+ynF8 SUlQ== 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 a3-20020a170906368300b00993150e55desi13273637ejc.291.2023.07.17.06.55.37; Mon, 17 Jul 2023 06:56:02 -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 S231704AbjGQN1f (ORCPT + 99 others); Mon, 17 Jul 2023 09:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbjGQN1B (ORCPT ); Mon, 17 Jul 2023 09:27:01 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A330619B2 for ; Mon, 17 Jul 2023 06:26:40 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4R4NB406HGz18Lnb; Mon, 17 Jul 2023 21:25:31 +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:12 +0800 From: Peng Zhang To: , CC: , , , , , ZhangPeng Subject: [PATCH 6/6] mm/page_io: convert bio_associate_blkg_from_page() to take in a folio Date: Mon, 17 Jul 2023 21:26:02 +0800 Message-ID: <20230717132602.2202147-7-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 Convert bio_associate_blkg_from_page() to take in a folio. We can remove two implicit calls to compound_head() by taking in a folio. 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 66e8403bf96e..3c1fede46bd9 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -218,12 +218,12 @@ static inline void count_swpout_vm_event(struct folio *folio) } #if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) -static void bio_associate_blkg_from_page(struct bio *bio, struct page *page) +static void bio_associate_blkg_from_page(struct bio *bio, struct folio *folio) { struct cgroup_subsys_state *css; struct mem_cgroup *memcg; - memcg = page_memcg(page); + memcg = folio_memcg(folio); if (!memcg) return; @@ -233,7 +233,7 @@ static void bio_associate_blkg_from_page(struct bio *bio, struct page *page) rcu_read_unlock(); } #else -#define bio_associate_blkg_from_page(bio, page) do { } while (0) +#define bio_associate_blkg_from_page(bio, folio) do { } while (0) #endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */ struct swap_iocb { @@ -341,7 +341,7 @@ static void swap_writepage_bdev_sync(struct page *page, bio.bi_iter.bi_sector = swap_page_sector(page); __bio_add_page(&bio, page, thp_size(page), 0); - bio_associate_blkg_from_page(&bio, page); + bio_associate_blkg_from_page(&bio, folio); count_swpout_vm_event(folio); folio_start_writeback(folio); @@ -364,7 +364,7 @@ static void swap_writepage_bdev_async(struct page *page, bio->bi_end_io = end_swap_bio_write; __bio_add_page(bio, page, thp_size(page), 0); - bio_associate_blkg_from_page(bio, page); + bio_associate_blkg_from_page(bio, folio); count_swpout_vm_event(folio); folio_start_writeback(folio); folio_unlock(folio); -- 2.25.1