[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100311115214.GD31354@elte.hu>
Date: Thu, 11 Mar 2010 12:52:14 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Stephane Eranian <eranian@...gle.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
paulus@...ba.org, fweisbec@...il.com, perfmon2-devel@...ts.sf.net,
robert.richter@....com, eranian@...il.com, davem@...emloft.net,
Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: Re: [PATCH] perf_events: add sampling period randomization support
(v2)
* Stephane Eranian <eranian@...gle.com> wrote:
> On Thu, Mar 4, 2010 at 1:13 PM, Ingo Molnar <mingo@...e.hu> wrote:
> >
> > * Stephane Eranian <eranian@...gle.com> wrote:
> >
> >> On Thu, Mar 4, 2010 at 3:32 AM, Ingo Molnar <mingo@...e.hu> wrote:
> >> >
> >> > * eranian@...gle.com <eranian@...gle.com> wrote:
> >> >
> >> >> This patch adds support for randomizing the sampling period. ??Randomization
> >> >> is very useful to mitigate the bias that exists with sampling. The random
> >> >> number generator does not need to be sophisticated. This patch uses the
> >> >> builtin random32() generator.
> >> >
> >> >> + ?? ?? if (width > 63 || attr->freq)
> >> >> + ?? ?? ?? ?? ?? ?? return -EINVAL;
> >> >
> >> > Why not for freq counters? Those are semi-randomized already, but it might
> >> > make sense to make them 'more' randomized in special circumstances. That would
> >> > also allow us to enable the randomization in perf top and perf record, by
> >> > default.
> >> >
> >>
> >> What's the goal of freq?
> >> Achieve and maintain the target interrupt/rate.
> >> In doing so, it has to adjust the period (not randomly).
> >
> > No, the goal of auto-freq is to keep a steady average rate of sampling.
>
> rate of samples = rate of interrupts (if period < 32 bits on Intel).
What's your point? I corrected your statement which said that the goal of
auto-freq was to maintain a target interrupt-rate and as such wouldnt be
randomizable. So i said that auto-freq is slightly different from that: it
provides a steady _average_ rate, and as such small amounts of randomization
'fuzz' could still be injected - the auto-freq system would auto-correct the
effects of that.
Think of it as a dynamic steady-state equilibrium with noise injected. If the
noise isnt too brutal and the system can adapt, the average sampling rate
doesnt change.
> > There is no requirement to keep it 'steady' - each sample comes with a
> > specific weight.
> >
> >> Randomization may prevent achieving the rate, or it may slow it down.
> >> What's the value add of that?
> >
> > Why do you assume that the two are incompatible? We can randomize
> > auto-freq and still have a perfectly stable average rate.
>
> What would that buy you compared to what you already have?
The same goal as randomization in general: to decrease the chance for sampling
artifacts that can occur due to the sampling frequency oscillating together
with some internal workload parameter, skewing the sample.
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