rt_task_init_cpuid() Question

Stephen Davies steve_davies61 at hotmail.com
Thu Oct 11 15:43:12 CEST 2007


Paolo,
 
I have tried to replicate this to run on CPU 1, but when I do that I cannot access the terminal window to type cat /proc/rtai/*!  If I call some threads with rt_task_init() and some with rt_task_init_schmod(...2) I can see that the tasks are that are initiated with rt_task_init_schmod(...2) are running on CPU2 while most of the others are running on CPU 1.
 
Steve



> From: mantegazza at aero.polimi.it> To: saljic at yahoo.com> CC: rtai at rtai.org> Subject: Re: rt_task_init_cpuid() Question> Date: Thu, 11 Oct 2007 14:27:30 +0200> > Dusan Saljic wrote:> > Hi Steve,> > > > I've just tried that boot option and run my lxrt tasks, and everything > > was like without that option:> > > > RTAI LXRT Real Time Task Scheduler.> > > > Calibrated CPU Frequency: 2992763000 Hz> > Calibrated interrupt to scheduler latency: 2944 ns> > Calibrated oneshot timer setup_to_firing time: 999 ns> > > > Number of RT CPUs in system: 2> > > > Real time kthreads in resorvoir (cpu/#): (0/3): (1/3)> > > > Number of forced hard/soft/hard transitions: traps 0, syscalls 0> > > > Priority Period(ns) FPU Sig State CPU Task HD/SF PID RT_TASK * > > TIME> > ------------------------------------------------------------------------------> > 1000000000 1 Yes No 0x5 0:1 1 0 4608 f9456220 0> > 1000000000 1 Yes No 0x5 0:1 2 0 4614 f9456a20 0> > 1000000000 1 Yes No 0x0 0:1 3 0 4616 f9462220 0> > 1000000000 1 Yes No 0x5 0:1 4 0 4618 f9462a20 0> > 1000000000 1 Yes No 0x5 0:1 5 0 4619 f9463220 0> > 1000000001 1 Yes No 0x0 0:1 6 0 4638 f9463a20 0> > TIMED> >> f9456a20 > f9462a20 > f9456220 > f9463220> > READY> > 1000000001 1 Yes No 0x5 1:2 7 0 4639 f9464220 0> > TIMED> >> f9464220> > READY> > > > As you can see it, the process 4639 has been scheduled on the second CPU.> > > > I think that you used rt_task_init and not rt_task_init_schmod for > pid=4639. If using rt_task_init_schmod you set its last argument to 1 > then it should go to the first CPU also.> > Can you check if I'm right/wrong?> > Paolo.> > > rtai is 3.5 kernel 2.6.19.7 last debian stable 4> > > > Greetings,> > Dusan.> > > > ----- Original Message ----> > From: Stephen Davies <steve_davies61 at hotmail.com>> > To: Dusan Saljic <saljic at yahoo.com>; "rtai at rtai.org" <rtai at rtai.org>> > Sent: Thursday, October 11, 2007 10:55:42 AM> > Subject: RE: rt_task_init_cpuid() Question> > > > Hi Dusan,> > > > Thanks for your reply. I seem to get the error when I call rt_sleep() > > or rt_task_wait_period()! I don't doubt that it is my code, but I > > thought that using the isolcpu=1 boot parameter the Linux scheduler > > would not be able to see CPU 1 and would therefore not need to worry > > about it (effectively making my machine single core for Linux and a > > single core for RTAI with no interaction between them)? Certainly when > > I run "top" I can see that CPU 0 is loaded, but CPU 1 is 100% idle > > whatever I do in Linux (when I do get my RTAI program to run top shows > > no data for CPU 1 at all).> > > > Does this mean that I haven't isolated CPU 1 from Linux properly?> > > > Thanks for your help,> > > > Steve> > > > > > ------------------------------------------------------------------------> > From: saljic at yahoo.com> > Subject: Re: rt_task_init_cpuid() Question> > To: rtai at rtai.org> > Date: Thu, 11 Oct 2007 01:43:35 -0700> > > > Hi,> > > > soft lockup is tipical error which is usally on the coder side. Your> > rt_task runs under scheduler priority 99, thus will give no chance> > to other to schedule on the CPU, if you're not so carefull. Check> > your thread loop and if you don't have any plase to rest, use it on> > your own, rt_task_yield(), rt_sleep(), etc...> > > > Just a suggestion, not that i know your code.> > > > Greetings,> > Dusan.> > > > ----- Original Message ----> > From: Stephen Davies <steve_davies61 at hotmail.com>> > To: Paolo Mantegazza <mantegazza at aero.polimi.it>; "rtai at rtai.org"> > <rtai at rtai.org>> > Sent: Thursday, October 11, 2007 10:18:53 AM> > Subject: RE: rt_task_init_cpuid() Question> > > > Hi again,> > > > I've booted my Core2Duo with the boot parameter isolcpu=1 and then> > added the IsolCpusMask=2 parameter when I insmod rtai_hal.ko and I> > also call rt_task_init_scched() with cpu parameter = 2 for every> > RT_TASK I define, but I now get the following error when I call dmesg:> > > > [ 218.640962] BUG: soft lockup detected on CPU#1!> > [ 218.640984] [<c0148fdc>] softlockup_tick+0x9c/0xe0> > [ 218.640995] [<c012b0a3>] update_process_times+0x33/0x80> > [ 218.641001] [<c0111628>] smp_apic_timer_interrupt+0x68/0x80> > [ 218.641007] [<c014ca5a>] __ipipe_sync_stage+0x16a/0x1b9> > [ 218.641015] [<c014007b>] search_module_extables+0x1b/0x80> > [ 218.641021] [<c014ca5f>] __ipipe_sync_stage+0x16f/0x1b9> > [ 218.641029] [<f8d635db>] rtai_hirq_dispatcher+0x33b/0x370 [rtai_hal]> > [ 218.641038] [<f8d610b8>] rtai_uvec_handler+0x0/0x3c [rtai_hal]> > [ 218.641048] [<c0103db7>] apic_timer_interrupt+0x27/0x40> > [ 218.641057] =======================> > > > This will appear to hang one of the threads that I have created and> > so cause the rest of my program to hang. There is no kernel oops or> > anything else sinister. Does anyone know what this means? I assume> > that there is a scheduling conflict on the processor?> > > > My setup - RTAI3.5cv, 2.6.20.15 kernel, GCC 4.1.2, Core2Duo.> > > > Thanks for your help,> > > > Steve> > > > > > > > > > > > ------------------------------------------------------------------------> > > > > Date: Wed, 10 Oct 2007 11:52:10 +0200> > > From: mantegazza at aero.polimi.it> > > To: steve_davies61 at hotmail.com> > > Subject: Re: rt_task_init_cpuid() Question> > >> > > Stephen Davies wrote:> > > > Hi Paolo,> > > >> > > > Thanks for your reply. I have tried setting the IsolCpusMask=2> > (and 1> > > > and 0) and when I then run cat /proc/rtai/scheduler I am always> > told> > > > there are 2 RT cpus in the system. Firstly will this ever> > change if I> > > > do set the mask correctly, and secondly will this work with a> > multicore> > > > machine (I am using a Core2Duo)? The ISOLCPUS.README file only> > mentions> > > > multiprocessors not multicore processors.> > > >> > > > Thank you for your time,> > > >> > >> > > There is no difference between two CPUs and a dual core, in> > relation to> > > what we are talking about.> > >> > > CPU isolation does not mean RTAI will see just one CPU. It sees> > all of> > > them and ensures that no Linux interrupts goes to the isolated> > CPU. Then> > > it is up to you to let RTAI use the isolated CPU (task init> > setmod) for> > > the hard real time critical task(s) while remaining free to use> > all of> > > them if you want. On the other Linux Linux should ensure that> > none of> > > its tasks runs on the isolated CPU. There will be Linux deamons> > anyhow,> > > but they will have nothing to do.> > >> > > Paolo> > > > Steve> > > >> > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------> > > >> > > > > Date: Tue, 9 Oct 2007 18:06:35 +0200> > > > > From: mantegazza at aero.polimi.it> > > > > To: steve_davies61 at hotmail.com> > > > > CC: rtai at rtai.org> > > > > Subject: Re: rt_task_init_cpuid() Question> > > > >> > > > > Stephen Davies wrote:> > > > > > Hi all,> > > > > >> > > > > > I have a multithreaded application that runs fine on a> > single core PC> > > > > > but is giving concurrency issues on a multicore machine. I> > therefore> > > > > > have tried booting my PC with the "isolcpu = 1" boot> > parameter and> > > > then> > > > > > adding "IsolCpusMask=1" when I insmod rtai_hal.ko. I> > believe this> > > > > > should then make my dual core PC use only 1 of the cores> > for RTAI and> > > > > > keep 1 for Linux. This has made the problem better, but has> > not solved> > > > > > it. I notice in the documentation for RTAI there is a> > > > > > rt_task_init_cpuid() method, but I can't seem to call this> > from user> > > > > > mode (my application is LXRT). Is there any way of calling this> > > > > > function from user mode?> > > > > >> > > > > > My RTAI version is 3.5cv and kernel 2.6.20.15.> > > > > >> > > > > > Thanks for your help,> > > > > >> > > > >> > > > > RT_TASK *rt_task_init_schmod(unsigned long name, int> > priority, int> > > > > stack_size, int max_msg_size, int policy, int cpus_allowed);> > > > >> > > > > Policy: SCHED_FIFO/SCHED_RR, in case the task uses RTAI in> > soft mode.> > > > > cpus_allowed: the mask of the CPU you want to stay on, check> > if you did> > > > > it OK through "cat /proc/rtai/scheduler".> > > > >> > > > > Notice that Linux isolcpu refers to the CPU number, while> > RTAI requires> > > > > the related mask, i.e. 2.> > > > >> > > > > Paolo.> > > > >> > > > > > Steve> > > > > >> > > > > >> > > >> > ------------------------------------------------------------------------> >> > > > Play Movie Mash-up and win BIG prizes!> > <https://www.moviemashup.co.uk <https://www.moviemashup.co.uk/>>> > > > >> > > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------> > > > The next generation of MSN Hotmail has arrived - Windows Live> > Hotmail> >> > <http://www.newhotmail.co.uk <http://www.newhotmail.co.uk/>>> > >> > >> > > > > > Do you know a place like the back of your hand? Share local> > knowledge with BackOfMyHand.com <http://www.backofmyhand.com/>> > > > > > ------------------------------------------------------------------------> > Looking for a deal? Find great prices on flights and hotels> > <http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20->> > with Yahoo! FareChase.> > > > > > Play Movie Mash-up and win BIG prizes! <https://www.moviemashup.co.uk>> > > > > > ------------------------------------------------------------------------> > Moody friends. Drama queens. Your life? Nope! - their life, your story.> > Play Sims Stories at Yahoo! Games. > > <http://us.rd.yahoo.com/evt=48224/*http://sims.yahoo.com/>> > > > _______________________________________________> RTAI mailing list> RTAI at rtai.org> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_________________________________________________________________
Get free emoticon packs and customisation from Windows Live. 
http://www.pimpmylive.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.rtai.org/pipermail/rtai/attachments/20071011/0b51fa26/attachment.htm 


More information about the Rtai mailing list