Messages in this thread | | | Date | Tue, 22 Aug 2017 17:14:10 +0200 | From | Peter Zijlstra <> | Subject | Re: [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; > >
| |