live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Song Liu <song@kernel.org>
Cc: live-patching@vger.kernel.org
Subject: Re: Question about inline, notrace, and livepatch
Date: Tue, 2 May 2023 13:56:30 -0400	[thread overview]
Message-ID: <20230502135630.580a98ea@gandalf.local.home> (raw)
In-Reply-To: <CAPhsuW58LYU8iRCjoeChCyQ_7gqZvp6_U-fJr2Crf6gOniA51g@mail.gmail.com>

On Tue, 2 May 2023 10:40:28 -0700
Song Liu <song@kernel.org> wrote:

> We hit the following hiccup a couple times in the past few months:
> 
> A function is marked as "inline", but the compiler decided not to inline it.
> Since "inline" implies "notrace" since [1], this function doesn't have
> fentry/mcount. When we built livepatch for this function, kpatch-build
> failed with:
> 
>    xxx.o: function yyy has no fentry/mcount call, unable to patch
> 
> This is not a deal breaker, as we can usually modify the patch to work
> around it. But I wonder whether we still need "inline" to imply "notrace".
> Can we remove this to make livepatch a little easier?

The history behind this is that there were cases that functions that were
inlined, were in critical paths that could cause crashes if they were
traced. In testing they never triggered because the developer's compiler
inlined them. Then on someone else's machine, the compiler decided not to
inline the function and the system crashed. It was hell to debug because I
was not able to reproduce the issue, as my compiler would always keep the
function inlined!

But a lot has changed since then. I've implemented the
"ftrace_test_recursion_trylock()" that catches pretty much all recursive
bugs (and can ever report when they happen). So I may be open to removing
the "notrace" from "inline".

-- Steve

  reply	other threads:[~2023-05-02 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 17:40 Question about inline, notrace, and livepatch Song Liu
2023-05-02 17:56 ` Steven Rostedt [this message]
2023-05-02 18:26   ` Song Liu

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=20230502135630.580a98ea@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=live-patching@vger.kernel.org \
    --cc=song@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).