lkml.org 
[lkml]   [2014]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 05/12] perf/x86: add cross-HT counter exclusion infrastructure
On Wed, Oct 22, 2014 at 07:25:40PM +0200, Stephane Eranian wrote:
> On Wed, Oct 22, 2014 at 5:07 PM, Jiri Olsa <jolsa@redhat.com> wrote:
> > On Thu, Oct 09, 2014 at 06:34:39PM +0200, Stephane Eranian wrote:
> >> From: Maria Dimakopoulou <maria.n.dimakopoulou@gmail.com>
> >>
> >
> > SNIP
> >
> >> +struct intel_excl_cntrs *allocate_excl_cntrs(int cpu)
> >> +{
> >> + struct intel_excl_cntrs *c;
> >> + int i;
> >> +
> >> + c = kzalloc_node(sizeof(struct intel_excl_cntrs),
> >> + GFP_KERNEL, cpu_to_node(cpu));
> >> + if (c) {
> >> + spin_lock_init(&c->lock);
> >> + for (i = 0; i < X86_PMC_IDX_MAX; i++) {
> >> + c->states[0].state[i] = INTEL_EXCL_UNUSED;
> >> + c->states[0].init_state[i] = INTEL_EXCL_UNUSED;
> >> +
> >> + c->states[1].state[i] = INTEL_EXCL_UNUSED;
> >> + c->states[1].init_state[i] = INTEL_EXCL_UNUSED;
> >
> > 'c' is allocated with kzalloc_node, seems there's no need
> > to re-initialize states it to zero again with INTEL_EXCL_UNUSED
> >
> You are assuming that INTEL_EXCL_UNUSED=0 always.
> That means it needs to be clear there is a dependency here.

it's 0 explicitly:

enum intel_excl_state_type {
INTEL_EXCL_UNUSED = 0, /* counter is unused */

but it's not big issue for me.. just curious ;-)

jirka


\
 
 \ /
  Last update: 2014-10-23 09:41    [W:0.059 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site