From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbaEASpe (ORCPT ); Thu, 1 May 2014 14:45:34 -0400 Received: from mail-qa0-f50.google.com ([209.85.216.50]:60223 "EHLO mail-qa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751273AbaEASpb (ORCPT ); Thu, 1 May 2014 14:45:31 -0400 X-Google-Original-From: Vince Weaver Date: Thu, 1 May 2014 14:49:01 -0400 (EDT) From: Vince Weaver To: Vince Weaver cc: Thomas Gleixner , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Steven Rostedt Subject: Re: [perf] more perf_fuzzer memory corruption In-Reply-To: Message-ID: References: <20140429094632.GP27561@twins.programming.kicks-ass.net> <20140429190108.GB30445@twins.programming.kicks-ass.net> <20140430184437.GH17778@laptop.programming.kicks-ass.net> <20140501150948.GR11096@twins.programming.kicks-ass.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, humor me a bit here. I'm looking at the buggy trace and comparing against a "good" trace where the bug doesn't happen. It is a rance condition of sorts, because it's just a 10us or so interleaving of calls that causes the bug to happen or not. In the good trace: [parent] __perf_event_task_sched_out (and hence perf_swevent_del) [child] perf_release In the buggy trace: [child] perf_release [parent] __perf_event_task_sched_out (perf_swevent_del never happens) perf_swevent_del calls hlist_del_rcu(event->hlist_entry) to remove the event from the swevent hlist. Now in theory perf_release() calls sw_perf_event_destroy() which you would think would also call the above. Instead it does swevent_hlist_put_cpu(event, cpu); which does all kinds of weird hash stuff that I don't follow. Should the above two be equivelent? Is it reference counting in there with if (!--swhash->hlist_refcount) causing the issue? Anyway I'm tired of staring at traces for the moment. Vince