<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>Hi </div><div>I met a strange problem, I wrote a simple program that create some eventfds and add it to select loop, create a thread to write some bytes to a random eventfd, when i run 100 instances on a Intel E5-2650, mpstat shows that we have 95% idle of CPU, but when i run same 100 instances on a AMD Opteron(TM) Processor 6272, mpstat shows 50% on sys, 50% idle. Kernel version is Linux 2.6.32-279.el6.</div><div><br></div><div>The attachment is the source code of my test program.</div><div><br></div><div>Can someone  give any suggestion?? Thanks, :)</div><div><br></div><div>Bellow is the environment:</div><div>=============Intel E5-2650=============================</div><div>processor<span class="Apple-tab-span" style="white-space:pre">   </span>: 31</div><div>vendor_id<span class="Apple-tab-span" style="white-space:pre">        </span>: GenuineIntel</div><div>cpu family<span class="Apple-tab-span" style="white-space:pre">     </span>: 6</div><div>model<span class="Apple-tab-span" style="white-space:pre">             </span>: 45</div><div>model name<span class="Apple-tab-span" style="white-space:pre">       </span>: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz</div><div>stepping<span class="Apple-tab-span" style="white-space:pre">   </span>: 7</div><div>cpu MHz<span class="Apple-tab-span" style="white-space:pre">           </span>: 2000.149</div><div>cache size<span class="Apple-tab-span" style="white-space:pre"> </span>: 20480 KB</div><div>physical id<span class="Apple-tab-span" style="white-space:pre">        </span>: 1</div><div>siblings<span class="Apple-tab-span" style="white-space:pre">  </span>: 16</div><div>core id<span class="Apple-tab-span" style="white-space:pre">          </span>: 7</div><div>cpu cores<span class="Apple-tab-span" style="white-space:pre"> </span>: 8</div><div>apicid<span class="Apple-tab-span" style="white-space:pre">            </span>: 47</div><div>initial apicid<span class="Apple-tab-span" style="white-space:pre">   </span>: 47</div><div>fpu<span class="Apple-tab-span" style="white-space:pre">              </span>: yes</div><div>fpu_exception<span class="Apple-tab-span" style="white-space:pre">   </span>: yes</div><div>cpuid level<span class="Apple-tab-span" style="white-space:pre">     </span>: 13</div><div>wp<span class="Apple-tab-span" style="white-space:pre">               </span>: yes</div><div>flags<span class="Apple-tab-span" style="white-space:pre">           </span>: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid</div><div>bogomips<span class="Apple-tab-span" style="white-space:pre">       </span>: 3999.44</div><div>clflush size<span class="Apple-tab-span" style="white-space:pre">        </span>: 64</div><div>cache_alignment<span class="Apple-tab-span" style="white-space:pre">  </span>: 64</div><div>address sizes<span class="Apple-tab-span" style="white-space:pre">    </span>: 46 bits physical, 48 bits virtual</div><div>power management:</div><div><br></div><div><br></div><div>[root@OVP ~]# mpstat 2</div><div>Linux 2.6.32-279.el6.x86_64 (OVP.com) <span class="Apple-tab-span" style="white-space:pre">     </span>02/11/2014 <span class="Apple-tab-span" style="white-space:pre"> </span>_x86_64_<span class="Apple-tab-span" style="white-space:pre">    </span>(32 CPU)</div><div><br></div><div>08:57:40 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle</div><div>08:57:42 PM  all    0.24    0.00    0.24    0.00    0.00    0.00    0.00    0.02   99.50</div><div>08:57:44 PM  all    0.00    0.00    0.19    0.00    0.00    0.00    0.00    0.10   99.71</div><div>08:57:46 PM  all    0.19    0.00    0.29    0.00    0.00    0.00    0.00    0.02   99.50</div><div>08:57:48 PM  all    0.34    0.00    0.29    0.00    0.00    0.02    0.00    0.32   99.02</div><div><br></div><div><br></div><div>==================AMD Opteron(TM) Processor 6272=========================</div><div>processor       : 63</div><div>vendor_id       : AuthenticAMD</div><div>cpu family      : 21</div><div>model           : 1</div><div>model name      : AMD Opteron(TM) Processor 6272</div><div>stepping        : 2</div><div>cpu MHz         : 2100.089</div><div>cache size      : 2048 KB</div><div>physical id     : 3</div><div>siblings        : 16</div><div>core id         : 7</div><div>cpu cores       : 8</div><div>apicid          : 111</div><div>initial apicid  : 111</div><div>fpu             : yes</div><div>fpu_exception   : yes</div><div>cpuid level     : 13</div><div>wp              : yes</div><div>flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx</div><div> fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nonstop_tsc</div><div>extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave av</div><div>x lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skin</div><div>it wdt lwp fma4 nodeid_msr topoext perfctr_core cpb npt lbrv svm_lock nrip_save tsc_scale vmcb_cl</div><div>ean flushbyasid decodeassists pausefilter pfthreshold</div><div>bogomips        : 4199.79</div><div>TLB size        : 1536 4K pages</div><div>clflush size    : 64</div><div>cache_alignment : 64</div><div>address sizes   : 48 bits physical, 48 bits virtual</div><div>power management: ts ttp tm 100mhzsteps hwpstate cpb</div><div>amd TM 6272</div><div><br></div><div>09:43:11 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle</div><div>09:43:12 AM  all    2.42    0.00   53.37    0.00    0.00    0.03    0.00    0.43   43.74</div><div>09:43:13 AM  all    2.91    0.00   55.37    0.00    0.00    0.02    0.00    0.14   41.55</div><div>09:43:14 AM  all    2.34    0.00   55.60    0.00    0.00    0.02    0.00    0.19   41.85</div><div>09:43:15 AM  all    3.81    0.00   55.32    0.00    0.00    0.02    0.00    0.16   40.69</div><div>09:43:16 AM  all    2.63    0.00   54.53    0.00    0.00    0.02    0.00    0.13   42.70</div><div>09:43:17 AM  all    2.47    0.00   55.60    0.00    0.00    0.03    0.00    0.18   41.72</div><div>09:43:18 AM  all    2.50    0.00   55.64    0.00    0.00    0.02    0.00    0.18   41.67</div><div>09:43:19 AM  all    3.34    0.00   54.61    0.00    0.00    0.02    0.00    0.22   41.81</div><div>09:43:20 AM  all    2.39    0.00   55.21    0.00    0.00    0.02    0.00    0.18   42.20</div><div>09:43:21 AM  all    2.83    0.00   53.78    0.00    0.00    0.02    0.00    0.34   43.03</div><div>09:43:22 AM  all    2.63    0.00   53.96    0.00    0.00    0.02    0.00    0.24   43.15</div><div><br></div><div>====Perf on AMD=====:</div><div>-  25.64%  [kernel]                    [k] fget_light                                               </div><div>   - fget_light                                                                                  </div><div>      - 96.65% do_select                                                                        </div><div>           core_sys_select                                                                     </div><div>           sys_select                                                                          </div><div>           system_call_fastpath                                                                </div><div>         - __select                                                                           </div><div>              99.98% __libc_start_main                                                                                                         </div><div>      - 2.39% core_sys_select                                                                 </div><div>           sys_select                                                                          </div><div>           system_call_fastpath                                                                </div><div>         - __select                                                                            </div><div>              100.00% __libc_start_main                                                        </div><div>-  15.88%  [kernel]                    [k] _spin_lock_irqsave                                  </div><div>   - _spin_lock_irqsave                                                                        </div><div>      - 46.50% eventfd_poll                                                                    </div><div>           do_select                                                                           </div><div>           core_sys_select                                                                     </div><div>           sys_select                                                                          </div><div>           system_call_fastpath                                                               </div><div>         - __select                                                                           </div><div>              99.97% __libc_start_main                                                        </div><div>      + 26.00% add_wait_queue                                                                 </div><div>      + 21.97% remove_wait_queue                                                              </div><div>      + 2.64% do_select                                                                      </div><div>      + 1.32% __pollwait                                                                     </div><div>      + 1.10% free_poll_entry                                                                </div><div>+   9.89%  [kernel]                    [k] _spin_unlock_irqrestore                           </div><div>+   8.09%  [kernel]                    [k] fput                                               </div><div>+   4.79%  [kernel]                    [k] __pollwait                                        </div><div>+   3.64%  [kernel]                    [k] do_select                                         </div><div>+   2.78%  [kernel]                    [k] eventfd_poll                                       </div><div>+   2.16%  [kernel]                    [k] list_del                                           </div><div>+   2.13%  efd_test2                   [.] main                                              </div><div>+   1.87%  [kernel]                    [k] __list_add</div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"><span title="neteasefooter"><span id="netease_mail_footer"><a href="#" target="_blank"></a></span></span>
</span></span>