From patchwork Mon Dec 16 16:50:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13910075 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 F41D2E7717F for ; Mon, 16 Dec 2024 16:51:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 81A816B00B9; Mon, 16 Dec 2024 11:51:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A30C6B00BA; Mon, 16 Dec 2024 11:51:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CFC06B00BC; Mon, 16 Dec 2024 11:51:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 30B806B00B9 for ; Mon, 16 Dec 2024 11:51:48 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D3D2281256 for ; Mon, 16 Dec 2024 16:51:47 +0000 (UTC) X-FDA: 82901413518.28.052777D Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf18.hostedemail.com (Postfix) with ESMTP id CA4111C000F for ; Mon, 16 Dec 2024 16:51:32 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf18.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734367878; a=rsa-sha256; cv=none; b=y2YizJ1G0azN6VwixoF09XS/xwrabQbSsgTa+7JoAe/uIf57Vz0lUSmYUvZaY3vF9F+Yme PLc9OOK41GO+Rf75cbrqELpKUd1FjbGSuk2Kfi4gkF+JkSWuRk7S02GoJXVTFbcLGYUk8K deTA5LDtcbDJmddGEqPP+v2Ak39698Y= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf18.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734367878; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r84CPpOJKA9HTk87cXu4tnsmTbU0FSX6VXRAe09EnOY=; b=L47HzvIpLmpPvuEYW4pwlgnWwHczS97sk7GfuPlltJ2eEntiwniXq8WwCC8paWKhRSgtzm kq7WZF37DykJu0u+zI3IpKS7HbIWrfrfXq74ggD/VAp0nXTsu3BZt8UTQ1nSOZ+XL/fTTm 2mWX6vbW1FhA8YvY/B+CyY6idovDXbU= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8152F11FB; Mon, 16 Dec 2024 08:52:13 -0800 (PST) Received: from K4MQJ0H1H2.arm.com (unknown [10.163.78.212]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AC6DC3F528; Mon, 16 Dec 2024 08:51:34 -0800 (PST) From: Dev Jain To: akpm@linux-foundation.org, david@redhat.com, willy@infradead.org, kirill.shutemov@linux.intel.com Cc: ryan.roberts@arm.com, anshuman.khandual@arm.com, catalin.marinas@arm.com, cl@gentwo.org, vbabka@suse.cz, mhocko@suse.com, apopple@nvidia.com, dave.hansen@linux.intel.com, will@kernel.org, baohua@kernel.org, jack@suse.cz, srivatsa@csail.mit.edu, haowenchao22@gmail.com, hughd@google.com, aneesh.kumar@kernel.org, yang@os.amperecomputing.com, peterx@redhat.com, ioworker0@gmail.com, wangkefeng.wang@huawei.com, ziy@nvidia.com, jglisse@google.com, surenb@google.com, vishal.moola@gmail.com, zokeefe@google.com, zhengqi.arch@bytedance.com, jhubbard@nvidia.com, 21cnbao@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dev Jain Subject: [RFC PATCH 01/12] khugepaged: Rename hpage_collapse_scan_pmd() -> ptes() Date: Mon, 16 Dec 2024 22:20:54 +0530 Message-Id: <20241216165105.56185-2-dev.jain@arm.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241216165105.56185-1-dev.jain@arm.com> References: <20241216165105.56185-1-dev.jain@arm.com> MIME-Version: 1.0 X-Stat-Signature: arqao6d8uko9rj4a74msax8bz9q14owx X-Rspam-User: X-Rspamd-Queue-Id: CA4111C000F X-Rspamd-Server: rspam08 X-HE-Tag: 1734367892-112782 X-HE-Meta: U2FsdGVkX1/TTw0hQ9BBwj7+BA6uwIGmolIdmsFYPEL+0L0CAVFQzvD0Uj7pymCitrwYzvZBVzN7Pi0MX8z9CxuFLLeHzFfOh1WBu4oX/GbOXAIlLoj08tzQ+64cUvy98s1uLwF6hOXid8GsE1uUmXGGWKRXbbNP7yJGWks1nc0VJ5Sefr+WkEzeKFdOlZRjuqvszCH2t9NfLUOu9uXJYzbmPqmTaTBFnxTfJigPrRo3spE7nJyhECsFIScjblm0JizlP/vkhbe77L7RjOSTPKwkMx/nK4JJTf4zik7xrYO2j6no0gm7hiLAckIVpRvIQIsiviJrxR1ZSlgAqWynXEyVnhbIQdr7rjqdPkesYXhTUC1FSkQNNbTEyXkIYRuNcU0vHpsa4cuLKrH4nLgrd/648hIyYb6ZVEQ1vAXexTraOgj02hkYM7mSJkORDRXLUHsPXeiu9APAR6ZzO1h3NKGSnk5Fqe3SmhpMDPWV4KujWO6zcDMWXzuUDv7Msbpz4KN3gWC/qOkIgvpyjyWTbHdG26CPQ48fn3BN0Kk7DqygX0fjLdm5yvbQU1G1RCAskeJC9FTF6gd1T5Oc+HyFtuKNO//N1FfGc3eAF3XutINrDvg6/eNrn7AVXRg5k2i+cQNsx3CGDYzFGzimPjh33gaMpopBspCHfj/FcGEXDmrNNsHUDxu7AZ34olpjYY7F1bKdLVv/nVgTSz8w5Itr9NnADtaiYbASbzyXkzUlYC9ih/cYA4cqeCqvy3pfDearQc5KoSXyY56wqeUX1KOvWPOpBph9pYUOwgANzhEGcc003z8zm4gN3sR2dOfAlaBQ3vlOAt1RSVemgmbADULxxV0WBPS6WrSAimHA9ualHUPo0uKmGVuEGFMGqjkbyOyf5vnoJN0mNAHu4JPEjst5g3jc3mW2de+ckhtnKr7TFqSB0YdLUV5yPGHeYe7Hjwg4zrOHAP+fDv06Jsj73sm /tNTBalB cm33CiUtL8a+u+UkSeMcnkLYJB/g0EygcXs+PIwhSSX/6mDcpRP38kKufBb/34j2UPBxvA6SUNlk9kfAKGf22UXK5RZYwByYHqpoOokbXE0S7VoMOwM0PdCGU/s9b/yy7Ztgo5hk54p+68jQg3oY2chzwjKoAyYZDu2E/gRWIT7sVr8y3bxYTmy7Z0XBoEw0lmlCyu7g71XVESvk6A9LiRZnmT+MqJqmkNbdGhywMIa5NKWeXExr4DKNHfMulGMvvkykpfCW5ENnChQqzoyPDpvNZ2xcMkLKcRAu/MdNgUsyyHz9rHHzc3aW7Gm/S8hfb6s/tCHrABfDaXuXKEmFJZDQpgpvmcGXhK94ZNC8ffUqEVOFASQuS9KVqO1D8gYMb8uXWGuQ+mJkYO60= 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: List-Subscribe: List-Unsubscribe: Rename prior to generalizing the collapse function. Signed-off-by: Dev Jain --- mm/khugepaged.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 99dc995aac11..95643e6e5f31 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -605,7 +605,7 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, folio = page_folio(page); VM_BUG_ON_FOLIO(!folio_test_anon(folio), folio); - /* See hpage_collapse_scan_pmd(). */ + /* See hpage_collapse_scan_ptes(). */ if (folio_likely_mapped_shared(folio)) { ++shared; if (cc->is_khugepaged && @@ -991,7 +991,7 @@ static int check_pmd_still_valid(struct mm_struct *mm, /* * Bring missing pages in from swap, to complete THP collapse. - * Only done if hpage_collapse_scan_pmd believes it is worthwhile. + * Only done if hpage_collapse_scan_ptes believes it is worthwhile. * * Called and returns without pte mapped or spinlocks held. * Returns result: if not SCAN_SUCCEED, mmap_lock has been released. @@ -1263,7 +1263,7 @@ static int collapse_huge_page(struct mm_struct *mm, unsigned long address, return result; } -static int hpage_collapse_scan_pmd(struct mm_struct *mm, +static int hpage_collapse_scan_ptes(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, bool *mmap_locked, struct collapse_control *cc) @@ -2457,7 +2457,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, int *result, mmap_read_unlock(mm); } } else { - *result = hpage_collapse_scan_pmd(mm, vma, + *result = hpage_collapse_scan_ptes(mm, vma, khugepaged_scan.address, &mmap_locked, cc); } @@ -2792,7 +2792,7 @@ int madvise_collapse(struct vm_area_struct *vma, struct vm_area_struct **prev, cc); fput(file); } else { - result = hpage_collapse_scan_pmd(mm, vma, addr, + result = hpage_collapse_scan_ptes(mm, vma, addr, &mmap_locked, cc); } if (!mmap_locked)