lkml.org 
[lkml]   [2022]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] ftrace,objtool: PC32 based __mcount_loc
On Wed, Jun 22, 2022 at 10:50:18AM -0400, Steven Rostedt wrote:
> On Fri, 17 Jun 2022 13:24:53 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > Hi,
> >
> > I recently noticed that __mcount_loc is 64bit wide, containing absolute
> > addresses. Since __mcount_loc is a permanent section (not one we drop
> > after boot), this bloats the kernel memory usage for no real purpose.
>
> Wait, it's not dropped? Nothing uses it after it is read. It should be
> dropped when init data is dropped.
>
> From include/asm-generic/vmlinux.lds.h
>
> /* init and exit section handling */
> #define INIT_DATA \
> KEEP(*(SORT(___kentry+*))) \
> *(.init.data init.data.*) \
> MEM_DISCARD(init.data*) \
> KERNEL_CTORS() \
> MCOUNT_REC() \ <<----
> *(.init.rodata .init.rodata.*) \
> FTRACE_EVENTS() \
> TRACE_SYSCALLS() \
> KPROBE_BLACKLIST() \
> ERROR_INJECT_WHITELIST() \
> MEM_DISCARD(init.rodata) \
>
>
> So it should be dropped after boot.

Urgh, clearly I got lost somewhere along the line. In that case it
doesn't matter nearly as much.

\
 
 \ /
  Last update: 2022-06-24 09:18    [W:0.135 / U:6.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site