Re: [PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-18 Thread Jiri Olsa
On Tue, Jul 17, 2018 at 11:02:45AM +0200, Jiri Olsa wrote: SNIP > +/* > + * Pure refs increase without any chec/warn. > + */ > +static inline void refcount_inc_no_warn(refcount_t *r) > +{ > + atomic_inc(&r->refs); > +} > + > /* > * Similar to atomic_dec_and_test(), it will WARN on underflo

Re: [PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-17 Thread Jiri Olsa
On Tue, Jul 17, 2018 at 10:49:40AM +0900, Namhyung Kim wrote: > Hi Jiri, > > On Mon, Jul 16, 2018 at 12:29:34PM +0200, Jiri Olsa wrote: > > On Sun, Jul 15, 2018 at 10:08:27PM +0900, Namhyung Kim wrote: > > > > SNIP > > > > > > Because thread 2 first decrements the refcnt and only after then it >

Re: [PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-16 Thread Namhyung Kim
Hi Jiri, On Mon, Jul 16, 2018 at 12:29:34PM +0200, Jiri Olsa wrote: > On Sun, Jul 15, 2018 at 10:08:27PM +0900, Namhyung Kim wrote: > > SNIP > > > > Because thread 2 first decrements the refcnt and only after then it > > > removes the struct comm_str from the list, the thread 1 can find this > >

Re: [PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-16 Thread Jiri Olsa
On Sun, Jul 15, 2018 at 10:08:27PM +0900, Namhyung Kim wrote: SNIP > > Because thread 2 first decrements the refcnt and only after then it > > removes the struct comm_str from the list, the thread 1 can find this > > object on the list with refcnt equls to 0 and hit the assert. > > > > This patc

Re: [PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-15 Thread Namhyung Kim
Hi Jiri, On Thu, Jul 12, 2018 at 04:20:20PM +0200, Jiri Olsa wrote: > We occasionaly hit following assert failure in perf top, > when processing the /proc info in multiple threads. > > perf: ...include/linux/refcount.h:109: refcount_inc: > Assertion `!(!refcount_inc_not_zero(r))' failed

[PATCH 1/4] perf tools: Fix struct comm_str removal crash

2018-07-12 Thread Jiri Olsa
We occasionaly hit following assert failure in perf top, when processing the /proc info in multiple threads. perf: ...include/linux/refcount.h:109: refcount_inc: Assertion `!(!refcount_inc_not_zero(r))' failed. The gdb backtrace looks like this: [Switching to Thread 0x711ba700 (L