aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_ext.c
diff options
context:
space:
mode:
authorKemeng Shi <[email protected]>2023-07-14 11:47:48 +0000
committerAndrew Morton <[email protected]>2023-08-18 17:12:31 +0000
commit3c09be5a2be861d7f74b0251a8e77859b4c654cc (patch)
treef75f55f9b98747cbb94d47a54fdb28736b425872 /mm/page_ext.c
parentmm/page_ext: remove unused return value of offline_page_ext (diff)
downloadkernel-3c09be5a2be861d7f74b0251a8e77859b4c654cc.tar.gz
kernel-3c09be5a2be861d7f74b0251a8e77859b4c654cc.zip
mm/page_ext: remove rollback for untouched mem_section in online_page_ext
If init_section_page_ext failed, we only need rollback for mem_section before failed mem_section. Make rollback end point to failed mem_section to remove unnecessary rollback. As pfn += PAGES_PER_SECTION will be executed even if init_section_page_ext failed. So pfn points to mem_section after failed mem_section. Subtract one mem_section from pfn to get failed mem_section. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kemeng Shi <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/page_ext.c')
-rw-r--r--mm/page_ext.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/page_ext.c b/mm/page_ext.c
index 096451df1c87..f052397dc70f 100644
--- a/mm/page_ext.c
+++ b/mm/page_ext.c
@@ -424,6 +424,7 @@ static int __meminit online_page_ext(unsigned long start_pfn,
return 0;
/* rollback */
+ end = pfn - PAGES_PER_SECTION;
for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION)
__free_page_ext(pfn);