Thread (24 messages) read the whole thread 24 messages, 6 authors, 2025-12-21

Re: [PATCH 2/3] mm/khugepaged: use enum scan_result for result variables

From: Garg, Shivank <hidden>
Date: 2025-12-16 16:20:38
Also in: linux-mm, lkml


On 12/16/2025 9:08 PM, Zi Yan wrote:
On 16 Dec 2025, at 6:11, Shivank Garg wrote:
quoted
@@ -547,7 +547,8 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
The return type could be changed too.
quoted
 	struct folio *folio = NULL;
 	unsigned long addr = start_addr;
 	pte_t *_pte;
-	int none_or_zero = 0, shared = 0, result = SCAN_FAIL, referenced = 0;
+	int none_or_zero = 0, shared = 0, referenced = 0;
+	enum scan_result result = SCAN_FAIL;

 	for (_pte = pte; _pte < pte + HPAGE_PMD_NR;
 	     _pte++, addr += PAGE_SIZE) {
@@ -786,7 +787,7 @@ static int __collapse_huge_page_copy(pte_t *pte, struct folio *folio,
Ditto.
quoted
 		struct list_head *compound_pagelist)
 {
quoted
-- 
In addition, the return types of find_pmd_or_thp_or_none(),
hugepage_vma_revalidate(), alloc_charge_folio(), and check_pmd_state() need to be changed to enum scan_result too.
Hi Zi,

Thanks for the review and suggestions.
I'll update the return types and send V2.

Thanks,
Shivank
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help