Re: [RFC PATCH] perf_counter: Add support for pinned and exclusivecounter groups

From: Ingo Molnar
Date: Thu Jan 15 2009 - 06:21:23 EST



* Paul Mackerras <paulus@xxxxxxxxx> wrote:

> Ingo Molnar writes:
>
> > (btw., the percpu allocation code seems to have bitrotten a bit - the
> > logic around perf_reserved_percpu looks wrong and somewhat complicated.)
>
> Yes, it has. I don't think it was ever fixed to apply only to hardware
> counters when software counters were added.
>
> Side question - were you intending to make the various software counters
> able to act as interrupting counters? That will mean e.g. that anything
> that increments current->maj_flt or current->min_flt (i.e.
> do_page_fault, __get_user_pages) will need to check if that causes any
> counter to overflow, which could be a bit invasive.

Yes, eventually my intention was to bring all the sw counters up to that
level, and allow system sampling via sw counter overflows. It's an
arguably powerful concept.

I first wanted to see where they all go though, and how many of them we
want, and how nuanced we want to make them.

Initially we can sample via __builtin_return_address(0) addresses, or
pt_regs(current)->rip or so. Later on we could use save_stack_trace()
perhaps, for a more vectored sample.

It would result in some rather cool kerneltop output: we could see a
profile of which functions generate pagefaults, or which places generate
context-switches, which places migrate a lot, etc.

> > Again, which restrictions users/developers are more willing to live
> > with will be shown in actual usage of these facilities.
>
> Indeed.

So my approach was always to have a good guess about what the best usage
pattern is, but also to not be rigid and ignore/exclude other usecases.
The main principle of this subsystem is to be maximally useful in
performance analysis, via modern and flexible abstractions. Pinning and
exclusivity fits into that just fine - they are mechanism to improve the
quality of the statistics.

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