All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	"Yan, Zheng" <zheng.z.yan@intel.com>,
	Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH v3 4/4] perf,x86: add RAPL hrtimer support
Date: Sat, 26 Oct 2013 19:53:05 +0200	[thread overview]
Message-ID: <20131026175305.GE1069@krava.brq.redhat.com> (raw)
In-Reply-To: <CABPqkBTKec0T0NDFUoC8qDVO9stACkzc2xnUqwx6yODHXKaYTg@mail.gmail.com>

On Sat, Oct 26, 2013 at 07:07:06PM +0200, Stephane Eranian wrote:
> On Fri, Oct 25, 2013 at 7:44 PM, Jiri Olsa <jolsa@redhat.com> wrote:
> > On Wed, Oct 23, 2013 at 02:58:05PM +0200, Stephane Eranian wrote:

SNIP

> >> +     list_for_each_entry(event, &pmu->active_list, active_entry) {
> >> +             rapl_event_update(event);
> >> +     }
> >
> > hi,
> > I dont fully understand the reason for the timer,
> > I'm probably missing something..
> >
> The reason is rather simple and is similar to what happens with uncore.
> The counter are narrow, 32-bit and there is no interrupt capability. We
> need to poll the counters and accumulate in the sw counter to avoid missing
> an overflow.
> 
> > - the timer calls rapl_event_update for all defined events
> 
> No, only for the defined RAPL events which is what we want.

ok, that's what I meant

> 
> > - but rapl_pmu_event_read calls rapl_event_update any time the
> >   event is read (sys_read)
> >
> Yes, but we want to prevent missing a counter overflow. It may happen
> if the counter counts in a unit which increments fast.
> 
> > The rapl_event_update only read msr and updates
> > event->count|hw,prev_count.
> No, it does update the count:
>         local64_add(sdelta, &event->count);

ah, there's the shift that takes care of the
overflowed msr value.. ok

thanks,
jirka

  reply	other threads:[~2013-10-26 17:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 12:58 [PATCH v3 0/4] perf,x86: add Intel RAPL PMU support Stephane Eranian
2013-10-23 12:58 ` [PATCH v3 1/4] perf: add active_entry list head to struct perf_event Stephane Eranian
2013-10-25 14:56   ` Jiri Olsa
2013-10-26 16:57     ` Stephane Eranian
2013-10-26 17:44       ` Jiri Olsa
2013-10-28  9:58         ` Stephane Eranian
2013-10-23 12:58 ` [PATCH v3 2/4] perf stat: add event unit and scale support Stephane Eranian
2013-10-23 12:58 ` [PATCH v3 3/4] perf,x86: add Intel RAPL PMU support Stephane Eranian
2013-10-25 11:13   ` Jiri Olsa
2013-10-25 11:13   ` Jiri Olsa
2013-10-25 11:14   ` Jiri Olsa
2013-10-26 17:00     ` Stephane Eranian
2013-10-28 10:33       ` Stephane Eranian
2013-10-28 12:17         ` Peter Zijlstra
2013-10-28 15:54           ` Stephane Eranian
2013-10-23 12:58 ` [PATCH v3 4/4] perf,x86: add RAPL hrtimer support Stephane Eranian
2013-10-25 17:44   ` Jiri Olsa
2013-10-26 17:07     ` Stephane Eranian
2013-10-26 17:53       ` Jiri Olsa [this message]
2013-10-28  9:55         ` Stephane Eranian

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=20131026175305.GE1069@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=zheng.z.yan@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.