public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Yinan Liu <yinan@linux.alibaba.com>
Cc: rostedt@goodmis.org, peterz@infradead.org,
	mark-pk.tsai@mediatek.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, hca@linux.ibm.com,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH v8] scripts: ftrace - move the sort-processing in ftrace_init
Date: Fri, 21 Jan 2022 10:46:36 +0100	[thread overview]
Message-ID: <yt9dee51ctfn.fsf@linux.ibm.com> (raw)
In-Reply-To: <20211212113358.34208-2-yinan@linux.alibaba.com> (Yinan Liu's message of "Sun, 12 Dec 2021 19:33:58 +0800")

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

       reply	other threads:[~2022-01-21  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210911135043.16014-1-yinan@linux.alibaba.com>
     [not found] ` <20211212113358.34208-1-yinan@linux.alibaba.com>
     [not found]   ` <20211212113358.34208-2-yinan@linux.alibaba.com>
2022-01-21  9:46     ` Sven Schnelle [this message]
2022-01-21 10:42       ` [PATCH v8] scripts: ftrace - move the sort-processing in ftrace_init Heiko Carstens
2022-01-21 11:14         ` Sven Schnelle
2022-01-21 11:29           ` Sven Schnelle
2022-01-21 18:11         ` Steven Rostedt
2022-01-22  9:17           ` Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yt9dee51ctfn.fsf@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mark-pk.tsai@mediatek.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yinan@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox