Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757448Ab1CNWc4 (ORCPT ); Mon, 14 Mar 2011 18:32:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59276 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757372Ab1CNWcz (ORCPT ); Mon, 14 Mar 2011 18:32:55 -0400 Date: Mon, 14 Mar 2011 19:32:24 -0300 From: Arnaldo Carvalho de Melo To: Vince Weaver Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Paul Mackerras , Ingo Molnar , Corey Ashford , Stephane Eranian Subject: Re: perf: kernel memory leak when inherit enabled Message-ID: <20110314223224.GD9388@ghostprotocols.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1639 Lines: 41 Em Mon, Mar 14, 2011 at 06:27:19PM -0400, Vince Weaver escreveu: > On Fri, 11 Mar 2011, Vince Weaver wrote: > > > > While trying to use perf events with inherit enabled to profile some > > multi-threaded BLAS routines (using PAPI) I ended up out-of-memorying my > > machine. It turns out you can quickly leak gigabytes of kernel memory > > that isn't freed when the process exits. > > I've bisected this. There's a whole day I'll never see again. binutils > 2.21 and gcc-4.5 for the lose :( > > Anyway this memory leak with inherit was introduced in > 4fd38e4595e commit 4fd38e4595e2f6c9d27732c042a0e16b2753049c Author: Peter Zijlstra Date: Thu May 6 17:31:38 2010 +0200 perf: Fix exit() vs PERF_FORMAT_GROUP Both Stephane and Corey reported that PERF_FORMAT_GROUP didn't work as expected if the task the counters were attached to quit before the read() call. The cause is that we unconditionally destroy the grouping when we remove counters from their context. Fix this by only doing this when we free the counter itself. Reported-by: Corey Ashford Reported-by: Stephane Eranian Signed-off-by: Peter Zijlstra LKML-Reference: <1273160566.5605.404.camel@twins> Signed-off-by: Ingo Molnar - Arnaldo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/