live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Miroslav Benes <mbenes@suse.cz>
Cc: linux-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Kosina <jikos@kernel.org>, Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	live-patching@vger.kernel.org
Subject: Re: [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback
Date: Fri, 30 Oct 2020 08:28:31 -0400	[thread overview]
Message-ID: <20201030082831.5142be16@oasis.local.home> (raw)
In-Reply-To: <20201029103744.0f7f52dc@gandalf.local.home>

On Thu, 29 Oct 2020 10:37:44 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> I also plan on adding code that reports when recursion has happened,
> because even if it's not a problem, recursion adds extra overhead.

I did the above (will be posting that later, maybe next week), and
found two bugs with the recursion code. :-/

One was in the nmi handling, where it never cleared the nmi bit
(because it was zero, and thus ignored), and that caused all functions
in NMI handlers to not be traced (because it thought it was a
recursion).
(see https://lore.kernel.org/r/20201030002722.766a22df@oasis.local.home)

The second was the recursion algorithm depends on the preempt_count()
being accurate, but when it transitions between context, and there's
tracing in that transition, it could falsely record it as a recursion.

I have a fix for both of these bugs and will be sending them up marked
for stable after I finish testing them.

This goes to show that the recursion reported should be implemented
(but that will be for the next merge window).

-- Steve

  reply	other threads:[~2020-10-30 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201028115244.995788961@goodmis.org>
2020-10-28 11:52 ` [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback Steven Rostedt
2020-10-29 13:51   ` Miroslav Benes
2020-10-29 14:37     ` Steven Rostedt
2020-10-30 12:28       ` Steven Rostedt [this message]
2020-10-29 14:57     ` Petr Mladek
2020-10-29 15:03       ` Miroslav Benes
2020-10-29 18:24       ` Steven Rostedt
2020-10-30  9:48         ` Miroslav Benes
2020-10-30 10:41           ` Petr Mladek

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=20201030082831.5142be16@oasis.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mhiramat@kernel.org \
    --cc=pmladek@suse.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;
as well as URLs for NNTP newsgroup(s).