Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-23 Thread Ingo Molnar
* Peter Zijlstra wrote: > diff --git a/kernel/events/internal.h b/kernel/events/internal.h > index 486fd78eb8d5..981e4163e16c 100644 > --- a/kernel/events/internal.h > +++ b/kernel/events/internal.h > @@ -206,16 +206,15 @@ static inline unsigned long perf_aux_size(struct > ring_buffer *rb) >

Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-22 Thread Peter Zijlstra
On Tue, Aug 22, 2017 at 07:00:39PM +0200, Jesper Dangaard Brouer wrote: > > static inline int get_recursion_context(int *recursion) > > { > > + unsigned int pc = preempt_count(); > > int rctx; > > > > - if (in_nmi()) > > + if (pc & NMI_MASK) > > rctx = 3; > > - else if (

Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-22 Thread Jesper Dangaard Brouer
On Tue, 22 Aug 2017 19:00:39 +0200 Jesper Dangaard Brouer wrote: > On Tue, 22 Aug 2017 17:20:25 +0200 > Peter Zijlstra wrote: > > > On Tue, Aug 22, 2017 at 05:14:10PM +0200, Peter Zijlstra wrote: > > > On Tue, Aug 22, 2017 at 04:40:24PM +0200, Jesper Dangaard Brouer wrote: > > > > > > >

Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-22 Thread Jesper Dangaard Brouer
On Tue, 22 Aug 2017 17:20:25 +0200 Peter Zijlstra wrote: > On Tue, Aug 22, 2017 at 05:14:10PM +0200, Peter Zijlstra wrote: > > 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 ove

Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-22 Thread Peter Zijlstra
On Tue, Aug 22, 2017 at 05:14:10PM +0200, Peter Zijlstra wrote: > 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 consumin

Re: [PATCH] trace: adjust code layout in get_recursion_context

2017-08-22 Thread Peter Zijlstra
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 als