public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Richter <robert.richter@amd.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Pekka Enberg" <penberg@cs.helsinki.fi>,
	"Arjan van de Ven" <arjan@infradead.org>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Paul Mackerras" <paulus@samba.org>,
	LKML <linux-kernel@vger.kernel.org>,
	oprofile-list <oprofile-list@lists.sourceforge.net>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Mike Galbraith" <efault@gmx.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH 0/26] oprofile: Performance counter multiplexing
Date: Thu, 13 Aug 2009 18:13:40 +0200	[thread overview]
Message-ID: <20090813161340.GI9915@erda.amd.com> (raw)
In-Reply-To: <20090806105134.GD11236@elte.hu>

On 06.08.09 12:51:34, Ingo Molnar wrote:
> 
> * Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> 
> > Hi Robert,
> > 
> > On Wed, Aug 5, 2009 at 3:35 PM, Robert Richter<robert.richter@amd.com> wrote:
> >
> > > The question is more if it makes sense. It's new to me dropping 
> > > user/kernel interfaces that are in use and forcing its 
> > > developers to rewrite their code. Oprofile is actively developed 
> > > and in many distros. It supports architectures perfcounters 
> > > doesn't. So, what do you want?
> > 
> > Maybe we can keep the ABIs in place but use a common machinery 
> > under the hood for both perf and oprofile? That said, I do expect 
> > oprofile ABIs to be special meaning that there's probably not a 
> > whole lot users other than the oprofile user-space tool? So if do 
> > convert the user-space tool to use sys_perf_counter_open() and put 
> > the in-kernel oprofile code into deep-maintenance mode, maybe we 
> > can eventually get rid of it?
> 
> Note, we dont need to (and dont want to) 'get rid of oprofile' - 
> that's not the point. Nobody is arguing for instant removal of 
> oprofile.

This sound good to me...

> All i'm arguing for is to not rewrite all oprofile drivers while we 
> try to extend perfcounters support. Robert's series does exactly 
> that and that's where my unhappiness comes from ...
>
> As you note it below, in terms of development it's quite a 
> distraction to have active development in both facilities, when 
> oprofile is arguably on the to-be-obsoleted side of the equation. 

Ingo, you can be sure, future implementations will keep the focus on
perfcounters. A single pmu implementation is that I prefer too, it
reduces development and testing efforts.

> Converting the user-space oprofile tools: instead of some in-kernel 
> wrappery, the right approach is to use the already existing high 
> level interface: to use sys_perf_counter_open() in the oprofile 
> daemon.
> 
> It only affects the sample collection daemon (which is a small 
> portion of oprofile user-space) and needs no kernel changes. This is 
> what i suggested to Robert before and i've seen no argument why this 
> cannot be done.
> 
> An added bonus is that the legacy oprofile kernel ABI can stay 
> completely untouched. (and the oprofile tooling can fall back to it)

I am fine with this. The oprofile daemon could be ported to use the
perfcounters i/f and existing oprofile tools that are not ported may
fall back to the legacy oprofile kernel ABI.

> And yes, AFAIK oprofile user-space is pretty much the only 
> user-space app that relies on the oprofile ABI - at least in the OSS 
> space. Robert, is there perhaps some bin-only oprofile based tool 
> that you implied before? Which one is it?

I know of hardware platform vendors using oprofile for system testing,
but I don't know exactly how their user-land looks like and whether
the daemon is used. AMD's CodeAnalyst tool (OSS) uses oprofile with an
own daemon.

> 
> > That said, the lack of architecture support for perf is definitely 
> > a blocker here...
> 
> Note, here's the current (roughly calculated, possibly inaccurate) 
> platform support matrix between oprofile and perfcounters:
> 
>     + : hw support available
>     0 : sw support available
>     - : no support
> 
>                         oprofile     perfcounters
>    alpha                   +             -
>    arm                     +             -
>    avr32                   +             -
>    blackfin                -             -
>    cris                    -             -
>    frv                     -             0
>    h8300                   -             -
>    ia64                    +             -
>    m32r                    -             -
>    m68k                    -             -
>    m68knommu               -             -
>    microblaze              -             -
>    mips                    +             0
>    mn10300                 -             -
>    parisc                  -             0
>    powerpc                 +             +
>    s390                    0             0
>    sh                      +             0
>    sparc                   0             0-[pending]
>    x86                     +             +
>    xtensa                  -             -
> 
> Takeaway points:
> 
>  - out of 20 hardware architectures, 8 have oprofile hw-PMU
>    support, 2 have timer-fallback support, 11 are not supported at 
>    all.
> 
>  - out of 20 hardware architectures, 2 have perfcounters hw-PMU 
>    support, 6 have sw event support, 12 are not supported at all.
> 
> The architectures with the biggest practical weight are: x86, 
> powerpc, arm, mips.
> 
> So there's a gap but it's not "all architectures" and the transition 
> to perfcounters is well underway. Still, oprofile obviously leads 
> (it has a 10 years headway) - and it's needed as a compatibility 
> option during the migration and even if perf had equivalent support 
> it would _still_ be around for some time as a pure ABI compatibility 
> thing.

Surely the argument of unsupported architectures will not be valid for
a long time as its number for PCL will probably decrease fast.

> 
> > On Wed, Aug 5, 2009 at 3:35 PM, Robert Richter<robert.richter@amd.com> wrote:
> >
> > > And why not having more than one profiling subsystem in the 
> > > kernel? I see also more than one type of car on the street 
> > > though all of them have 4 wheels.
> > 
> > Well, so far I've only had bad experiences with duplicate 
> > functionality in the kernel be it a core kernel subsystem like 
> > slab or a device driver (broadcom and e100 come to mind). The 
> > problem is that you fragment tester and developer base and end up 
> > with a different set of bugs for each of the duplicate components 
> > causing more work than necessary. And what eventually happens is 
> > that you have only one component that's under active development 
> > but you can't get rid of the less active ones because people 
> > depend on them and the active one has corner case bugs that just 
> > don't get fixed.
> 
> Correct. That's my main point.

I don't want to have duplicate implementations, I want to have
multiple interfaces using the same in-kernel implementation. The code
base developed and tested will be the same then.

In the end I don't see much disagreement at all.

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@amd.com


  reply	other threads:[~2009-08-13 16:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 17:07 [PATCH 0/26] oprofile: Performance counter multiplexing Robert Richter
2009-07-28 17:07 ` [PATCH 01/26] x86/oprofile: Rework and simplify nmi_cpu_setup() Robert Richter
2009-07-28 17:07 ` [PATCH 02/26] x86/oprofile: Whitespaces changes only Robert Richter
2009-07-28 17:07 ` [PATCH 03/26] oprofile: Implement performance counter multiplexing Robert Richter
2009-07-28 17:07 ` [PATCH 04/26] x86/oprofile: Fix usage of NUM_CONTROLS/NUM_COUNTERS macros Robert Richter
2009-07-28 17:07 ` [PATCH 05/26] x86/oprofile: Use per_cpu() instead of __get_cpu_var() Robert Richter
2009-07-28 17:07 ` [PATCH 06/26] x86/oprofile: Fix initialization of switch_index Robert Richter
2009-07-28 17:07 ` [PATCH 07/26] oprofile: oprofile_set_timeout(), return with error for invalid args Robert Richter
2009-07-28 17:07 ` [PATCH 08/26] oprofile: Rename variable timeout_jiffies and move to oprofile_files.c Robert Richter
2009-07-28 17:07 ` [PATCH 09/26] oprofile: Remove oprofile_multiplexing_init() Robert Richter
2009-07-28 17:07 ` [PATCH 10/26] oprofile: Grouping multiplexing code in oprof.c Robert Richter
2009-07-28 17:07 ` [PATCH 11/26] oprofile: Introduce op_x86_phys_to_virt() Robert Richter
2009-07-28 17:07 ` [PATCH 12/26] oprofile: Grouping multiplexing code in op_model_amd.c Robert Richter
2009-07-28 17:07 ` [PATCH 13/26] x86/oprofile: Implement multiplexing setup/shutdown functions Robert Richter
2009-07-28 17:07 ` [PATCH 14/26] x86/oprofile: Moving nmi_setup_cpu_mux() in nmi_int.c Robert Richter
2009-07-28 17:07 ` [PATCH 15/26] x86/oprofile: Moving nmi_cpu_save/restore_mpx_registers() " Robert Richter
2009-07-28 17:07 ` [PATCH 16/26] x86/oprofile: Moving nmi_cpu_switch() " Robert Richter
2009-07-28 17:07 ` [PATCH 17/26] x86/oprofile: Remove const qualifier from struct op_x86_model_spec Robert Richter
2009-07-28 17:07 ` [PATCH 18/26] x86/oprofile: Remove unused num_virt_controls " Robert Richter
2009-07-28 17:07 ` [PATCH 19/26] x86/oprofile: Modify initialization of num_virt_counters Robert Richter
2009-07-28 17:07 ` [PATCH 20/26] x86/oprofile: Add function has_mux() to check multiplexing support Robert Richter
2009-07-28 17:07 ` [PATCH 21/26] x86/oprofile: Enable multiplexing only if the model supports it Robert Richter
2009-07-28 17:07 ` [PATCH 22/26] x86/oprofile: Implement mux_clone() Robert Richter
2009-07-28 17:07 ` [PATCH 23/26] oprofile: Adding switch counter to oprofile statistic variables Robert Richter
2009-07-28 17:07 ` [PATCH 24/26] x86/oprofile: Implement op_x86_virt_to_phys() Robert Richter
2009-07-28 17:07 ` [PATCH 25/26] x86/oprofile: Add counter reservation check for virtual counters Robert Richter
2009-07-28 17:07 ` [PATCH 26/26] x86/oprofile: Small coding style fixes Robert Richter
2009-07-28 18:45 ` [PATCH 0/26] oprofile: Performance counter multiplexing Andi Kleen
2009-07-28 22:18   ` Suthikulpanit, Suravee
2009-08-03 11:22 ` Ingo Molnar
2009-08-03 14:25   ` Arjan van de Ven
2009-08-04 20:11     ` Ingo Molnar
2009-08-05 12:35       ` Robert Richter
2009-08-06  7:31         ` Pekka Enberg
2009-08-06 10:51           ` Ingo Molnar
2009-08-13 16:13             ` Robert Richter [this message]
     [not found]           ` <20090806105134.GD11236__37984.4768475325$1249556453$gmane$org@elte.hu>
2010-02-26 14:51             ` Andi Kleen
2010-03-05 16:46               ` Robert Richter
2010-03-05 17:01                 ` Steven Rostedt
2010-03-08  3:51                 ` Andi Kleen
2009-08-03 16:30   ` Robert Richter
2009-08-04 17:05     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090813161340.GI9915@erda.amd.com \
    --to=robert.richter@amd.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=arjan@infradead.org \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=paulus@samba.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox