From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbdLMKSO (ORCPT ); Wed, 13 Dec 2017 05:18:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43412 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752275AbdLMKSK (ORCPT ); Wed, 13 Dec 2017 05:18:10 -0500 Date: Wed, 13 Dec 2017 11:18:07 +0100 From: Jiri Olsa To: Tejun Heo Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC] Sharing PMU counters across compatible events Message-ID: <20171213101807.GA2883@krava> References: <20171201141950.GB2421075@devbig577.frc2.facebook.com> <20171206114204.GB10580@krava> <20171211153449.GJ2421075@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171211153449.GJ2421075@devbig577.frc2.facebook.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 13 Dec 2017 10:18:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 11, 2017 at 07:34:49AM -0800, Tejun Heo wrote: > Hello, Jiri. > > On Wed, Dec 06, 2017 at 12:42:04PM +0100, Jiri Olsa wrote: > > I see this rather on the hw level, since it concerns HW counters > > > > I think we could detect same (alias) events at the time counters > > are added/removed on/from the cpu and share their HW part like > > counter idx, regs and such (struct hw_perf_event_cpu in my changes) > > > > this way it'd be completely transparent for generic code > > I don't quite follow why doing this in arch code is better than > generic. Doing this in arch means we'd need to do the same thing > multiple times for different archs. Why is that better? so I can see this to be useful for HW conters only, because of limited number of regs as for the higher level on which this could be implemented I see some pitfals with event rotations as Peter mentioned and task/cpu contexts scheduling.. while the hw-level implementation seems pretty straight forward I'll test the code and let's see ;-) jirka