public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Anton Blanchard <anton@samba.org>
Cc: a.p.zijlstra@chello.nl, paulus@samba.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf_counter: Add alignment-faults and emulation-faults sw events
Date: Fri, 10 Jul 2009 11:37:57 +0200	[thread overview]
Message-ID: <20090710093757.GG27445@elte.hu> (raw)
In-Reply-To: <20090706120815.GC4391@kryten>


* Anton Blanchard <anton@samba.org> wrote:

> Add two software events that are common to many cpus:
> 
> Alignment faults: When a load or store is not aligned properly and 
> must be performed by the kernel.
> 
> Emulation faults: When an instruction must be emulated by the 
> kernel.
> 
> Both cause a very significant slowdown (potentially 100x or 
> worse), so identifying and fixing them is very important.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> 
> Index: linux.trees.git/include/linux/perf_counter.h
> ===================================================================
> --- linux.trees.git.orig/include/linux/perf_counter.h	2009-07-06 21:50:53.000000000 +1000
> +++ linux.trees.git/include/linux/perf_counter.h	2009-07-06 21:51:18.000000000 +1000
> @@ -102,6 +102,8 @@
>  	PERF_COUNT_SW_CPU_MIGRATIONS		= 4,
>  	PERF_COUNT_SW_PAGE_FAULTS_MIN		= 5,
>  	PERF_COUNT_SW_PAGE_FAULTS_MAJ		= 6,
> +	PERF_COUNT_SW_ALIGNMENT_FAULTS		= 7,
> +	PERF_COUNT_SW_EMULATION_FAULTS		= 8,

Looks useful.

I'm wondering about the enumeration space: in other cases when some 
simple event was further refined we went to add a new perf_type_id 
and a separate enumeration space, with no limits to extensibility. 
We'd have a new 'enum perf_sw_fault_id' space.

Page faults are special anyway, because they carry a 'data' 
(faulting address) sample as well.

So i'm wondering how a good, generic enumeration of all things page 
faults would look like. If we extend perf_sw_ids linearly we might 
lose some structure.

For example major versus minor might be a dimension (bit) in the 
enumeration space, so we'd have:

   { major | minor } x { native, unaligned, emulated }

This provides an advantage already: the current 'all' page faults 
counter would become the 'major|minor' case in the new enumeration.

We could still keep around the old events as well for some time, but 
the tools would use the new enumeration.

Hm?

	Ingo

  reply	other threads:[~2009-07-10  9:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 12:08 [PATCH] perf_counter: Add alignment-faults and emulation-faults sw events Anton Blanchard
2009-07-10  9:37 ` Ingo Molnar [this message]
2009-07-15 12:03   ` Anton Blanchard
2009-07-18  9:35     ` 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=20090710093757.GG27445@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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