<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 20, 2018 at 1:23 AM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 12/08/18 00:41, Chris Johns wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/08/2018 22:30, Sebastian Huber wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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" rel="noreferrer" target="_blank">https://docs.rtems.org/branche<wbr>s/master/c-user/configuring_a_<wbr>system.html#clustered-<wbr>scheduler-configuration</a><br>
<br>
</blockquote>
I had a brief look over the documentation you provided but could not see how to<br>
achieve the result you are saying.<br>
</blockquote>
<br></span>
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" rel="noreferrer" target="_blank">https://docs.rtems.org/branche<wbr>s/master/c-user/configuring_a_<wbr>system.html#classic-api-<wbr>initialization-tasks-table-<wbr>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.<br></blockquote><div><br></div><div>The high priority constructor is too late if the goal is to avoid any activity except core 0.</div><div><br></div><div>

<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">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></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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.</blockquote><div><br></div><div>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. </div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Alternatively, on a recent version the default SMP scheduler supports a one-to-one affinity.  You can set it in a device driver.<br>
</blockquote>
Is there an example of how to do this?<br></blockquote></div></div></blockquote><div><br></div><div>As Sebastian points out, you can't do it in a device driver. But no, there is no example specifically for the Init thread.</div><div>There are smptests which do this but likely no proper example of setting affinity, scheduler, etc.</div><div><br></div><div>--joel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Chris<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
----- Am 10. Aug 2018 um 14:10 schrieb Passas, Stavros <a href="mailto:stavros.passas@intel.com" target="_blank">stavros.passas@intel.com</a>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
------------------------------<wbr>------------------------------<wbr>--<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>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a><br>
</blockquote>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a><br>
</blockquote>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : +49 89 189 47 41-16<br>
Fax     : +49 89 189 47 41-09<br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brain<wbr>s.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a></div></div></blockquote></div><br></div></div>