<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi all,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">My main objective was to have a way to run the rtems testsuite and have a script auto-compare the results with the corresponding scn file.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Currently, just because core0 starts core1, seems like core1 always starts Init(), all results are flipped, thus this process cannot be automated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Functionality wise, everything runs as expected, I verified individually each core with the debugger, so I am ok with it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Also, this issue comes up in a different form also when the applications exits, because core1 (that had started Init(), exits with the expected return code, while
 all other cores terminate with RTEMS_FATAL_SOURCE_SMP/SMP_FATAL_SHUTDOWN_RESPONSE, which is handled as an error at the moment from the debugger/loader. For the moment I have added a fatal extension handler to avoid this case, but I am still looking if there
 is any better solution.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Best Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">   Stavros<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> users [mailto:users-bounces@rtems.org]
<b>On Behalf Of </b>Joel Sherrill<br>
<b>Sent:</b> Monday, August 20, 2018 5:39 PM<br>
<b>To:</b> Sebastian Huber <sebastian.huber@embedded-brains.de><br>
<b>Cc:</b> rtems-users@rtems.org <users@rtems.org><br>
<b>Subject:</b> Re: SMP related question<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Aug 20, 2018 at 1:23 AM, Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
<br>
On 12/08/18 00:41, Chris Johns wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">On 10/08/2018 22:30, Sebastian Huber wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello Stavros,<br>
<br>
you can do this with a custom clustered scheduler configuration:<br>
<br>
<a href="https://docs.rtems.org/branches/master/c-user/configuring_a_system.html#clustered-scheduler-configuration" target="_blank">https://docs.rtems.org/branches/master/c-user/configuring_a_system.html#clustered-scheduler-configuration</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal">I had a brief look over the documentation you provided but could not see how to<br>
achieve the result you are saying.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
Stavros, asked for two things.<br>
<br>
1. A way to change properties of the initialization task which are not covered by configuration options<br>
<br>
<a href="https://docs.rtems.org/branches/master/c-user/configuring_a_system.html#classic-api-initialization-tasks-table-configuration" target="_blank">https://docs.rtems.org/branches/master/c-user/configuring_a_system.html#classic-api-initialization-tasks-table-configuration</a><br>
<br>
before the initialization task runs. To do this some user provided code must execute after the initialization task is created and before it runs. My suggestion to use a device driver initialization function for this doesn't work. The initialization task is
 created after the device driver initialization. It can be done via a system initialization handler using the undocumented RTEMS_SYSINIT_ITEM(). Maybe also a high priority constructor, however, in this case the task already runs.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The high priority constructor is too late if the goal is to avoid any activity except core 0.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="background:white">RTEMS_SYSINIT_ITEM() would work but adding a confdefs.h item for SMP configurations to pin the thread to a single core seems like a simple solution.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
2. A way to pin a task to a particular processor. There are two options to do this in RTEMS. One is a clustered scheduler configuration, the other is the use of a thread to processor affinity.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think being able to pin the Init thread to a single core would be a nice confdefs.h feature. Not specifying a full cpuset, just the core number. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I don't think this use case is enough by itself to force a user to clustered scheduling with core 0 an instance by itself.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><o:p> </o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Alternatively, on a recent version the default SMP scheduler supports a one-to-one affinity.  You can set it in a device driver.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal">Is there an example of how to do this?<o:p></o:p></p>
</blockquote>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As Sebastian points out, you can't do it in a device driver. But no, there is no example specifically for the Init thread.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">There are smptests which do this but likely no proper example of setting affinity, scheduler, etc.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--joel<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
Chris<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt">----- Am 10. Aug 2018 um 14:10 schrieb Passas, Stavros
<a href="mailto:stavros.passas@intel.com" target="_blank">stavros.passas@intel.com</a>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Hi,<br>
<br>
In my local SMP enabled RTEMS, I notice core1 starting the Init() function of<br>
the user application.<br>
Is there a way to enforce RTEMS to run the Init() in the boot processor, when<br>
SMP is enabled?<br>
<br>
Best Regards,<br>
   Stavros<br>
--------------------------------------------------------------<br>
Intel Research and Development Ireland Limited<br>
Registered in Ireland<br>
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare<br>
Registered Number: 308263<br>
<br>
<br>
This e-mail and any attachments may contain confidential material for the sole<br>
use of the intended recipient(s). Any review or distribution by others is<br>
strictly prohibited. If you are not the intended recipient, please contact the<br>
sender and delete all copies.<br>
<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt">_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal">_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><span class="hoenzb"><span style="color:#888888">-- </span></span><span style="color:#888888"><br>
<span class="hoenzb">Sebastian Huber, embedded brains GmbH</span><br>
<br>
<span class="hoenzb">Address : Dornierstr. 4, D-82178 Puchheim, Germany</span><br>
<span class="hoenzb">Phone   : +49 89 189 47 41-16</span><br>
<span class="hoenzb">Fax     : +49 89 189 47 41-09</span><br>
<span class="hoenzb">E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">
sebastian.huber@embedded-brains.de</a></span><br>
<span class="hoenzb">PGP     : Public key available on request.</span><br>
<br>
<span class="hoenzb">Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.</span></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p>--------------------------------------------------------------<br>
Intel Research and Development Ireland Limited<br>
Registered in Ireland<br>
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare<br>
Registered Number: 308263</p>


<p>This e-mail and any attachments may contain confidential material for the
sole use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.</p>

<p></p>
</body>
</html>