From 5c8168d51412a11ce524041c48e28159997c685c Mon Sep 17 00:00:00 2001 From: Ze Zuo Date: Mon, 17 Nov 2025 09:21:05 +0800 Subject: [PATCH 1/2] mm: fix shmem build errors with CONFIG_SWAP disable Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID6RU3 -------------------------------- Fix kernel build errors when CONFIG_SWAP is not enabled: 1. include/linux/migrate.h:102 - syntax error in stub function. 2. mm/shmem.c:1699 - function signature mismatch in swap_cluster_readahead(). Adjust the stub implementation of swap_cluster_readahead() to match the actual function signature (4 parameters), ensuring consistent function prototypes when CONFIG_SWAP is disabled. Fixes: ed205f43c85f ("mm: convert swap_cluster_readahead and swap_vma_readahead to return a folio") Signed-off-by: Ze Zuo --- mm/swap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/swap.h b/mm/swap.h index f4a557a753e2..d27ebaba6ab7 100644 --- a/mm/swap.h +++ b/mm/swap.h @@ -107,8 +107,8 @@ static inline void show_swap_cache_info(void) { } -static inline struct folio *swap_cluster_readahead(swp_entry_t entry, - gfp_t gfp_mask, struct vm_fault *vmf) +struct folio *swap_cluster_readahead(swp_entry_t entry, gfp_t flag, + struct mempolicy *mpol, pgoff_t ilx) { return NULL; } -- Gitee From c6f2b2da7803aa997de48d1a5026bb1ff3c7117c Mon Sep 17 00:00:00 2001 From: Ze Zuo Date: Mon, 17 Nov 2025 09:21:06 +0800 Subject: [PATCH 2/2] mm: fix nr_pages counting for folio in task_numa_fault Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IC991N -------------------------------- Fix the page counting issue in task_numa_fault() call for folio-based NUMA fault handling. Change the page count parameter from 1 to nr_pages to correctly account for the actual number of pages in the folio involved in the NUMA fault. Fixes: 3bfa35ccde9e ("mm/numa: no task_numa_fault() call if PTE is changed") Signed-off-by: Ze Zuo --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index cafb6a3a66a4..5e677c1c8d24 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5606,7 +5606,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) if (migrate_misplaced_folio(folio, vma, target_nid)) { nid = target_nid; flags |= TNF_MIGRATED; - task_numa_fault(last_cpupid, nid, 1, flags); + task_numa_fault(last_cpupid, nid, nr_pages, flags); return 0; } @@ -5633,7 +5633,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf) pte_unmap_unlock(vmf->pte, vmf->ptl); if (nid != NUMA_NO_NODE) - task_numa_fault(last_cpupid, nid, 1, flags); + task_numa_fault(last_cpupid, nid, nr_pages, flags); return 0; } -- Gitee