lkml.org 
[lkml]   [2017]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] trace: adjust code layout in get_recursion_context
On Tue, Aug 22, 2017 at 04:40:24PM +0200, Jesper Dangaard Brouer wrote:
> In an XDP redirect applications using tracepoint xdp:xdp_redirect to
> diagnose TX overrun, I noticed perf_swevent_get_recursion_context()
> was consuming 2% CPU. This was reduced to 1.6% with this simple
> change.

It is also incorrect. What do you suppose it now returns when the NMI
hits a hard IRQ which hit during a Soft IRQ?

> @@ -208,12 +208,12 @@ static inline int get_recursion_context(int *recursion)
> {
> int rctx;
>
> + if (in_softirq())
> + rctx = 1;
> else if (in_irq())
> rctx = 2;
> + else if (in_nmi())
> + rctx = 3;
> else
> rctx = 0;
>
>

\
 
 \ /
  Last update: 2017-08-22 17:15    [W:0.906 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site