From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932253AbdJXJWF (ORCPT ); Tue, 24 Oct 2017 05:22:05 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:47404 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932213AbdJXJWE (ORCPT ); Tue, 24 Oct 2017 05:22:04 -0400 X-Google-Smtp-Source: ABhQp+QAkwlS6JmYZzU5pV6TlBVecAR9Az3K3jZHd3oYVVHpZpkFFQvmpOezJelxNGeQ/vlrRtzpog== Date: Tue, 24 Oct 2017 11:22:00 +0200 From: Ingo Molnar To: "Liang, Kan" Cc: "acme@kernel.org" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "jolsa@kernel.org" , "wangnan0@huawei.com" , "hekuang@huawei.com" , "namhyung@kernel.org" , "alexander.shishkin@linux.intel.com" , "Hunter, Adrian" , "ak@linux.intel.com" Subject: Re: [PATCH V3 0/6] event synthesization multithreading for perf record Message-ID: <20171024092200.wef6b66ecmhrvaja@gmail.com> References: <1508529934-369393-1-git-send-email-kan.liang@intel.com> <20171023114822.ijbixdkhysinlwqv@gmail.com> <37D7C6CF3E00A74B8858931C1DB2F077537D874E@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F077537D874E@SHSMSX103.ccr.corp.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Liang, Kan wrote: > For 'all', do you mean the whole process? Yeah. > I think that's the ultimate goal. Eventually there will be per-CPU recording > threads created at the beginning of perf record and go through the whole process. > The plan is to do the multithreading step by step from the simplest case. > Synthesizing stage is just a start. So, why not do it like the kernel did: add all the threads, create the percpu files, and introduce a 'big perf lock' (big mutex) that is taken for all the current non-threaded perf functionality. This should be fairly straightforward to do and should be 'obviously correct'. _Then_ start doing the hard threading work on top of this, like threading the synthesizing phase. Doing the whole per CPU thread setup/teardown for just the synthesizing part of it looks like the wrong design. I.e. what I'm suggesting is no extra threading work, just organizing it in a different fashion and increasing the life-time of the per CPU threads from 'perf startup' to 'perf shutdown'. Thanks, Ingo