All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Yinan Liu <yinan@linux.alibaba.com>,
	rostedt@goodmis.org, peterz@infradead.org,
	mark-pk.tsai@mediatek.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v8] scripts: ftrace - move the sort-processing in ftrace_init
Date: Fri, 21 Jan 2022 12:14:09 +0100	[thread overview]
Message-ID: <yt9d8rv9cpdq.fsf@linux.ibm.com> (raw)
In-Reply-To: <YeqOFHNfxKcNXNrn@osiris> (Heiko Carstens's message of "Fri, 21 Jan 2022 11:42:28 +0100")

Heiko Carstens <hca@linux.ibm.com> writes:

> On Fri, Jan 21, 2022 at 10:46:36AM +0100, Sven Schnelle wrote:
>> 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?
>
> Sven, thanks for figuring this out. Can you confirm that reverting
> commit 72b3942a173c ("scripts: ftrace - move the sort-processing in
> ftrace_init") fixes the problem?

Yes, reverting this commit fixes it.

> This really should be addressed before rc1 is out, otherwise s390 is
> broken if somebody enables ftrace.
> Where "broken" translates to random crashes as soon as ftrace is
> enabled, which again is nowadays quite common.

I wasn't able to reproduce these crashes on my systems so far. For the
readers here, we're seeing about 10-15 systems crashing every night,
usually in the 00basic/ ftrace testcases.

In most of the case it looks like register corruption, where some random
register is or'd or parts are overwritten with 0x0004000000000000,
sometimes 0x00f4000000000000. I haven't found yts found a commit that
might cause this.

/Sven

  reply	other threads:[~2022-01-21 11:14 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11 13:50 [PATCH 0/2] ftrace: improve ftrace during compiling Yinan Liu
2021-09-11 13:50 ` [PATCH 1/2] scripts: ftrace - move the sort-processing in ftrace_init to compile time Yinan Liu
2021-09-11 13:59   ` Steven Rostedt
2021-10-03 13:42     ` Yinan Liu
2021-10-08 23:48       ` Steven Rostedt
2021-10-09  2:56         ` Yinan Liu
2021-10-25 13:20           ` Yinan Liu
2021-10-25 15:00             ` Steven Rostedt
2021-09-11 13:50 ` [PATCH 2/2] scripts: ftrace - move the nop-processing " Yinan Liu
2021-09-11 14:12   ` Steven Rostedt
2021-09-11 15:28     ` Yinan Liu
2021-09-11 16:07       ` Peter Zijlstra
2021-09-11 14:33   ` Peter Zijlstra
2021-09-11 17:15   ` kernel test robot
2021-09-11 17:15     ` kernel test robot
2021-09-11 18:04   ` kernel test robot
2021-09-11 18:04     ` kernel test robot
2021-11-16  2:49 ` [PATCH v2 0/2] ftrace optimization at " Yinan Liu
2021-11-16  2:49   ` [PATCH v2 1/2] scripts: ftrace - move the sort-processing in ftrace_init to " Yinan Liu
2021-11-16  8:07     ` Peter Zijlstra
2021-11-16 12:42       ` Yinan Liu
2021-11-16 13:05         ` Peter Zijlstra
2021-11-16 14:46           ` Yinan Liu
2021-11-17 13:34     ` kernel test robot
2021-11-17 13:34       ` kernel test robot
2021-11-16  2:49   ` [PATCH v2 2/2] scripts: ftrace - move the nop-processing " Yinan Liu
2021-11-16  8:10     ` Peter Zijlstra
2021-11-16 12:51       ` Yinan Liu
2021-11-16 13:07       ` Steven Rostedt
2021-11-16 15:02         ` Yinan Liu
2021-11-16 16:06     ` Steven Rostedt
2021-11-22 13:43 ` [PATCH v3] scripts: ftrace - move the sort-processing " Yinan Liu
2021-11-23 10:54 ` [PATCH v4] ftrace sorting optimization changelog Yinan Liu
2021-11-23 10:54   ` [PATCH v4] scripts: ftrace - move the sort-processing in ftrace_init to compile time Yinan Liu
2021-11-29  2:13     ` Yinan Liu
2021-11-29  3:51       ` Steven Rostedt
2021-11-29  6:52         ` Yinan Liu
2021-11-30 17:08     ` Steven Rostedt
2021-12-01  5:32 ` [PATCH v5 0/2] ftrace sorting optimization changelog Yinan Liu
2021-12-01  5:32   ` [PATCH v5 1/2] scripts: ftrace - move the sort-processing in ftrace_init to compile time Yinan Liu
2021-12-01 21:45     ` Steven Rostedt
2021-12-05 12:35     ` [scripts] 12955fb1c5: kernel-selftests.livepatch.test-ftrace.sh.fail kernel test robot
2021-12-05 12:35       ` kernel test robot
2021-12-01  5:32   ` [PATCH v5 2/2] script/sorttable: code style improvements Yinan Liu
2021-12-02  2:16 ` [PATCH v6 0/2] ftrace sorting optimization changelog Yinan Liu
2021-12-02  2:16   ` [PATCH v6 1/2] scripts: ftrace - move the sort-processing in ftrace_init Yinan Liu
2021-12-02 17:58     ` Steven Rostedt
2021-12-05 12:45       ` Masami Hiramatsu
2021-12-06 20:18       ` Steven Rostedt
2021-12-07  1:29         ` Yinan Liu
2021-12-02  2:16   ` [PATCH v6 2/2] script/sorttable: code style improvements Yinan Liu
2021-12-02 15:30   ` [PATCH v6 0/2] ftrace sorting optimization changelog Peter Zijlstra
2021-12-07 15:13 ` [PATCH v7 0/2] ftrace sorting optimization Yinan Liu
2021-12-07 15:13   ` [PATCH v7 1/2] scripts: ftrace - move the sort-processing in ftrace_init Yinan Liu
2021-12-11 14:50     ` Steven Rostedt
2021-12-07 15:13   ` [PATCH v7 2/2] script/sorttable: code style improvements Yinan Liu
2021-12-12 11:33 ` [PATCH v8 0/1] change log Yinan Liu
2021-12-12 11:33   ` [PATCH v8] scripts: ftrace - move the sort-processing in ftrace_init Yinan Liu
2022-01-21  9:46     ` Sven Schnelle
2022-01-21 10:42       ` Heiko Carstens
2022-01-21 11:14         ` Sven Schnelle [this message]
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=yt9d8rv9cpdq.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=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.