From patchwork Thu Mar 2 11:58:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13157120 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 9D5B6C7EE30 for ; Thu, 2 Mar 2023 11:37:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1397F6B0071; Thu, 2 Mar 2023 06:37:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C38A6B0075; Thu, 2 Mar 2023 06:37:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC0596B0074; Thu, 2 Mar 2023 06:37:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DDEF16B0071 for ; Thu, 2 Mar 2023 06:37:49 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B09EEAB782 for ; Thu, 2 Mar 2023 11:37:49 +0000 (UTC) X-FDA: 80523758658.07.5216578 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 5AABE4000D for ; Thu, 2 Mar 2023 11:37:46 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677757068; 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=RV96LlTMyS60efsCIJSLjMlPFR7so6yuJxIK9Rv9A8E=; b=GOGYk/GJCyYYYmaGQyhedJIK8yMZwD8t8To8W4kgOW2gLnhk9uTkeNz68cWJNI2I4vOrQ4 P5aJ7scai7P3VsZiZVq7MsiqNTa4giVG/cAb+I74Gvhve/WtEQL3ldXHYG9CC2sM76Jxra FRG0GZ6N5pWIJo+VhHIepU/yKbPNf6Y= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677757068; a=rsa-sha256; cv=none; b=rYd4uJ/l4+PeMCaHDqhgaJ2B8ASVpo3jVElUHs4l8m1HoN8MXQS3i3erkw0J+cctDtLbCI 5NnL1mOkclGGvrtYkURDMHvTF8Ca6iWZ0k7HS1Gq2M1fk8pnAatmB6XU1DxQVzWz4Mw0LO P/ODT/cL7d5TgkfuAvOeb4QG+OujUP8= Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PS8CX2XSLzSkTR; Thu, 2 Mar 2023 19:34:48 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 2 Mar 2023 19:37:43 +0800 From: Kefeng Wang To: CC: , , "Matthew Wilcox (Oracle)" , Kefeng Wang Subject: [PATCH v2 6/7] mm: memory: use folio_throttle_swaprate() in do_cow_fault() Date: Thu, 2 Mar 2023 19:58:34 +0800 Message-ID: <20230302115835.105364-7-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230302115835.105364-1-wangkefeng.wang@huawei.com> References: <20230302115835.105364-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 5AABE4000D X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: 5m1mdgny8m1tzgr19wozhay5kifqfuiu X-HE-Tag: 1677757066-869381 X-HE-Meta: U2FsdGVkX18XXkV+SJ4FqqJBA/QgyooZiZZDM9x9VnR/YixhOPvobb+yzDePWZofVfrS68ML9BRl2Z5s1Uog1e7aDPGM7HElQn4JEJFuzmuBKdcPIQh5lh5H3eR5nJu+biNyY4GrSEMbXjbsqYSeX/uCxw9OxWoh3LoU021l8Cqm5GaWSUBAaqASWNcIYJ8u2U7DfgwxcaOAiyFy+ADUU2kWJYenohWDajaZECbEhXlLn+OiZUbqf5lQyVaxpRTzFWfZYXivl6iWaje9t065K9V4I7xl/y5zjByXFwi8+ZD4+EGcaf1LB4u7yM+M3hSlNSJBtYAnnPxvue5sHkGJXtDgR2ckh8SSE47x/6u3qoiy17WXQ5bKhvIpeSL62OjF6uvyqiDtfwOOnW9hTtEO2oNFPZHsheIoxf+h7Xhul8LJXyToJgUgT6bnHJfdqYxuzBXql+nq5y5LGG7qd0u6GDDSwSlR+zXyYtrEpJJ2UTPoi59gANmU4aWEo60dnYkpHV4I+J3aX0ODh3tlqJ8UPwnTkH7GyeWBVB6CdbJTC6pYNQ+03w7WB5WKBgDXv857qb1qq/1Zee3TnAnoeH7Ij/ytI4T/3Yud2yfUdcWErkbQU40ljFGZtj/qXWI18KAiYwi+FbwK74ffuu47afT3CPppBqte8PJq1TsuAnPbU69iNnGypAtIQL9lsEEJUVz/AYGTb2RPCqFxz4BJUKdzMEBUCTdVcrdBRr1ixb+ZEqKL35wlryfTD+smYOCaH5t/hOUjWZK27yJFX6K4OtecSz2MwRh/EInKIfuDZfRy5ehUSL6yMkGey0nifCEceaAIwPhtr7jtxbYwoIOXtZW6NgiycMWVO0WooO+hfz8pTbaI2XY5L1+jNYS6fzvpQtk4OHiBfUFPVoS29jqiuHvZUGmlK0teEu8p8d3GaIFKkDK3EE6XUttAQIt+Djdt6fTBr0m1AOy6XMItFaNgy0Z N63MWEb4 Zaz63cvBdOxRGBf4+HALDSs68JBysqW211RkxE+vIabnw4U1iHWzaN8UpHUW1XOVvprym73bp8YXAZlwWyufh05TpWlsOG0IiSsWVabgnkGH8XbYZ3nQh+ToOjR8z7GqafopBigPneFI9auXrUODySgnZ3i2AXxqUQce7sxhz5uQr42X9cJJpMJk6L+3wb/kjYpcGCWJtd0PBw6ivXv0cCd/0fg== 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: Directly use folio_throttle_swaprate() instead of cgroup_throttle_swaprate(). Signed-off-by: Kefeng Wang --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 841737d5690d..b24c618d7348 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4527,7 +4527,7 @@ static vm_fault_t do_cow_fault(struct vm_fault *vmf) put_page(vmf->cow_page); return VM_FAULT_OOM; } - cgroup_throttle_swaprate(vmf->cow_page, GFP_KERNEL); + folio_throttle_swaprate(page_folio(vmf->cow_page), GFP_KERNEL); ret = __do_fault(vmf); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))