From 158ef88409fb7dc9177cf0311b629630df8ffa1f Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Oct 27 2015 23:54:24 +0000 Subject: CMA memory patch to fix aarch64 builder lockups --- diff --git a/kernel.spec b/kernel.spec index 75751be..fbf887c 100644 --- a/kernel.spec +++ b/kernel.spec @@ -502,13 +502,15 @@ Patch455: usb-make-xhci-platform-driver-use-64-bit-or-32-bit-D.patch Patch456: arm64-acpi-drop-expert-patch.patch -Patch457: ARM-tegra-usb-no-reset.patch +Patch457: showmem-cma-correct-reserved-memory-calculation.patch -Patch458: regulator-axp20x-module-alias.patch +Patch458: ARM-tegra-usb-no-reset.patch -Patch459: regulator-anatop-module-alias.patch +Patch459: regulator-axp20x-module-alias.patch -Patch460: ARM-dts-Add-am335x-bonegreen.patch +Patch460: regulator-anatop-module-alias.patch + +Patch461: ARM-dts-Add-am335x-bonegreen.patch Patch463: arm-i.MX6-Utilite-device-dtb.patch @@ -2061,6 +2063,9 @@ fi # # %changelog +* Tue Oct 27 2015 Peter Robinson +- CMA memory patch to fix aarch64 builder lockups + * Mon Oct 26 2015 Justin M. Forbes - 4.2.5-300 - Linux v4.2.5 diff --git a/showmem-cma-correct-reserved-memory-calculation.patch b/showmem-cma-correct-reserved-memory-calculation.patch new file mode 100644 index 0000000..c22a849 --- /dev/null +++ b/showmem-cma-correct-reserved-memory-calculation.patch @@ -0,0 +1,61 @@ +From 3a83eda52f34b97168b70098ef0e34dbcaeaaf8f Mon Sep 17 00:00:00 2001 +From: Vishnu Pratap Singh +Date: Tue, 25 Aug 2015 00:04:44 +0000 +Subject: lib/show_mem.c: correct reserved memory calculation + +CMA reserved memory is not part of total reserved memory. +Currently when we print the total reserve memory it considers +cma as part of reserve memory and do minus of totalcma_pages +from reserved, which is wrong. In cases where total reserved +is less than cma reserved we will get negative values & while +printing we print as unsigned and we will get a very large value. + +Below is the show mem output on X86 ubuntu based system where +CMA reserved is 100MB (25600 pages) & total reserved is ~40MB(10316 pages). +And reserve memory shows a large value because of this bug. + +Before: +[ 127.066430] 898908 pages RAM +[ 127.066432] 671682 pages HighMem/MovableOnly +[ 127.066434] 4294952012 pages reserved +[ 127.066436] 25600 pages cma reserved + +After: +[ 44.663129] 898908 pages RAM +[ 44.663130] 671682 pages HighMem/MovableOnly +[ 44.663130] 10316 pages reserved +[ 44.663131] 25600 pages cma reserved + +Signed-off-by: Vishnu Pratap Singh +Cc: Michal Nazarewicz +Cc: Marek Szyprowski +Cc: Joonsoo Kim +Cc: Laurent Pinchart +Cc: Sasha Levin +Cc: Danesh Petigara +Cc: Laura Abbott +Signed-off-by: Andrew Morton +--- + lib/show_mem.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/lib/show_mem.c b/lib/show_mem.c +index adc98e18..1feed6a 100644 +--- a/lib/show_mem.c ++++ b/lib/show_mem.c +@@ -38,11 +38,9 @@ void show_mem(unsigned int filter) + + printk("%lu pages RAM\n", total); + printk("%lu pages HighMem/MovableOnly\n", highmem); ++ printk("%lu pages reserved\n", reserved); + #ifdef CONFIG_CMA +- printk("%lu pages reserved\n", (reserved - totalcma_pages)); + printk("%lu pages cma reserved\n", totalcma_pages); +-#else +- printk("%lu pages reserved\n", reserved); + #endif + #ifdef CONFIG_QUICKLIST + printk("%lu pages in pagetable cache\n", +-- +cgit v0.11.2 +