Re: [PATCH v2] perf: Synchronously cleanup child events

From: Peter Zijlstra
Date: Tue Jan 19 2016 - 15:07:40 EST


On Tue, Jan 19, 2016 at 05:12:34PM +0200, Alexander Shishkin wrote:
> +static bool put_event_last(struct perf_event *event)
> {
> + if (atomic_long_cmpxchg(&event->refcount, 1, 0)) {

if (atomic_long_cmpxchg(&event->refcount, 1, 0) == 1) {

> + __put_event(event);
> + return true;
> + }
> +
> + return false;
> }