I just stumbled upon an idea (yet untested) to improve latency with RT_PREEMPT 
on multicore cpu's like the atom

this assumes that rtapi_app in sim mode (plus hal_parport in usermode) will be 
the time-critical component
it borrows from the isolcpus=1 idea for RTAI where CPU1 would be reserved for 
the base thread
the idea is to do something similar for rtapi_app:

quote from: Max Krasnyansky's post in 
http://www.digipedia.pl/usenet/thread/19080/11385/

> Actually this is kind of available right now with vanilla 2.6 kernel.
> I'm talking about CPU reservation. Here is an example.
> Let's say we have dual CPU box and we want to dedicate CPU 1 to
> our application:
> - Configure the kernel with following boot options:
> isolcpus=1 acpi_irq_nobalance noirqbalance
> 
> This excludes CPU 1 from the scheduler balancing logic. And disables
> ACPI and SW irq balancing.
> Make sure that you don't run user-space IRQ balancer.
> 
> - Redirect all interrupts to CPU 0
> for i in /proc/irq/*; do
> echo 1 > $i/smp_affinity;
> done
> 
> - Your app call now migrate to CPU 1
> int cpu = 1;
> uint32_t mask = (1 << cpu);
> sched_setaffinity(0, sizeof(mask), (cpu_set_t *) &mask);
> 
> That's it. CPU 1 is yours. There will be almost zero activity on it, besides
> your task of course.
> 
> Max

what would needed to be done is to add the sched_setaffinity() code fragment to 
rtapi_app and do the boot/setup incantations before starting linuxcnc

- Michael

Am 14.09.2012 um 15:46 schrieb Kent A. Reed:

> Thanks, Jan, Lars, Michael, Charles, Ken, and Steve for your thoughts.
> 
> I'll have to cogitate a bit on what to do next, but I can answer Steve 
> off the top of my head. Two pre-built realtime kernels are available 
> from the Debian Wheezy repository. The amd64 build is for 64-bit amd and 
> intel processors; there is also a 32-bit 3.2.0-3-rt-686-pae build. 
> That's what I alluded to in my third agenda item to try.
> 
> <muttered aside>
> Yes, I know I could custom-build my own kernel, but there comes a point 
> where I say "enough, this isn't just tweaking any more." It took 
> LinuxCNC (well, ok, EMC2) a while to get to the point where a LiveCD 
> distribution just works for most folk. I'm hoping it doesn't take as 
> long for our use of these alternative realtime platforms to stabilize in 
> the same way, especially since I believe they are necessary 
> alternatives. If using RT PREEMPT or Xenomi approaches requires more 
> than a straightforward tuning-your-system checklist, then I don't know 
> how we'll make the alternatives attractive to our user base let alone 
> attract new classes of users. That would be unfortunate.
> </muttered aside>
> 
> It's clear to me from your responses that if I want to run with the big 
> dogs I have to learn how to instrument a realtime environment :-)
> 
> Regards,
> Kent
> 
> 
> On 9/14/2012 8:05 AM, Steve Stallings wrote:
>> Hi Kent,
>> 
>> I have NO experience with doing this sort of build,
>> but have to wonder if it is significant that your
>> target is an Atom D510 cpu, yet you list a kernel
>> for amd64.
>> 
>> Regards,
>> Steve Stallings
>> 
>>> -----Original Message-----
>>> From: Kent A. Reed [mailto:kentallanr...@gmail.com]
>>> Sent: Thursday, September 13, 2012 11:31 PM
>>> To: EMC developers
>>> Subject: [Emc-developers] question re RT PREEMPT linux on
>>> ASUS Atom board
>>> 
>>> 
>>> <blah blah blah>
> 
> ------------------------------------------------------------------------------
> Got visibility?
> Most devs has no idea what their production app looks like.
> Find out how fast your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219671;13503038;y?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to