ARM: mmu: Implement on-demand PTE allocation
Allocating PTEs for every 4K page corresponding to SDRAM upfront costs us quite a bit of memory: 1KB per 1MB or RAM. This is far from being a deal-breaker for majority of use-cases, but for builds where amount of free memory is in hundres of KBs* it becomes a real hurdle for being able to use MMU (which also means no L1 cache). Given how we really only need PTEs for a very few regions of memory dedicated from DMA buffers (Ethernet, USB, etc), changing MMU code to do on-demand section splitting can allow us to save significant amount of memory without any functionality loss. Below is a very trivial comparison of memory usages on start before and after this patch is applied. Before: barebox@ZII VF610 Development Board, Rev B:/ meminfo used: 1271584 free: 265553032 After: barebox@ZII VF610 Development Board, Rev B:/ meminfo used: 795276 free: 266024448 Tested on: - VF610 Tower Board, - VF610 ZII Development Board (Rev. C) - i.MX51 Babbage Board - i.MX7 SabreSD Board - i.MX6 ZII RDU2 Board - AT91SAM9X5-EK Board * One example of such use-case is memory testing while running purely out of SRAM Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
WIP_next-LS
master
next
stable/v2018.07
stable/v2018.09
stable/v2018.12
v2020.07.0
v2020.06.0
v2020.05.0
v2020.04.0
v2020.03.0
v2020.02.0
v2020.01.0
v2019.12.0
v2019.11.0
v2019.10.0
v2019.09.0
v2019.08.1
v2019.08.0
v2019.07.0
v2019.06.1
v2019.06.0
v2019.05.0
v2019.04.0
v2019.03.0
v2019.02.0
v2019.01.0
v2018.12.0
v2018.11.0
v2018.10.0
v2018.09.1
v2018.09.0
v2018.08.1
v2018.08.0
v2018.07.2
v2018.07.1
v2018.07.0
|
---|
|
arch/arm/cpu/mmu.c |
---|