Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753752AbbLOCEP (ORCPT ); Mon, 14 Dec 2015 21:04:15 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34657 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753664AbbLOCEO (ORCPT ); Mon, 14 Dec 2015 21:04:14 -0500 Date: Tue, 15 Dec 2015 11:03:32 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Frederic Weisbecker , Andi Kleen , Stephane Eranian , Adrian Hunter Subject: Re: [PATCH/RFC 12/16] perf tools: Reduce lock contention when processing events Message-ID: <20151215020332.GB32522@danjae.kornet> References: <1449734015-9148-1-git-send-email-namhyung@kernel.org> <1449734015-9148-13-git-send-email-namhyung@kernel.org> <20151214084303.GA17701@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151214084303.GA17701@krava.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1282 Lines: 35 Hi Jiri, On Mon, Dec 14, 2015 at 09:43:04AM +0100, Jiri Olsa wrote: > On Thu, Dec 10, 2015 at 04:53:31PM +0900, Namhyung Kim wrote: > > When multi-thread is enabled, the machine->threads_lock is contented > > as all worker threads try to grab the writer lock using the > > machine__findnew_thread(). Usually, the thread they're looking for is > > in the tree so they only need the reader lock though. > > > > Thus try machine__find_thread() first, and then fallback to the > > 'findnew' API. This will improve the performance. > > found one other place, but I guess you chose those > based on profiling the contention? I only profiled my earlier perf report patchset and found machine__findnew_thread() in perf_event__preprocess_sample() was contended. But perf-report serialized meta events and only process sample events parallelly. As perf-top processes all events parallelly, I thought I should use the same technique for other places. > > parent lookup in machine__process_fork_event I'll add that too. Thanks, Namhyung -- 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/