From patchwork Thu Jul 20 13:01:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Zhang X-Patchwork-Id: 13320498 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 ED185EB64DA for ; Thu, 20 Jul 2023 13:03:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84797280107; Thu, 20 Jul 2023 09:03:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F78028004C; Thu, 20 Jul 2023 09:03:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BF4B280107; Thu, 20 Jul 2023 09:03:57 -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 5A92728004C for ; Thu, 20 Jul 2023 09:03:57 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 3374E40245 for ; Thu, 20 Jul 2023 13:03:57 +0000 (UTC) X-FDA: 81032007714.19.CFDCDB6 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf03.hostedemail.com (Postfix) with ESMTP id EA19920179 for ; Thu, 20 Jul 2023 13:02:23 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 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=1689858144; 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=UIF1/RDQxGiWQWtgFqv/0f1S/VSRVZSzWjrR6f+CKz4=; b=kiGg4374bz2rOVXsDX1nUkcMJsdHFfpEzPUPzOWOTGzJO14twL4mvZuqi6Kq2nxZzkGknw wy3pUB+mjzPNcXngt6dD2W2ZFq2stLdY7kFJp4jItdr2qLMe5ql0/d+vYjjlKnHU2j7/r8 3o0yTUIKFSMahFC/FwSTjJ4kEUGUdiw= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf03.hostedemail.com: domain of zhangpeng362@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=zhangpeng362@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689858145; a=rsa-sha256; cv=none; b=t/+K6O/R3fCnHOGVxPKFFjjeFN1lIEk94Rg4MfDyxiqOOq1GzjIHmrxsfRXmP+oEU9JRT3 cYT2dYtNWYVN+bXu7RhgK8UeLLzLUUZAbBxZss0BGZb3upq+pmxiRpD9VDku+xedq8KzvE 1kfdGZ0N3Kn+CDqHZz2EfklOLLxSGFg= Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R6CS30yXYzNmVt; Thu, 20 Jul 2023 20:58:59 +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; Thu, 20 Jul 2023 21:02:18 +0800 From: Peng Zhang To: , , CC: , , , , , ZhangPeng Subject: [PATCH v3 06/10] mm/page_io: use a folio in sio_read_complete() Date: Thu, 20 Jul 2023 21:01:43 +0800 Message-ID: <20230720130147.4071649-7-zhangpeng362@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230720130147.4071649-1-zhangpeng362@huawei.com> References: <20230720130147.4071649-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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: EA19920179 X-Stat-Signature: hcpyk3roozb34p3awbm6kywed4asn87g X-Rspam-User: X-HE-Tag: 1689858143-487641 X-HE-Meta: U2FsdGVkX19gilUbu7ULKCLCDGWMZ1WUJn8RQPQN9rQNgVqTcJEPhd5FKU3+op7UMYRjymdUZc5S/Owf9TluGCtyiJbKmuG6k8JwROvwvwr/nByIBZsvVT5QpIfJfb0vaU3r25S0FCoNBp+Sbt8RUUdSKtNdjGsfbLNaWYTFHiRyygaTbdgu5sC33OGpJGbvL0mr+Wz74vqpXSaRaswHcGgQthQcvHpd5oiGMKhqqdsUCKRDSSCUTYr2erdncnU6Xl5xMqfFlAcDGZIOGLXq6E3KzGriU+yoJDsuc8COA6/U5KqqMiGELZBXZeBSju+YhQo+466770D1WxzNtjODWb3luVj7XTuitXVjl11GWUaORsZz3XLMAjNZ4DxQqoOxTfj1y8PAPtynva9Rh7Knj4aH2xPl5lT5coj6al8K0nCSSpCvQq7aX/Ai7r5YtG3EhswFUFVtndxeUbe2fHhQl6HFFeHpZKHNSisUP58H+E8FjwGVHZ9rp30VcFa+2PC8ajRDfHBmIr53+v6smz4jkZ9W4kp0YRFnPWTdwHD+u006njvbJa69xTlEm1NKl7wIZ5MBkK3hEH+QBG21fPUZoyQf8MUEen+JM1Dg+cxCPmQq1xhPQFoBQHkLlYuH5vo78IkV142F0n3OYCrjgaWFmCKcjo0vIOeJLh27gWnKVDN76gfDCwJPkOSO0jy9kAgI3CGJqyagDsqHBOIWgcPrTMmyRbCMKH05S9F2ch+t/8SoIGQyMlNsH739jt7BKcyJe6PVrdgKrtOeOn9ZqK1vbSPjxRBTBbaayUMCpoD1KzdeqPadbiUboKcWgEZYN4K5+xwpmOVrA/K9g9oI4OuKg9kP6BplhQWjPLKXyuu7aii7+XcSjN/r+pZbY2hv56aClvs+6+PNw+rak9Vq8s8SJVjuQe993a2rSmGBYmTKE2mcJxN2u9iyyizxyWQ3SNKmQcetucPhjjdNVkchmhG C6L4gd2V NZxfUt0ybIKiS3+BzuMAJBZPD8rbn3Iqv4k+cjiv1CAImjqNDM4jwVsfkpDkjuwxLmtZuHFA57WNkW1GJ+bu7ZisQLnRPol6IAJry3+CQFw8/TeF7ptwusvWP1vlFV/3trgDmslMfQSCB3pibU0Uc3Vpq2va1Z1kuR5P6T4HMEmne2V1VsG0Alusbp7XhnZ169FDi 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 3b97289153f9..7e7a9f67b9ad 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"); }