Commit d1fae3ae authored by Jaewon Kim's avatar Jaewon Kim Committed by jaewon31.kim@samsung.com
Browse files

FROMLIST: memblock: track kernel size on memsize



Some memory regions are already being tracked by previous patches. But
there are many memory allocations from memblock and frees to memblock
during the boot time.

This patch tracks the memblock size used for the common kernel. To to
this, tracking memblock size is disabled for some memory handling logics
like early param, device tree, and default cma size.

For precise kernel size, this patch counts not actually freed size to
buddy at boot time, and does not count freed size from ramdisk and init
section.

Additionally this patch does one important thing. This patch blocks
memblock_add_range of memblock_remove_range not to update memsize if
free pages were already released to the buddy allocator.

This is an example. The kernel size is newly added by this patch.

 .kernel    :  135137 KB
 .unusable  :  788073 KB
 .reusable  :  294912 KB

Bug: 340432773
Signed-off-by: default avatarJaewon Kim <jaewon31.kim@samsung.com>
Link: https://lore.kernel.org/linux-mm/20240521023957.2587005-8-jaewon31.kim@samsung.com/
Change-Id: Ice0c2aa568385490a3468f7567b4b8c083e043ec
parent 33acec22
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment