<?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>i.MX ProcessorsのトピックRe: Re: Can I designate a core to excute code?</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322852#M43180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luis,&lt;/P&gt;&lt;P&gt;Have you tried this?&lt;/P&gt;&lt;P&gt;I need to do this exact thing, but it doesn't quite work as I think it should...&lt;/P&gt;&lt;P&gt;I'm running with an iMX6Dual.&lt;/P&gt;&lt;P&gt;I want to put *everything* on core 0.&lt;/P&gt;&lt;P&gt;Then bring up one thread and set its affinity to core1.&lt;/P&gt;&lt;P&gt;So, in my kernel command line I add:&amp;nbsp; ... isolcpus=1... to isolate core 1&lt;/P&gt;&lt;P&gt;And in the thread I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu_set_t mask;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU_ZERO(&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU_SET(1,&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sched_setaffinity(0,sizeof(mask),&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to push it onto core 1; however, later I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;printf("taskCore1 started (cpu=%d)\n",sched_getcpu());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it tells me I'm on core 0. &lt;/P&gt;&lt;P&gt;Note if I don't include "isolcpus=1" on the command line, then this does&lt;/P&gt;&lt;P&gt;put that thread on core 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what's wrong here?&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2014 17:18:43 GMT</pubDate>
    <dc:creator>EdSutter</dc:creator>
    <dc:date>2014-08-26T17:18:43Z</dc:date>
    <item>
      <title>Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322849#M43177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use i.MX6 dual in Linux and want to seperate tasks each cores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then is it possible to designate a core to excute codes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, UART0 is running in core 0 and UART1 is running in core 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 09:52:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322849#M43177</guid>
      <dc:creator>JHY</dc:creator>
      <dc:date>2014-07-21T09:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322850#M43178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaehee&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in Linux kernel takes all task for multiprocessing,&lt;/P&gt;&lt;P&gt;not leaving chance to change smth, you can not change its behaviour.&lt;/P&gt;&lt;P&gt;So trying to implement this seemingly simple task will bring you&lt;/P&gt;&lt;P&gt;to jungles of kernel programming&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.linux-tutorial.info/modules.php?name=Howto&amp;amp;pagename=SMP-HOWTO/SMP-HOWTO-3.html#ss3.4" title="http://www.linux-tutorial.info/modules.php?name=Howto&amp;amp;pagename=SMP-HOWTO/SMP-HOWTO-3.html#ss3.4"&gt;Linux Knowledge Base and Tutorial&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However in SDK you will find such example, described in&lt;/P&gt;&lt;P&gt;Chapter 3 "Multicore Startup" document iMX6_Firmware_Guide.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&amp;amp;nodeId=018rH3ZrDRB24A&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;i.MX 6Series Platform SDK&lt;/A&gt; &lt;IMG alt="" class="jiveImage" src="http://www.freescale.com/files/graphic/SECURITYINFOIMAGE.gif" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;chip&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 13:19:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322850#M43178</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2014-07-21T13:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322851#M43179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN lang="ES-TRAD" style="mso-ansi-language:ES-TRAD"&gt;Hello&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="ES-TRAD" style="mso-ansi-language:ES-TRAD"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="ES-TRAD" style="mso-ansi-language:ES-TRAD"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You could try "&lt;SPAN&gt;isolcpus&lt;/SPAN&gt;” kernel parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/re46.html"&gt;http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/re46.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could isolate a CPU. Then a threat can be assigned to that core using &lt;SPAN&gt;&lt;SPAN class="GramE"&gt;cpu&lt;/SPAN&gt;&lt;/SPAN&gt; affinity to run the process on this core and IRQ affinity to freeze the isolated core of managing &lt;SPAN&gt;irq's&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jul 2014 15:57:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322851#M43179</guid>
      <dc:creator>LuisCasado</dc:creator>
      <dc:date>2014-07-21T15:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322852#M43180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Luis,&lt;/P&gt;&lt;P&gt;Have you tried this?&lt;/P&gt;&lt;P&gt;I need to do this exact thing, but it doesn't quite work as I think it should...&lt;/P&gt;&lt;P&gt;I'm running with an iMX6Dual.&lt;/P&gt;&lt;P&gt;I want to put *everything* on core 0.&lt;/P&gt;&lt;P&gt;Then bring up one thread and set its affinity to core1.&lt;/P&gt;&lt;P&gt;So, in my kernel command line I add:&amp;nbsp; ... isolcpus=1... to isolate core 1&lt;/P&gt;&lt;P&gt;And in the thread I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu_set_t mask;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU_ZERO(&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU_SET(1,&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sched_setaffinity(0,sizeof(mask),&amp;amp;mask);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to push it onto core 1; however, later I run:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;printf("taskCore1 started (cpu=%d)\n",sched_getcpu());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it tells me I'm on core 0. &lt;/P&gt;&lt;P&gt;Note if I don't include "isolcpus=1" on the command line, then this does&lt;/P&gt;&lt;P&gt;put that thread on core 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea what's wrong here?&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 17:18:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322852#M43180</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2014-08-26T17:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322853#M43181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, nevermind, I'm a moron...&lt;/P&gt;&lt;P&gt;I had misplaced one line in the code.&lt;/P&gt;&lt;P&gt;If I actually had used the code that I show above it would have worked.&lt;/P&gt;&lt;P&gt;I add this comment instead of deleting the previous reply I made because it may be useful to someone else.&lt;/P&gt;&lt;P&gt;:-(&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 17:26:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322853#M43181</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2014-08-26T17:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322854#M43182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try building this code: &lt;A href="http://people.seas.harvard.edu/~apw/stress/" target="test_blank"&gt;http://people.seas.harvard.edu/~apw/stress/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With standard parameters you should get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;./stress -c 4 &amp;amp;&lt;/P&gt;&lt;P&gt;top&lt;/P&gt;&lt;P&gt;CPU0: 99.2% usr 0.7% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU1: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU2: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU3: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With isolcpus=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mem: 57632K used, 708340K free, 0K shrd, 3512K buff, 15920K cached&lt;/P&gt;&lt;P&gt;CPU0: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU1: 0.0% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU2: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU3: 99.6% usr 0.3% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And  with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;taskset 2 ./stress -c 4 &amp;amp;&lt;/P&gt;&lt;P&gt;top&lt;/P&gt;&lt;P&gt;Mem: 58320K used, 707652K free, 0K shrd, 3784K buff, 15920K cached&lt;/P&gt;&lt;P&gt;CPU0: 0.0% usr 1.0% sys 0.0% nic 98.9% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU1: 100% usr 0.0% sys 0.0% nic 0.0% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU2: 0.0% usr 0.0% sys 0.0% nic 100% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;CPU3: 0.0% usr 0.0% sys 0.0% nic 100% idle 0.0% io 0.0% irq 0.0% sirq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case with 2 cores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;P&gt;This email and any associated attachments have been classified as&lt;/P&gt;&lt;P&gt; Freescale General Business&lt;/P&gt;&lt;P&gt; Freescale Internal Use Only&lt;/P&gt;&lt;P&gt; Freescale Confidential Proprietary&lt;/P&gt;&lt;P&gt;"All types of technical support (Schematic review, layout review, software review, hardware board and software) provided by Freescale Field application team are subject to Freescale's general Terms and Conditions unless superseded by a direct contract".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 18:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322854#M43182</guid>
      <dc:creator>LuisCasado</dc:creator>
      <dc:date>2014-08-26T18:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can I designate a core to excute code?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322855#M43183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Luis,&lt;/P&gt;&lt;P&gt;once I realized the mistake I made (and fixed it), everything worked as expected.&lt;/P&gt;&lt;P&gt;Ed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 19:32:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-I-designate-a-core-to-excute-code/m-p/322855#M43183</guid>
      <dc:creator>EdSutter</dc:creator>
      <dc:date>2014-08-26T19:32:02Z</dc:date>
    </item>
  </channel>
</rss>

