<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic &amp;lt;quote&amp;gt; in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047858#M4758</link>
    <description>&lt;P&gt;&amp;lt;quote&amp;gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;the behavior is correct for one core per socket configurations&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;lt;/quote&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;on a system with many sockets how to find processor (socket) id of a core if the "physical id" is missing?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Roman&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jun 2015 11:21:00 GMT</pubDate>
    <dc:creator>Roman_D_Intel</dc:creator>
    <dc:date>2015-06-23T11:21:00Z</dc:date>
    <item>
      <title>isCoreOnline will always return false if /proc/cpuinfo doesn't print "physical id" and / or "core id"</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047853#M4753</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;just FYI:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;# ./pcm.x 1 -i=1&lt;/P&gt;

	&lt;P&gt;&amp;nbsp;Intel(r) Performance Counter Monitor V2.8 (2014-12-18 12:52:39 +0100 ID=ba39a89)&lt;/P&gt;

	&lt;P&gt;&amp;nbsp;Copyright (c) 2009-2014 Intel Corporation&lt;/P&gt;

	&lt;P&gt;Number of physical cores: 1&lt;BR /&gt;
		Number of logical cores: 2&lt;BR /&gt;
		Number of online logical cores: 2&lt;BR /&gt;
		Threads (logical cores) per physical core: 2&lt;BR /&gt;
		Num sockets: 1&lt;BR /&gt;
		Physical cores per socket: 1&lt;BR /&gt;
		Core PMU (perfmon) version: 1&lt;BR /&gt;
		Number of core PMU generic (programmable) counters: 4&lt;BR /&gt;
		Width of generic (programmable) counters: 48 bits&lt;BR /&gt;
		Nominal core frequency: 2800000000 Hz&lt;BR /&gt;
		Delay: 1&lt;/P&gt;

	&lt;P&gt;Detected Intel(R) Xeon(R) CPU X5660 @ 2.80GHz "Intel(r) microarchitecture codename Westmere/Clarkdale"&lt;BR /&gt;
		terminate called after throwing an instance of 'std::exception'&lt;BR /&gt;
		&amp;nbsp; what(): &amp;nbsp;std::exception&lt;BR /&gt;
		DEBUG: caught signal to interrupt (Aborted).&lt;BR /&gt;
		Cleaning up&lt;BR /&gt;
		&amp;nbsp;Zeroed PMU registers&lt;BR /&gt;
		&amp;nbsp;Freeing up all RMIDs&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;It turns out that isCoreOnline returned false for every processor because /proc/cpuinfo on this machine looked like:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;processor &amp;nbsp; &amp;nbsp; &amp;nbsp; : 0&lt;BR /&gt;
		vendor_id &amp;nbsp; &amp;nbsp; &amp;nbsp; : GenuineIntel&lt;BR /&gt;
		cpu family &amp;nbsp; &amp;nbsp; &amp;nbsp;: 6&lt;BR /&gt;
		model &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 37&lt;BR /&gt;
		model name &amp;nbsp; &amp;nbsp; &amp;nbsp;: Intel(R) Xeon(R) CPU &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X5660 &amp;nbsp;@ 2.80GHz&lt;BR /&gt;
		stepping &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 1&lt;BR /&gt;
		cpu MHz &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : 2799.204&lt;BR /&gt;
		cache size &amp;nbsp; &amp;nbsp; &amp;nbsp;: 12288 KB&lt;BR /&gt;
		fpu &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : yes&lt;BR /&gt;
		fpu_exception &amp;nbsp; : yes&lt;BR /&gt;
		cpuid level &amp;nbsp; &amp;nbsp; : 11&lt;BR /&gt;
		wp &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: yes&lt;BR /&gt;
		flags &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat&lt;BR /&gt;
		bogomips &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: 5598.40&lt;BR /&gt;
		clflush size &amp;nbsp; &amp;nbsp;: 64&lt;BR /&gt;
		cache_alignment : 64&lt;BR /&gt;
		address sizes &amp;nbsp; : 40 bits physical, 48 bits virtual&lt;BR /&gt;
		power management:&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;A simple workaround for this case was to replace:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;return (topology[os_core_id].os_id != -1) &amp;amp;&amp;amp; (topology[os_core_id].core_id != -1) &amp;amp;&amp;amp; (topology[os_core_id].socket != -1);&lt;/PRE&gt;

&lt;P&gt;with:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;return 1;&lt;/PRE&gt;

&lt;P&gt;But you might want to test for that case (if it is a supported configuration) and print a better error.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Valentin&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 08:41:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047853#M4753</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-22T08:41:18Z</dc:date>
    </item>
    <item>
      <title>thanks for the report. What</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047854#M4754</link>
      <description>&lt;P&gt;thanks for the report. What is the Linux kernel version you are running? I would like to learn why the physical ids / core ids are missing.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 09:13:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047854#M4754</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-06-23T09:13:28Z</dc:date>
    </item>
    <item>
      <title>Uhps, thought I posted that:</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047855#M4755</link>
      <description>&lt;P&gt;Uhps, thought I posted that:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;# uname -a&lt;BR /&gt;
		Linux foo 2.6.32.59-0.7-default #1 SMP 2012-07-13 15:50:56 +0200 x86_64 x86_64 x86_64 GNU/Linux&lt;/P&gt;

	&lt;P&gt;&amp;nbsp;&lt;/P&gt;

	&lt;P&gt;# cat /etc/SuSE-release&lt;BR /&gt;
		SUSE Linux Enterprise Server 11 (x86_64)&lt;BR /&gt;
		VERSION = 11&lt;BR /&gt;
		PATCHLEVEL = 1&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Two other machines with the same version of SLES / kernel did not exhibit the same behavior (cpuinfo did contain phys and core id). I don't have direct access to the systems, I just know that all 3 systems are on different HW,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;edit while writing: I was just told that this was a VM (on ESXi), even though I had asked to compile / test on physical HW only. This wouldn't have worked in any case (vPMC needs to be explicitly enabled for one) but now that it seems to be down to the presentation of the CPU by the virtual hardware, I can check internally why this is. I'll follow up.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Valentin&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:00:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047855#M4755</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-23T11:00:59Z</dc:date>
    </item>
    <item>
      <title>Valentin,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047856#M4756</link>
      <description>&lt;P&gt;Valentin,&lt;/P&gt;

&lt;P&gt;pcm needs access to performance monitoring units through MSR driver or through Linux perf (enable in the PCM Makefile). Providing this access is a challenge in a virtualized environment.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:11:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047856#M4756</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-06-23T11:11:53Z</dc:date>
    </item>
    <item>
      <title>Actually, according to the</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047857#M4757</link>
      <description>&lt;P&gt;Actually, according to the Linux source, the behavior is correct for one core per socket configurations. VMware virtual machines are per default created with coresPerSocket =1 and each additional vCPU increases the vSocket count, hence what we see here.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Valentin&lt;/P&gt;

&lt;P&gt;edit: P.S.&lt;BR /&gt;
	&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;This fails before MSRs are even read though, if vPMC is enabled for a VM with just one vCPU (on core / socket) it will still run into this exception.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:13:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047857#M4757</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-23T11:13:00Z</dc:date>
    </item>
    <item>
      <title>&lt;quote&gt;</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047858#M4758</link>
      <description>&lt;P&gt;&amp;lt;quote&amp;gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;the behavior is correct for one core per socket configurations&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;lt;/quote&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;on a system with many sockets how to find processor (socket) id of a core if the "physical id" is missing?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Roman&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:21:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047858#M4758</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-06-23T11:21:00Z</dc:date>
    </item>
    <item>
      <title>Generally PCM has some amount</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047859#M4759</link>
      <description>&lt;P&gt;Generally PCM has some assumptions with regards to uncore and socket topology that might be broken under virtualization (for example that each socket owns an own memory controller).&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:29:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047859#M4759</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-06-23T11:29:00Z</dc:date>
    </item>
    <item>
      <title>I wouldn't be able to answer</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047860#M4760</link>
      <description>&lt;P&gt;I wouldn't be able to answer that ... I'm just referring to:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;/*
 *	Get CPU information for use by the procfs.
 */
static void show_cpuinfo_core(struct seq_file *m, struct cpuinfo_x86 *c,
			      unsigned int cpu)
{
#ifdef CONFIG_SMP
	if (c-&amp;gt;x86_max_cores * smp_num_siblings &amp;gt; 1) {
		seq_printf(m, "physical id\t: %d\n", c-&amp;gt;phys_proc_id);
		seq_printf(m, "siblings\t: %d\n",
			   cpumask_weight(cpu_core_mask(cpu)));
		seq_printf(m, "core id\t\t: %d\n", c-&amp;gt;cpu_core_id);
		seq_printf(m, "cpu cores\t: %d\n", c-&amp;gt;booted_cores);
		seq_printf(m, "apicid\t\t: %d\n", c-&amp;gt;apicid);
		seq_printf(m, "initial apicid\t: %d\n", c-&amp;gt;initial_apicid);
	}
#endif
}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I'd guess directly from the APIC ID? But I really wouldn't know, not procfs as far as I can tell.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Valentin&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:39:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047860#M4760</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-23T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Quote:Roman Dementiev (Intel)</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047861#M4761</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Roman Dementiev (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Generally PCM has some assumptions with regards to uncore and socket topology that might be broken under virtualization (for example that each socket owns an own memory controller).&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I agree, VM sizing / vNUMA configuration matter a lot and should be made as equal to the underlying HW as possible + the vPMC modes and (e.g.) ESXi scheduling need to be understood.&amp;nbsp;https://labs.vmware.com/vmtj/methodology-for-performance-analysis-of-vmware-vsphere-under-tier-1-applications is a very good discussion regarding analysis on VMware VMs.&lt;/P&gt;

&lt;P&gt;All I'm saying is that it would still fail on a physical single core per socket system, if those still exist :-)&lt;/P&gt;

&lt;P&gt;However, it would be nice if PMC could detect that it is running on a VM an print a warning.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Valentin&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:45:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047861#M4761</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-23T11:45:52Z</dc:date>
    </item>
    <item>
      <title>you are right. We will</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047862#M4762</link>
      <description>&lt;P&gt;you are right. We will provide a special handling for such machines (probably someone still have them :-).&lt;/P&gt;

&lt;P&gt;Do you know how to reliably detect that the program is running on a VM?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roman&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 11:57:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047862#M4762</guid>
      <dc:creator>Roman_D_Intel</dc:creator>
      <dc:date>2015-06-23T11:57:00Z</dc:date>
    </item>
    <item>
      <title>We actually have it</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047863#M4763</link>
      <description>&lt;P&gt;We actually have it &lt;A href="http://kb.vmware.com/kb/1009458"&gt;documented &lt;/A&gt;for VMware VMs :-) &amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;For a more general approach I'd probably look at SMBIOS/DMI information, I found a good overview &lt;/SPAN&gt;&lt;A href="http://unix.stackexchange.com/questions/89714/easy-way-to-determine-virtualization-technology" style="font-size: 1em; line-height: 1.5;"&gt;here&lt;/A&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;There is of course the possibility that e.g. the native SMBIOS configuration is (partially) passed through from the host (or faked) but that is a very very rare case and only required for ancient software or other legacy reasons (or someone wants to hide the fact that something is running in a VM, who knows).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Note that thanks to technology like &lt;A href="http://kb.vmware.com/kb/2030221"&gt;vPMC &lt;/A&gt;(if enabled), many events can still be very beneficial. So please only warn that some counters might not be available due to configuration or availability of virtual hardware features / different from running on bare metal. (as opposed to to just exiting for example)&lt;/P&gt;

&lt;P&gt;Thanks for being so responsive to feedback!&lt;/P&gt;

&lt;P&gt;Valentin&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 12:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/isCoreOnline-will-always-return-false-if-proc-cpuinfo-doesn-t/m-p/1047863#M4763</guid>
      <dc:creator>Valentin_Bondzio</dc:creator>
      <dc:date>2015-06-23T12:19:00Z</dc:date>
    </item>
  </channel>
</rss>

