Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966753Ab3HIK2d (ORCPT ); Fri, 9 Aug 2013 06:28:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8016 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966467Ab3HIK2c (ORCPT ); Fri, 9 Aug 2013 06:28:32 -0400 Date: Fri, 9 Aug 2013 12:28:02 +0200 From: Jiri Olsa To: Frederic Weisbecker Cc: Peter Zijlstra , LKML , Ingo Molnar , Namhyung Kim , Arnaldo Carvalho de Melo , Stephane Eranian Subject: Re: [PATCH 1/3] perf: Rollback callchain buffer refcount under the callchain mutex Message-ID: <20130809102802.GC1045@krava.brq.redhat.com> References: <1375460996-16329-1-git-send-email-fweisbec@gmail.com> <1375460996-16329-2-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1375460996-16329-2-git-send-email-fweisbec@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1198 Lines: 27 On Fri, Aug 02, 2013 at 06:29:54PM +0200, Frederic Weisbecker wrote: > When we fail to allocate the callchain buffers, we rollback the refcount > we did and return from get_callchain_buffers(). > > However we take the refcount and allocate under the callchain lock > but the rollback is done outside the lock. > > As a result, while we rollback, some concurrent callchain user may > call get_callchain_buffers(), see the non-zero refcount and give up > because the buffers are NULL without itself retrying the allocation. > > The consequences aren't that bad but that behaviour looks weird enough and > it's better to give their chances to the following callchain users where > we failed. > > Reported-by: Jiri Olsa > Signed-off-by: Frederic Weisbecker > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Jiri Olsa Acked-by: Jiri Olsa -- 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/