Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/khugepaged: remove unnecessary goto 'skip' label

Patch series "mm/khugepaged: cleanups and scan limit fix", v3.

This series contains several cleanups for mm/khugepaged.c to improve code
readability and type safety, and one functional fix to ensure
khugepaged_scan_mm_slot() correctly accounts for small VMAs towards scan
limit.


This patch (of 4):

Replace goto skip with actual logic for better code readability.

No functional change.

Link: https://lkml.kernel.org/r/20260118192253.9263-4-shivankg@amd.com
Link: https://lkml.kernel.org/r/20260118192253.9263-6-shivankg@amd.com
Signed-off-by: Shivank Garg <shivankg@amd.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Reviewed-by: Lance Yang <lance.yang@linux.dev>
Tested-by: Nico Pache <npache@redhat.com>
Reviewed-by: Nico Pache <npache@redhat.com>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Wei Yang <richard.weiyang@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Shivank Garg and committed by
Andrew Morton
7832e4d5 f84b65b0

+4 -3
+4 -3
mm/khugepaged.c
··· 2442 2442 break; 2443 2443 } 2444 2444 if (!thp_vma_allowable_order(vma, vma->vm_flags, TVA_KHUGEPAGED, PMD_ORDER)) { 2445 - skip: 2446 2445 progress++; 2447 2446 continue; 2448 2447 } 2449 2448 hstart = round_up(vma->vm_start, HPAGE_PMD_SIZE); 2450 2449 hend = round_down(vma->vm_end, HPAGE_PMD_SIZE); 2451 - if (khugepaged_scan.address > hend) 2452 - goto skip; 2450 + if (khugepaged_scan.address > hend) { 2451 + progress++; 2452 + continue; 2453 + } 2453 2454 if (khugepaged_scan.address < hstart) 2454 2455 khugepaged_scan.address = hstart; 2455 2456 VM_BUG_ON(khugepaged_scan.address & ~HPAGE_PMD_MASK);