Re: [PATCH 6/9] livepatch/ftrace: Add recursion protection to the ftrace callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Oct 2020 10:37:44 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx)

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux