Skip to content

Commit ee97347

Browse files
hbathinitorvalds
authored andcommitted
powerpc/fadump: opt out from freeing pages on cma activation failure
With commit a4e92ce ("powerpc/fadump: Reservationless firmware assisted dump"), Linux kernel's Contiguous Memory Allocator (CMA) based reservation was introduced in fadump. That change was aimed at using CMA to let applications utilize the memory reserved for fadump while blocking it from being used for kernel pages. The assumption was, even if CMA activation fails for whatever reason, the memory still remains reserved to avoid it from being used for kernel pages. But commit 072355c ("mm/cma: expose all pages to the buddy if activation of an area fails") breaks this assumption as it started exposing all pages to buddy allocator on CMA activation failure. It led to warning messages like below while running crash-utility on vmcore of a kernel having above two commits: crash: seek error: kernel virtual address: <from reserved region> To fix this problem, opt out from exposing pages to buddy allocator on CMA activation failure for fadump reserved memory. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Hari Bathini <[email protected]> Acked-by: David Hildenbrand <[email protected]> Acked-by: Michael Ellerman <[email protected]> Cc: Mahesh Salgaonkar <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: Sourabh Jain <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 27d121d commit ee97347

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/powerpc/kernel/fadump.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ static int __init fadump_cma_init(void)
112112
return 1;
113113
}
114114

115+
/*
116+
* If CMA activation fails, keep the pages reserved, instead of
117+
* exposing them to buddy allocator. Same as 'fadump=nocma' case.
118+
*/
119+
cma_reserve_pages_on_error(fadump_cma);
120+
115121
/*
116122
* So we now have successfully initialized cma area for fadump.
117123
*/

0 commit comments

Comments
 (0)