On 2013-03-20 09:32, Michael Haberler wrote: > Hi Arvid, > > I got curious and tried, also on 2.6.32-122-rtai - it turns out it has a > significant improvement on rtai too, so that feature might go back even > longer than 3.3. > > I do see potential use for this, it would be in the plain kernel support of > what is now 'sim mode' (aka posix threads, which are not RT-hardened wrt > latency in any way) > > what we currently do is: Posix threads are used for for both 'vanilla' and > 'RT PREEMPT' RTOS support; in case an RT PREEMPT kernel is detected its > facilities are used (I'd need to read up on the specifics). > > If not, it falls back to plain scheduling, and thats where your suggestion > could come it - it could improve RT latency when running on a vanilla kernel. > > here's the current code which is used for both vanilla and RT PREEMPT kernels: > > http://git.mah.priv.at/gitweb?p=emc2-dev.git;a=blob;f=src/rtapi/rt-preempt-user.c;h=d46994b172b030b98d601eba1a23707531794ed8;hb=refs/heads/rtos-integration-preview3
It seems like that code is already using SCHED_FIFO. Look at line 349 - if SCHED_DEADLINE cannot be set, it fallbacks to SCHED_FIFO. I _think_ it works like this: if you have an RT_PREEMPTion patched kernel, you get deterministic behaviour with SCHED_FIFO/SCHED_RR. If not, you just get "lower latency". See e.g. https://wiki-ext.aps.anl.gov/epics/index.php/How_To_Use_Posix_Thread_Priority_Scheduling_under_Linux https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#A_Realtime_.22Hello_World.22_Example (Under "Benchmarking" in the second link, there's a link to another latency test program, BTW...) Now, I've just started looking at these things (both Linux realtime and LinuxCNC), so please correct me if I'm wrong. :) -- Arvid ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers