Skip to content

Commit 562c85c

Browse files
Yalin WangRussell King
authored andcommitted
ARM: 8168/1: extend __init_end to a page align address
This patch changes the __init_end address to a page align address, so that free_initmem() can free the whole .init section, because if the end address is not page aligned, it will round down to a page align address, then the tail unligned page will not be freed. Signed-off-by: wang <yalin.wang2010@gmail.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent e16343c commit 562c85c

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎arch/arm/kernel/vmlinux.lds.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ SECTIONS
219219
__data_loc = ALIGN(4); /* location in binary */
220220
. = PAGE_OFFSET + TEXT_OFFSET;
221221
#else
222-
__init_end = .;
223222
. = ALIGN(THREAD_SIZE);
223+
__init_end = .;
224224
__data_loc = .;
225225
#endif
226226

‎arch/arm64/kernel/vmlinux.lds.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ SECTIONS
9797

9898
PERCPU_SECTION(64)
9999

100+
. = ALIGN(PAGE_SIZE);
100101
__init_end = .;
101102

102-
. = ALIGN(PAGE_SIZE);
103103
_data = .;
104104
_sdata = .;
105105
RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)

‎include/asm-generic/vmlinux.lds.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
* }
4141
*
4242
* [__init_begin, __init_end] is the init section that may be freed after init
43+
* // __init_begin and __init_end should be page aligned, so that we can
44+
* // free the whole .init memory
4345
* [_stext, _etext] is the text section
4446
* [_sdata, _edata] is the data section
4547
*

0 commit comments

Comments
 (0)