kernel_optimize_test/arch/mips
Yaliang Wang fa3d444245 MIPS: pgalloc: fix memory leak caused by pgd_free()
[ Upstream commit 2bc5bab9a763d520937e4f3fe8df51c6a1eceb97 ]

pgd page is freed by generic implementation pgd_free() since commit
f9cb654cb5 ("asm-generic: pgalloc: provide generic pgd_free()"),
however, there are scenarios that the system uses more than one page as
the pgd table, in such cases the generic implementation pgd_free() won't
be applicable anymore. For example, when PAGE_SIZE_4KB is enabled and
MIPS_VA_BITS_48 is not enabled in a 64bit system, the macro "PGD_ORDER"
will be set as "1", which will cause allocating two pages as the pgd
table. Well, at the same time, the generic implementation pgd_free()
just free one pgd page, which will result in the memory leak.

The memory leak can be easily detected by executing shell command:
"while true; do ls > /dev/null; grep MemFree /proc/meminfo; done"

Fixes: f9cb654cb5 ("asm-generic: pgalloc: provide generic pgd_free()")
Signed-off-by: Yaliang Wang <Yaliang.Wang@windriver.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-04-08 14:40:21 +02:00
..
alchemy MIPS: alchemy: xxs1500: add gpio-au1000.h header file 2021-06-03 09:00:50 +02:00
ar7 MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
ath25 MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
ath79
bcm47xx MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA 2020-12-30 11:53:09 +01:00
bcm63xx mips: bcm63xx: add support for clk_set_parent() 2022-01-27 10:54:09 +01:00
bmips dma-direct: rename and cleanup __phys_to_dma 2020-09-11 09:14:43 +02:00
boot mips: disable branch profiling in boot/decompress.o 2021-07-20 16:05:58 +02:00
cavium-octeon MIPS: OCTEON: add put_device() after of_find_device_by_node() 2022-01-27 10:54:23 +01:00
cobalt MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
configs MIPS: Loongson64: Select SMP in Kconfig to avoid build error 2020-10-12 11:22:40 +02:00
crypto crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-05-14 09:50:13 +02:00
dec mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n 2022-04-08 14:40:20 +02:00
fw MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
generic MIPS: generic/yamon-dt: fix uninitialized variable error 2021-11-26 10:39:15 +01:00
include MIPS: pgalloc: fix memory leak caused by pgd_free() 2022-04-08 14:40:21 +02:00
ingenic MIPS: jz4740: Rename jz4740 folders to ingenic 2020-09-18 16:35:05 +02:00
jazz dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
kernel MIPS: smp: fill in sibling and core maps earlier 2022-03-19 13:44:44 +01:00
kvm KVM: MIPS: clean up redundant kvm_run parameters in assembly 2020-09-28 07:57:21 -04:00
lantiq mips: lantiq: add support for clk_set_parent() 2022-01-27 10:54:09 +01:00
lib MIPS: Fix kernel hang under FUNCTION_GRAPH_TRACER and PREEMPT_TRACER 2021-06-16 12:01:37 +02:00
loongson2ef MIPS updates for v5.10: 2020-10-16 12:40:55 -07:00
loongson32 MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
loongson64 MIPS: loongsoon64: Reserve memory below starting pfn to prevent Oops 2021-07-19 09:44:55 +02:00
math-emu
mm MIPS: c-r4k: Fix section mismatch for loongson2_sc_init 2021-03-04 11:37:38 +01:00
mti-malta MIPS: Malta: fix alignment of the devicetree buffer 2021-09-18 13:40:16 +02:00
net bpf, mips: Validate conditional branch offsets 2021-10-06 15:55:51 +02:00
netlogic MIPS updates for v5.10: 2020-10-16 12:40:55 -07:00
oprofile mips/oprofile: Fix fallthrough placement 2020-08-22 09:23:15 +02:00
pci MIPS: pci-legacy: stop using of_pci_range_to_resource 2021-05-14 09:50:39 +02:00
pic32
pistachio
power
ralink MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c 2021-06-03 09:00:50 +02:00
rb532 MIPS: RB532: fix return value of __setup handler 2022-04-08 14:40:21 +02:00
sgi-ip22
sgi-ip27 mm/sparse: cleanup the code surrounding memory_present() 2020-08-07 11:33:27 -07:00
sgi-ip30 MIPS: SGI-IP30: Move irq bits to better header files 2020-09-21 22:15:49 +02:00
sgi-ip32 MIPS updates for v5.10: 2020-10-16 12:40:55 -07:00
sibyte MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
sni MIPS: sni: Fix the build 2021-11-26 10:39:10 +01:00
tools
txx9 MIPS: replace add_memory_region with memblock 2020-10-12 12:01:36 +02:00
vdso MIPS: VDSO: Use CLANG_FLAGS instead of filtering out '--target=' 2021-03-04 11:38:26 +01:00
vr41xx
Kbuild
Kbuild.platforms MIPS: generic: Add support for Ingenic SoCs 2020-09-18 16:33:59 +02:00
Kconfig mips: fix Kconfig reference to PHYS_ADDR_T_64BIT 2022-01-27 10:54:07 +01:00
Kconfig.debug
Makefile mips: Fix non-POSIX regexp 2021-08-12 13:22:07 +02:00
Makefile.postlink