<?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 Performance lost due to context switching by kernel in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Performance-lost-due-to-context-switching-by-kernel/m-p/786107#M466</link>
    <description>&lt;DIV id="_mcePaste"&gt;I am working on a C++ application that has to process data in real-time. The application uses Intel TBB's pipeline pattern for parallel processing of data. The application has multiple pipelines each with single token to process data.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;I built this application with ICC and started performance measurements using vTune Amplifier. During the general exploration, I noticed that vTune Amplifier always reported high CPI and issues with the final_task_switch() function in vmlinux module.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Does this mean that kernel is spending too much time context swapping? Can anyone provide me suggestions on how to tackle this performance reducing behaviour.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Appreciate your help.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Regards,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Vishal&lt;/DIV&gt;</description>
    <pubDate>Sun, 27 Nov 2011 18:28:11 GMT</pubDate>
    <dc:creator>Vishal_Sharma</dc:creator>
    <dc:date>2011-11-27T18:28:11Z</dc:date>
    <item>
      <title>Performance lost due to context switching by kernel</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Performance-lost-due-to-context-switching-by-kernel/m-p/786107#M466</link>
      <description>&lt;DIV id="_mcePaste"&gt;I am working on a C++ application that has to process data in real-time. The application uses Intel TBB's pipeline pattern for parallel processing of data. The application has multiple pipelines each with single token to process data.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;I built this application with ICC and started performance measurements using vTune Amplifier. During the general exploration, I noticed that vTune Amplifier always reported high CPI and issues with the final_task_switch() function in vmlinux module.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Does this mean that kernel is spending too much time context swapping? Can anyone provide me suggestions on how to tackle this performance reducing behaviour.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Appreciate your help.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Regards,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;Vishal&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Nov 2011 18:28:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Performance-lost-due-to-context-switching-by-kernel/m-p/786107#M466</guid>
      <dc:creator>Vishal_Sharma</dc:creator>
      <dc:date>2011-11-27T18:28:11Z</dc:date>
    </item>
    <item>
      <title>Performance lost due to context switching by kernel</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Performance-lost-due-to-context-switching-by-kernel/m-p/786108#M467</link>
      <description>Hello Vishal,&lt;BR /&gt;sorry I missed this entry.&lt;BR /&gt;Are you still interested in following up?&lt;BR /&gt;If final_task_switch() is part of a context switch, it may well be doing expensive instructions which have a high CPI.&lt;BR /&gt;It doesn't necessarily mean that you are spending too much time in context switching.&lt;BR /&gt;&lt;BR /&gt;I would probably back up a level and gather some general stats.&lt;BR /&gt;See &lt;A href="http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html"&gt;http://www.cyberciti.biz/tips/how-do-i-find-out-linux-cpu-utilization.html&lt;/A&gt; for "How do I Find Out Linux CPU Utilization?". &lt;BR /&gt;It is very general but if 'top', 'vmstat' and 'sar' show your app is using 90-99% of the cpu, then the context switchesprobably aren't hurting you.&lt;BR /&gt;sar and mpstat (part of the great sysstat utilities)can report context switches per second per process (or maybe thread).&lt;BR /&gt;&lt;BR /&gt;Then, if you REALLY want to dig into the details, you can do linux kernel tracing with the context switch event group which will show you each context along with a reason for the context switch. This can be tons of data.&lt;BR /&gt;&lt;BR /&gt;The linux kernel trace info will let you see each process/thread switching in/out on each cpu but it won't tell you what instructions the thread was running on the cpu.&lt;BR /&gt;Other linux tracing events can tell you kernel tasks that the thread was doing (like allocations, IOs, system calls).&lt;BR /&gt;&lt;BR /&gt;Hope this helps and sorry for the delay in response.&lt;BR /&gt;Pat</description>
      <pubDate>Sat, 24 Dec 2011 03:48:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Performance-lost-due-to-context-switching-by-kernel/m-p/786108#M467</guid>
      <dc:creator>Patrick_F_Intel1</dc:creator>
      <dc:date>2011-12-24T03:48:36Z</dc:date>
    </item>
  </channel>
</rss>

