All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Terry Fryar <terry.fryar@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Mode switches??
Date: Fri, 30 Dec 2011 11:23:11 +0100	[thread overview]
Message-ID: <4EFD910F.3080404@domain.hid> (raw)
In-Reply-To: <4EFCFF53.7040508@domain.hid>

On 12/30/2011 01:01 AM, Gilles Chanteperdrix wrote:
> On 12/29/2011 10:43 PM, Terry Fryar wrote:
>> 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??
> 
> mode switches do not exist for kernel-space tasks. So, reading the
> modeswitch member of the task info structure for a kernel space task
> does not really make sense. Which is why probably nobody else noticed
> (that, and the fact that the native API in kernel-space is not very much
> in use, these days).
> 
the mode switches count should still be zero. Could you show us the full
test code?

-- 
                                                                Gilles.


  reply	other threads:[~2011-12-30 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 21:43 [Xenomai-help] Mode switches?? Terry Fryar
2011-12-30  0:01 ` Gilles Chanteperdrix
2011-12-30 10:23   ` Gilles Chanteperdrix [this message]
2012-01-02 14:27     ` Terry Fryar
2012-01-02 15:02       ` Gilles Chanteperdrix
2012-01-02 17:58         ` Terry Fryar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EFD910F.3080404@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=terry.fryar@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.