Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5601692rwp; Mon, 17 Jul 2023 06:51:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlES0xKkeFu1nTPlC8CUbtYDW7cORacnqRTK0qsjka42Tnj1+mCcwWRiigwnwWfARerV2zWn X-Received: by 2002:a05:6a00:240d:b0:67f:2ba2:f741 with SMTP id z13-20020a056a00240d00b0067f2ba2f741mr13394374pfh.24.1689601881304; Mon, 17 Jul 2023 06:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689601881; cv=none; d=google.com; s=arc-20160816; b=Z4w46SHOBDmZgP91eogaGdEUB5ltMzGjfMizMySyd9eL7yLX4WrSN3qlktebOM3Orf sKsePqKgPSiGkfp0B7ju3VWj29TvxIrqqod2miXY7IcPsPIyp1EU3IyYnwgqszVWaSaM XjFUwKeHLP2ryaxqez8fFFZtn/cggEh4y0JPasZQNECaAzNNkk3W72mX29frZsZWjKPT n3Hu9tK5bz45mMGRtNU+wEeoZNwxggJSVDNg55w2ruPzNC1SXAOumau9R0q32ocEJIfy FkzOtE9wUsqiR2JF3SHR8nVvdD2wR3CnriXa/M+8oX1KC3OoLHGEFRmw4MRqzOcE01n8 EfXw== 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=z1m3qTju++wCcczvOgKEj14bvT/wRWlf9L7jQUe5zb0=; fh=VDvXH+NlXsy4uKRcyz6yvnpRC6UQTLJqNZtREhJ4J58=; b=F9+U5WaaUDdwL4/nQrvrxHmdCJ3KB99YhfeJ9LKgNbBeZptnkfhoBoS7mZKzu0dgTE WdRQprg+VBXM5bz/CHgcj4j5LJjyNxuN/YuWbtx/i+9bMwCO4RtOxux6XO13330O5xgo gmVNJKbu+kDNZLTH8PvS6lAFyHrq8f6z3MdxVpCLjb76ktkFdIn04nc8FtnJuZWdX1z2 iC0fI0r2+xdaO4GsBsAnv+kcGhriQ6JfcjNuVhobneNwCOkWFPVn9+aVOGbWi4GGTlCU uLlMsu3zuF6+cpjeDpSZIxzA8Cw2zDOzBo6Q1UY5g4j5FJF0nWJOz0aXGv3YLCgqqnDw WeeA== 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 z13-20020a056a001d8d00b006828982043csi11482487pfw.141.2023.07.17.06.51.08; Mon, 17 Jul 2023 06:51:21 -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 S231232AbjGQN1Z (ORCPT + 99 others); Mon, 17 Jul 2023 09:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231844AbjGQN07 (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 CE260BD 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 4R4NB16bzXzrRlh; Mon, 17 Jul 2023 21:25:29 +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:11 +0800 From: Peng Zhang To: , CC: , , , , , ZhangPeng Subject: [PATCH 4/6] mm/page_io: use a folio in swap_writepage_bdev_async() Date: Mon, 17 Jul 2023 21:26:00 +0800 Message-ID: <20230717132602.2202147-5-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 one implicit call to compound_head(). Signed-off-by: ZhangPeng --- mm/page_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index f24f814b8dca..84cc9e652451 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -355,6 +355,7 @@ static void swap_writepage_bdev_async(struct page *page, struct writeback_control *wbc, struct swap_info_struct *sis) { struct bio *bio; + struct folio *folio = page_folio(page); bio = bio_alloc(sis->bdev, 1, REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc), @@ -365,8 +366,8 @@ static void swap_writepage_bdev_async(struct page *page, bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); - set_page_writeback(page); - unlock_page(page); + folio_start_writeback(folio); + folio_unlock(folio); submit_bio(bio); } -- 2.25.1