From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934423AbdBQPF7 (ORCPT ); Fri, 17 Feb 2017 10:05:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59456 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934139AbdBQPFz (ORCPT ); Fri, 17 Feb 2017 10:05:55 -0500 Date: Fri, 17 Feb 2017 16:05:52 +0100 From: Jiri Olsa To: Jan Stancek Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@kernel.org, mhiramat@kernel.org Subject: Re: [PATCH v3 3/3] perf: replace _SC_NPROCESSORS_CONF with max_present_cpu in cpu_topology_map Message-ID: <20170217150552.GA14510@krava> References: <8ea4601b5cacc49927235b4ebac424bd6eeccb06.1487146877.git.jstancek@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 17 Feb 2017 15:05:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2017 at 12:10:26PM +0100, Jan Stancek wrote: SNIP > - int cpu_nr = ph->env.nr_cpus_online; > + int cpu_nr = ph->env.nr_cpus_avail; > > nr = ph->env.nr_sibling_cores; > str = ph->env.sibling_cores; > @@ -1792,7 +1786,7 @@ static int process_cpu_topology(struct perf_file_section *section, > u32 nr, i; > char *str; > struct strbuf sb; > - int cpu_nr = ph->env.nr_cpus_online; > + int cpu_nr = ph->env.nr_cpus_avail; > u64 size = 0; > > ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); > @@ -1873,7 +1867,7 @@ static int process_cpu_topology(struct perf_file_section *section, > if (ph->needs_swap) > nr = bswap_32(nr); > > - if (nr > (u32)cpu_nr) { > + if (nr != (u32)-1 && nr > (u32)cpu_nr) { could you please add a comment here exaplaining the reason for possible -1 in here.. other than that it's ok, for the series: Acked-by: Jiri Olsa thanks, jirka