lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 May 2015 18:41:17 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Robert Bragg <robert@...bynine.org>,
	intel-gfx@...ts.freedesktop.org,
	Daniel Vetter <daniel.vetter@...el.com>,
	Jani Nikula <jani.nikula@...ux.intel.com>,
	David Airlie <airlied@...ux.ie>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
	linux-api@...r.kernel.org
Subject: Re: [RFC PATCH 00/11] drm/i915: Expose OA metrics via perf PMU


* Peter Zijlstra <peterz@...radead.org> wrote:

> > As it is currently the kernel doesn't need to know anything about the 
> > semantics of individual counters being selected, so it's currently convenient 
> > that we can aim to maintain all the counter meta data we have in userspace 
> > according to the changing needs of tools or drivers (e.g. names, descriptions, 
> > units, max values, normalization equations), de-coupled from the kernel, 
> > instead of splitting it between the kernel and userspace.
> 
> And that fully violates the design premise of perf. The kernel should be in 
> control of resources, not userspace.
> 
> If we'd have put userspace in charge, we could now not profile the same task by 
> two (or more) different observers. But with kernel side counter management that 
> is no problem at all.

Beyond that there are a couple of other advantages of managing performance metrics 
via the kernel:

2)

Per task/workload/user separation of events, for example you can do:

	perf record make bzImage
        perf stat make bzImage

These will only profile/count in the child task hierarchy spawned by the shell. 
Multiple such sessions can be started and the perf sampling/counting of the 
separate workloads is independent of each other.

3)

Finegrained security model: you can chose which events to expose to what privilege 
levels. You can also work around hardware bugs without complicating tooling.

4)

Seemless integration of the various PMU and other event metrics with each other: 
you can start a CPU PMU event, a trace event, a software event and an uncore 
event, which all output into the same coherent, ordered ring-buffer, timestamped 
and correlated consistently, etc.

5)

The unified event model on the kernel side also brings with itself 100 KLOC of 
rich, unified tooling in tools/perf/, which tries to keep it all together and 
functional.

================

The cost of all that is having to implement kernel support for it, but once that 
initial hurdle is taken, it's well worth it! A PMU driver can be as simple as 
offering only a single system-wide counter.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ