lkml.org 
[lkml]   [2022]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v8] scripts: ftrace - move the sort-processing in ftrace_init
Date
Hi Yinan,

Yinan Liu <yinan@linux.alibaba.com> writes:

> When the kernel starts, the initialization of ftrace takes
> up a portion of the time (approximately 6~8ms) to sort mcount
> addresses. We can save this time by moving mcount-sorting to
> compile time.
>
> Signed-off-by: Yinan Liu <yinan@linux.alibaba.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> ---
> kernel/trace/ftrace.c | 11 +++-
> scripts/Makefile | 6 +-
> scripts/link-vmlinux.sh | 6 +-
> scripts/sorttable.c | 2 +
> scripts/sorttable.h | 120 +++++++++++++++++++++++++++++++++++++++-
> 5 files changed, 137 insertions(+), 8 deletions(-)

while i like the idea, this unfortunately breaks ftrace on s390. The
reason for that is that the compiler generates relocation entries for
all the addresses in __mcount_loc. During boot, the s390 decompressor
iterates through all the relocations and overwrites the nicely
sorted list between __start_mcount_loc and __stop_mcount_loc with
the unsorted list because the relocations entries are not adjusted.

Of course we could just disable that option, but that would make us
different compared to x86 which i don't like. Adding code to sort the
relocation would of course also fix that, but i don't think it is a good
idea to rely on the order of relocations.

Any thoughts how a fix could look like, and whether that could also be a
problem on other architectures?

Thanks
Sven

\
 
 \ /
  Last update: 2022-01-21 10:48    [W:0.089 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site