Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-10 Thread Alexey Budankov
Hi, On 05.09.2017 14:19, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 01:17:39PM +0300, Alexey Budankov wrote: >> However we can't completely get rid of whole tree iterations because of >> inheritance code on forks in perf_event_init_context() here: > > Right, fork() / inherit needs to iterate

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-08 Thread Alexey Budankov
On 05.09.2017 19:03, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 03:06:26PM +0300, Alexey Budankov wrote: >> [ 6614.226305] WARNING: CPU: 45 PID: 43385 at kernel/events/core.c:239 >> event_function+0xb3/0xe0 > > I think I avoided that problem by not radically rewriting > perf_event_read() but

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-06 Thread Alexey Budankov
On 05.09.2017 19:03, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 03:06:26PM +0300, Alexey Budankov wrote: >> [ 6614.226305] WARNING: CPU: 45 PID: 43385 at kernel/events/core.c:239 >> event_function+0xb3/0xe0 > > I think I avoided that problem by not radically rewriting > perf_event_read() but

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 03:06:26PM +0300, Alexey Budankov wrote: > [ 6614.226305] WARNING: CPU: 45 PID: 43385 at kernel/events/core.c:239 > event_function+0xb3/0xe0 I think I avoided that problem by not radically rewriting perf_event_read() but fixing it instead: https://git.kernel.org/pub/sc

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 03:06:26PM +0300, Alexey Budankov wrote: > [ 6614.226305] WARNING: CPU: 45 PID: 43385 at kernel/events/core.c:239 > event_function+0xb3/0xe0 > [ 6614.226563] Call Trace: > [ 6614.226577] remote_function+0x3b/0x50 > [ 6614.226585] generic_exec_single+0x9a/0xd0 > [ 6614.22

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Alexey Budankov
Hi, On 05.09.2017 13:17, Alexey Budankov wrote: > On 04.09.2017 18:41, Peter Zijlstra wrote: >> On Mon, Sep 04, 2017 at 05:56:06PM +0300, Alexey Budankov wrote: >>> On 04.09.2017 15:08, Peter Zijlstra wrote: On Mon, Sep 04, 2017 at 01:46:45PM +0300, Alexey Budankov wrote: >> So the below c

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 01:17:39PM +0300, Alexey Budankov wrote: > However we can't completely get rid of whole tree iterations because of > inheritance code on forks in perf_event_init_context() here: Right, fork() / inherit needs to iterate the full thing, nothing to be done about that. I'll g

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Alexey Budankov
On 04.09.2017 18:41, Peter Zijlstra wrote: > On Mon, Sep 04, 2017 at 05:56:06PM +0300, Alexey Budankov wrote: >> On 04.09.2017 15:08, Peter Zijlstra wrote: >>> On Mon, Sep 04, 2017 at 01:46:45PM +0300, Alexey Budankov wrote: > So the below completely rewrites timekeeping (and probably breaks >>

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 12:51:35AM -0700, Stephane Eranian wrote: > >> Esp the cgroup stuff is entirely untested since I simply don't know how > >> to operate that. I did run Vince's tests on it, and I think it doesn't > >> regress, but I'm near a migraine so I can't really see straight atm. > >> >

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-05 Thread Stephane Eranian
On Thu, Aug 31, 2017 at 12:51 PM, Stephane Eranian wrote: > Hi, > > On Thu, Aug 31, 2017 at 10:18 AM, Peter Zijlstra wrote: >> On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: >>> On 22.08.2017 23:47, Peter Zijlstra wrote: >>> > On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Bud

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-04 Thread Peter Zijlstra
On Mon, Sep 04, 2017 at 05:41:45PM +0200, Peter Zijlstra wrote: > > >> U - allocation, A - ACTIVE, I - INACTIVE, O - OFF, > > >> E - ERROR, X - EXIT, D - DEAD, > > > > > > Not sure we care about the different <0 values, they're all effectively > > > OFF. > > > > We still need to care about prop

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-04 Thread Peter Zijlstra
On Mon, Sep 04, 2017 at 05:56:06PM +0300, Alexey Budankov wrote: > On 04.09.2017 15:08, Peter Zijlstra wrote: > > On Mon, Sep 04, 2017 at 01:46:45PM +0300, Alexey Budankov wrote: > >>> So the below completely rewrites timekeeping (and probably breaks > >>> world) but does away with the need to touc

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-04 Thread Alexey Budankov
On 04.09.2017 15:08, Peter Zijlstra wrote: > On Mon, Sep 04, 2017 at 01:46:45PM +0300, Alexey Budankov wrote: >>> So the below completely rewrites timekeeping (and probably breaks >>> world) but does away with the need to touch events that don't get >>> scheduled. >> >> We still need and do iterate

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-04 Thread Peter Zijlstra
On Mon, Sep 04, 2017 at 01:46:45PM +0300, Alexey Budankov wrote: > > So the below completely rewrites timekeeping (and probably breaks > > world) but does away with the need to touch events that don't get > > scheduled. > > We still need and do iterate thru all events at some points e.g. on contex

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-04 Thread Alexey Budankov
Hi, On 31.08.2017 20:18, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: >> On 22.08.2017 23:47, Peter Zijlstra wrote: >>> On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Budankov wrote: The key thing in the patch is explicit updating of tstamp fields

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-01 Thread Vince Weaver
On Thu, 31 Aug 2017, Peter Zijlstra wrote: > So the below completely rewrites timekeeping (and probably breaks > world) but does away with the need to touch events that don't get > scheduled. > > Esp the cgroup stuff is entirely untested since I simply don't know how > to operate that. I did run

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-01 Thread Peter Zijlstra
On Fri, Sep 01, 2017 at 02:17:17PM +0300, Alexey Budankov wrote: > > No more weird and wonderful mind bending interaction between 3 different > > timestamps with arcane update rules. > > > > --- > > include/linux/perf_event.h | 25 +- > > kernel/events/core.c | 551 > > ---

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-01 Thread Peter Zijlstra
On Fri, Sep 01, 2017 at 01:45:17PM +0300, Alexey Budankov wrote: > Well, this looks like an "opposite" approach to event timekeeping in > comparison to what we currently have. I would say 'sane' approach. The current thing is horrible. > Do you want this rework before or after the current patch

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-01 Thread Alexey Budankov
On 31.08.2017 20:18, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: >> On 22.08.2017 23:47, Peter Zijlstra wrote: >>> On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Budankov wrote: The key thing in the patch is explicit updating of tstamp fields for

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-09-01 Thread Alexey Budankov
On 31.08.2017 20:18, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: >> On 22.08.2017 23:47, Peter Zijlstra wrote: >>> On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Budankov wrote: The key thing in the patch is explicit updating of tstamp fields for

Re: [RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-08-31 Thread Stephane Eranian
Hi, On Thu, Aug 31, 2017 at 10:18 AM, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: >> On 22.08.2017 23:47, Peter Zijlstra wrote: >> > On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Budankov wrote: >> >> The key thing in the patch is explicit updating

[RFC][PATCH] perf: Rewrite enabled/running timekeeping

2017-08-31 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 11:54:15AM +0300, Alexey Budankov wrote: > On 22.08.2017 23:47, Peter Zijlstra wrote: > > On Thu, Aug 10, 2017 at 06:57:43PM +0300, Alexey Budankov wrote: > >> The key thing in the patch is explicit updating of tstamp fields for > >> INACTIVE events in update_event_times().