lkml.org 
[lkml]   [2022]   [Jun]   [17]   [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 Fri, Jun 17, 2022 at 01:24:53PM +0200, Peter Zijlstra 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.
>
> The below patch adds __mcount_loc_32 and objtool support to generate it.
> This saves, on an x86_64-defconfig + FTRACE, 23975*4 ~= 94K of permanent
> storage.
>
> XXX hobbled sorttable for now
> XXX compile tested only
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Nice!

Some nits:

- No need for renaming the section, it can still be called
'__mcount_loc' regardless?

- No need for a new FTRACE_MCOUNT32_USE_OBJTOOL config option or
'--mcount32' cmdline option, just change the old ones to be pc32?

- change "32" to "PC32": CC_USING_MCOUNT_LOC_PC32

That will shrink this patch down quite a bit.

--
Josh

\
 
 \ /
  Last update: 2022-06-17 22:12    [W:2.599 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site