Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-07 Thread Philippe Gerum
On 04/07/2018 09:57 AM, Philippe Gerum wrote:
> On 04/06/2018 06:51 PM, C Smith wrote:
>> Hi all--
>>
>> Our real time application has a main rt_task which runs concurrently with
>> several other rt_tasks (spawned using rt_task_create) and we are concerned
>> about a context switch in one of the tasks. The problematic task uses
>> libxml2 to parse an xml document sent over ethernet which seems to cause a
>> switch to secondary mode. Would this also switch the other tasks we are
>> running to secondary mode, or is it isolated?
> 
> This is isolated in the sense that only the xml parser task will switch
> to secondary mode.
> 
> However, this may still cause a priority inversion for any rt thread
> which synchronizes with that switching thread, since the former may end
> up waiting for a wake up event coming from the latter, which might be
> delayed until it switches back to rt mode.
> 

Also, unwanted mode switches might cause runtime overhead when they
happen frequently enough. So it depends on how frequently the parser
task is switching out of rt mode.

-- 
Philippe.

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-07 Thread Philippe Gerum
On 04/06/2018 06:51 PM, C Smith wrote:
> Hi all--
> 
> Our real time application has a main rt_task which runs concurrently with
> several other rt_tasks (spawned using rt_task_create) and we are concerned
> about a context switch in one of the tasks. The problematic task uses
> libxml2 to parse an xml document sent over ethernet which seems to cause a
> switch to secondary mode. Would this also switch the other tasks we are
> running to secondary mode, or is it isolated?

This is isolated in the sense that only the xml parser task will switch
to secondary mode.

However, this may still cause a priority inversion for any rt thread
which synchronizes with that switching thread, since the former may end
up waiting for a wake up event coming from the latter, which might be
delayed until it switches back to rt mode.

-- 
Philippe.

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread Giulio Moro
or
   cat /proc/xenomai/stat
and see if the count in the MSW column increases for that task

From: Xenomai <xenomai-boun...@xenomai.org> on behalf of Greg Gallagher 
<g...@embeddedgreg.com>
Sent: 06 April 2018 18:41
To: C Smith
Cc: Xenomai@xenomai.org
Subject: Re: [Xenomai] Context switch to secondary mode in xenomai tasks

Check here:
https://xenomai.org/2014/08/porting-a-linux-application-to-xenomai-dual-kernel/#Chasing_the_unwanted_mode_switches


On Fri, Apr 6, 2018 at 1:39 PM, C Smith <csmithquesti...@gmail.com> wrote:
> How can we verify which tasks are switching to secondary mode? We know the
> xml parser definitely is switching to secondary mode, setting T_WARNSW,
> causing the application to send the SIGXCPU signal, but we don't know if
> it's affecting the other tasks.
>
> On Fri, Apr 6, 2018 at 10:17 AM, Greg Gallagher <g...@embeddedgreg.com>
> wrote:
>>
>> If a tasks switches to secondary mode it would act like a normal Linux
>> thread. I haven't used Xenomai 2.6 in a while but if you are seeing
>> both tasks drop to secondary mode you may want to list the resources
>> that they are sharing and how you are sharing them and then we can see
>> if something would cause mode switches. Are you seeing both threads
>> drop to secondary mode?
>>
>> -Greg
>>
>> On Fri, Apr 6, 2018 at 1:01 PM, C Smith <csmithquesti...@gmail.com> wrote:
>> > The tasks manipulate shared data however they do not communicate
>> > directly.
>> > The rt_task which parses the xml document and the main rt_task are
>> > running
>> > periodically at different rates using rt_task_set_periodic.
>> >
>> > On Fri, Apr 6, 2018 at 9:54 AM, Greg Gallagher <g...@embeddedgreg.com>
>> > wrote:
>> >>
>> >> Do the tasks communicate with each other?
>> >>
>> >> -Greg
>> >>
>> >> On Fri, Apr 6, 2018 at 12:51 PM, C Smith <csmithquesti...@gmail.com>
>> >> wrote:
>> >> > Hi all--
>> >> >
>> >> > Our real time application has a main rt_task which runs concurrently
>> >> > with
>> >> > several other rt_tasks (spawned using rt_task_create) and we are
>> >> > concerned
>> >> > about a context switch in one of the tasks. The problematic task uses
>> >> > libxml2 to parse an xml document sent over ethernet which seems to
>> >> > cause
>> >> > a
>> >> > switch to secondary mode. Would this also switch the other tasks we
>> >> > are
>> >> > running to secondary mode, or is it isolated?
>> >> >
>> >> > We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
>> >> > ___
>> >> > Xenomai mailing list
>> >> > Xenomai@xenomai.org
>> >> > https://xenomai.org/mailman/listinfo/xenomai
>> >
>> >
>
>

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread Greg Gallagher
Check here:
https://xenomai.org/2014/08/porting-a-linux-application-to-xenomai-dual-kernel/#Chasing_the_unwanted_mode_switches


On Fri, Apr 6, 2018 at 1:39 PM, C Smith  wrote:
> How can we verify which tasks are switching to secondary mode? We know the
> xml parser definitely is switching to secondary mode, setting T_WARNSW,
> causing the application to send the SIGXCPU signal, but we don't know if
> it's affecting the other tasks.
>
> On Fri, Apr 6, 2018 at 10:17 AM, Greg Gallagher 
> wrote:
>>
>> If a tasks switches to secondary mode it would act like a normal Linux
>> thread. I haven't used Xenomai 2.6 in a while but if you are seeing
>> both tasks drop to secondary mode you may want to list the resources
>> that they are sharing and how you are sharing them and then we can see
>> if something would cause mode switches. Are you seeing both threads
>> drop to secondary mode?
>>
>> -Greg
>>
>> On Fri, Apr 6, 2018 at 1:01 PM, C Smith  wrote:
>> > The tasks manipulate shared data however they do not communicate
>> > directly.
>> > The rt_task which parses the xml document and the main rt_task are
>> > running
>> > periodically at different rates using rt_task_set_periodic.
>> >
>> > On Fri, Apr 6, 2018 at 9:54 AM, Greg Gallagher 
>> > wrote:
>> >>
>> >> Do the tasks communicate with each other?
>> >>
>> >> -Greg
>> >>
>> >> On Fri, Apr 6, 2018 at 12:51 PM, C Smith 
>> >> wrote:
>> >> > Hi all--
>> >> >
>> >> > Our real time application has a main rt_task which runs concurrently
>> >> > with
>> >> > several other rt_tasks (spawned using rt_task_create) and we are
>> >> > concerned
>> >> > about a context switch in one of the tasks. The problematic task uses
>> >> > libxml2 to parse an xml document sent over ethernet which seems to
>> >> > cause
>> >> > a
>> >> > switch to secondary mode. Would this also switch the other tasks we
>> >> > are
>> >> > running to secondary mode, or is it isolated?
>> >> >
>> >> > We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
>> >> > ___
>> >> > Xenomai mailing list
>> >> > Xenomai@xenomai.org
>> >> > https://xenomai.org/mailman/listinfo/xenomai
>> >
>> >
>
>

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread C Smith
How can we verify which tasks are switching to secondary mode? We know the
xml parser definitely is switching to secondary mode, setting T_WARNSW,
causing the application to send the SIGXCPU signal, but we don't know if
it's affecting the other tasks.

On Fri, Apr 6, 2018 at 10:17 AM, Greg Gallagher 
wrote:

> If a tasks switches to secondary mode it would act like a normal Linux
> thread. I haven't used Xenomai 2.6 in a while but if you are seeing
> both tasks drop to secondary mode you may want to list the resources
> that they are sharing and how you are sharing them and then we can see
> if something would cause mode switches. Are you seeing both threads
> drop to secondary mode?
>
> -Greg
>
> On Fri, Apr 6, 2018 at 1:01 PM, C Smith  wrote:
> > The tasks manipulate shared data however they do not communicate
> directly.
> > The rt_task which parses the xml document and the main rt_task are
> running
> > periodically at different rates using rt_task_set_periodic.
> >
> > On Fri, Apr 6, 2018 at 9:54 AM, Greg Gallagher 
> > wrote:
> >>
> >> Do the tasks communicate with each other?
> >>
> >> -Greg
> >>
> >> On Fri, Apr 6, 2018 at 12:51 PM, C Smith 
> >> wrote:
> >> > Hi all--
> >> >
> >> > Our real time application has a main rt_task which runs concurrently
> >> > with
> >> > several other rt_tasks (spawned using rt_task_create) and we are
> >> > concerned
> >> > about a context switch in one of the tasks. The problematic task uses
> >> > libxml2 to parse an xml document sent over ethernet which seems to
> cause
> >> > a
> >> > switch to secondary mode. Would this also switch the other tasks we
> are
> >> > running to secondary mode, or is it isolated?
> >> >
> >> > We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
> >> > ___
> >> > Xenomai mailing list
> >> > Xenomai@xenomai.org
> >> > https://xenomai.org/mailman/listinfo/xenomai
> >
> >
>
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread Greg Gallagher
If a tasks switches to secondary mode it would act like a normal Linux
thread. I haven't used Xenomai 2.6 in a while but if you are seeing
both tasks drop to secondary mode you may want to list the resources
that they are sharing and how you are sharing them and then we can see
if something would cause mode switches. Are you seeing both threads
drop to secondary mode?

-Greg

On Fri, Apr 6, 2018 at 1:01 PM, C Smith  wrote:
> The tasks manipulate shared data however they do not communicate directly.
> The rt_task which parses the xml document and the main rt_task are running
> periodically at different rates using rt_task_set_periodic.
>
> On Fri, Apr 6, 2018 at 9:54 AM, Greg Gallagher 
> wrote:
>>
>> Do the tasks communicate with each other?
>>
>> -Greg
>>
>> On Fri, Apr 6, 2018 at 12:51 PM, C Smith 
>> wrote:
>> > Hi all--
>> >
>> > Our real time application has a main rt_task which runs concurrently
>> > with
>> > several other rt_tasks (spawned using rt_task_create) and we are
>> > concerned
>> > about a context switch in one of the tasks. The problematic task uses
>> > libxml2 to parse an xml document sent over ethernet which seems to cause
>> > a
>> > switch to secondary mode. Would this also switch the other tasks we are
>> > running to secondary mode, or is it isolated?
>> >
>> > We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
>> > ___
>> > Xenomai mailing list
>> > Xenomai@xenomai.org
>> > https://xenomai.org/mailman/listinfo/xenomai
>
>

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread C Smith
The tasks manipulate shared data however they do not communicate directly.
The rt_task which parses the xml document and the main rt_task are running
periodically at different rates using rt_task_set_periodic.

On Fri, Apr 6, 2018 at 9:54 AM, Greg Gallagher 
wrote:

> Do the tasks communicate with each other?
>
> -Greg
>
> On Fri, Apr 6, 2018 at 12:51 PM, C Smith 
> wrote:
> > Hi all--
> >
> > Our real time application has a main rt_task which runs concurrently with
> > several other rt_tasks (spawned using rt_task_create) and we are
> concerned
> > about a context switch in one of the tasks. The problematic task uses
> > libxml2 to parse an xml document sent over ethernet which seems to cause
> a
> > switch to secondary mode. Would this also switch the other tasks we are
> > running to secondary mode, or is it isolated?
> >
> > We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
> > ___
> > Xenomai mailing list
> > Xenomai@xenomai.org
> > https://xenomai.org/mailman/listinfo/xenomai
>
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


Re: [Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread Greg Gallagher
Do the tasks communicate with each other?

-Greg

On Fri, Apr 6, 2018 at 12:51 PM, C Smith  wrote:
> Hi all--
>
> Our real time application has a main rt_task which runs concurrently with
> several other rt_tasks (spawned using rt_task_create) and we are concerned
> about a context switch in one of the tasks. The problematic task uses
> libxml2 to parse an xml document sent over ethernet which seems to cause a
> switch to secondary mode. Would this also switch the other tasks we are
> running to secondary mode, or is it isolated?
>
> We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
> ___
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai

___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai


[Xenomai] Context switch to secondary mode in xenomai tasks

2018-04-06 Thread C Smith
Hi all--

Our real time application has a main rt_task which runs concurrently with
several other rt_tasks (spawned using rt_task_create) and we are concerned
about a context switch in one of the tasks. The problematic task uses
libxml2 to parse an xml document sent over ethernet which seems to cause a
switch to secondary mode. Would this also switch the other tasks we are
running to secondary mode, or is it isolated?

We are running Xenomai 2.6.2 and Xenomai 2.6.5 in our application.
___
Xenomai mailing list
Xenomai@xenomai.org
https://xenomai.org/mailman/listinfo/xenomai