Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543AbaJWHPo (ORCPT ); Thu, 23 Oct 2014 03:15:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14839 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144AbaJWHPn (ORCPT ); Thu, 23 Oct 2014 03:15:43 -0400 Date: Thu, 23 Oct 2014 09:14:49 +0200 From: Jiri Olsa To: Stephane Eranian Cc: LKML , Peter Zijlstra , "mingo@elte.hu" , "ak@linux.intel.com" , "Liang, Kan" , Borislav Petkov , Maria Dimakopoulou Subject: Re: [PATCH v2 05/12] perf/x86: add cross-HT counter exclusion infrastructure Message-ID: <20141023071448.GB3356@krava.brq.redhat.com> References: <1412872486-2930-1-git-send-email-eranian@google.com> <1412872486-2930-6-git-send-email-eranian@google.com> <20141022150712.GD15126@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 22, 2014 at 07:25:40PM +0200, Stephane Eranian wrote: > On Wed, Oct 22, 2014 at 5:07 PM, Jiri Olsa wrote: > > On Thu, Oct 09, 2014 at 06:34:39PM +0200, Stephane Eranian wrote: > >> From: Maria Dimakopoulou > >> > > > > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/