From: "Terry Fryar" Date: Thu, 29 Dec 2011 15:43:41 -0600 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0049_01CCC640.A59E8DE0" Subject: [Xenomai-help] Mode switches?? List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------=_NextPart_000_0049_01CCC640.A59E8DE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Using 2.6.0, I am have trouble understanding the results of the rt_task_info() call? Have a very simple kernel module that fires off an ISR routine and a xenomai task. The IRQ is not firing for these tests, so it's not doing anything. Here's the xenomai rt task created using rt_create_task(): void irqdrv_task(void *args) { while (!irqdrv_terminated) { rt_task_sleep(10000000); } } So, in the driver "exit" code, right before I delete this task I do a rt_task_info() and I see no context switches and very little exec time for this task. However, it's showing 1,000,000 mode switches in just 5 or 10 seconds of exec time?? The info.modeswitches is the number of times the task switches between primary and secondary mode, yes?? Why in the world are there so many for a small task doing nothing but call a xenomai function, and in a kernel driver to boot!! Am I missing something here....shouldn't mode switches be zero??? I'm not calling any linux kernel functions...it shouldn't have switched ever?? ------=_NextPart_000_0049_01CCC640.A59E8DE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Using = 2.6.0, I am=20 have trouble understanding the results of the rt_task_info()=20 call?
 
Have a = very simple=20 kernel module that fires off an ISR routine and a xenomai task.  = The IRQ is=20 not firing for these tests, so it's not doing anything.  Here's the = xenomai=20 rt task created using rt_create_task():
 
void=20 irqdrv_task(void *args)
{
    while=20 (!irqdrv_terminated)
    =20 {
         =20 rt_task_sleep(10000000);
     = }
}
 
So, in = the driver=20 "exit" code, right before I delete this task I do a rt_task_info() and I = see no=20 context switches and very little exec time for this task.  However, = it's=20 showing 1,000,000 mode switches in just 5 or 10 seconds of exec=20 time??
 
The=20 info.modeswitches is the number of times the task switches between = primary and=20 secondary mode, yes??  Why in the world are there so many for a = small task=20 doing nothing but call a xenomai function, and in a kernel driver to=20 boot!!
 
Am I = missing=20 something here....shouldn't mode switches be zero???  I'm not = calling any=20 linux kernel functions...it shouldn't have switched = ever??
 
------=_NextPart_000_0049_01CCC640.A59E8DE0--