All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
@ 2013-03-15 13:10 Ronny Meeus
  2013-03-22 18:11 ` Philippe Gerum
  0 siblings, 1 reply; 6+ messages in thread
From: Ronny Meeus @ 2013-03-15 13:10 UTC (permalink / raw)
  To: xenomai

Hello

In august last year I reported a problem with round-robin scheduling
in the pSOS skin.
See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".

Now that we stepped up to the latest version of Xenomai-forge, I was
retrying the same test I did at that time.
I observe that the situation has been improved: the roundrobin
scheduling as such is now working well,
but there is an issue with the initial flags passed to the t_start call.

The flags are not correctly taken into account by the t_start call.
The complete testcode is attached to the mail.

I basically create 2 tasks which both consume all cpu power for some time.
If I create the tasks with timeslice enabled:
    t_create("WORK",10,0,0,0,&tid);
    t_start(tid,T_TSLICE, perform_work, args);

I get this result:

# taskset 4 ./roundrobin.exe
   0"000.493| WARNING: [main] Xenomai compiled with full debug enabled,
                              very high latencies expected [--enable-debug=full]
0 -> 7196
1 -> 0

If I explicitly add code in the taskbody to enable the timeslicing:
  unsigned long old_mode;
  t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
  t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);

I get this:

# taskset 4 ./roundrobin.exe
   0"000.491| WARNING: [main] Xenomai compiled with full debug enabled,
                              very high latencies expected [--enable-debug=full]
0 -> 3600
1 -> 3592

The latter is the correct behavior: both tasks get equal cpu power.
Note the t_mode is called 2 times to make sure the change of the state
stored in the task object is taken into account.

---
Ronny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: roundrobin.c
Type: text/x-csrc
Size: 1203 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130315/67f46364/attachment.c>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
  2013-03-15 13:10 [Xenomai] xenomai-forge: psos skin does not take t_start flags into account Ronny Meeus
@ 2013-03-22 18:11 ` Philippe Gerum
  2013-03-22 19:05   ` Ronny Meeus
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2013-03-22 18:11 UTC (permalink / raw)
  To: Ronny Meeus; +Cc: xenomai

On 03/15/2013 02:10 PM, Ronny Meeus wrote:
> Hello
>
> In august last year I reported a problem with round-robin scheduling
> in the pSOS skin.
> See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".
>
> Now that we stepped up to the latest version of Xenomai-forge, I was
> retrying the same test I did at that time.
> I observe that the situation has been improved: the roundrobin
> scheduling as such is now working well,
> but there is an issue with the initial flags passed to the t_start call.
>
> The flags are not correctly taken into account by the t_start call.
> The complete testcode is attached to the mail.
>
> I basically create 2 tasks which both consume all cpu power for some time.
> If I create the tasks with timeslice enabled:
>      t_create("WORK",10,0,0,0,&tid);
>      t_start(tid,T_TSLICE, perform_work, args);
>
> I get this result:
>
> # taskset 4 ./roundrobin.exe
>     0"000.493| WARNING: [main] Xenomai compiled with full debug enabled,
>                                very high latencies expected [--enable-debug=full]
> 0 -> 7196
> 1 -> 0
>
> If I explicitly add code in the taskbody to enable the timeslicing:
>    unsigned long old_mode;
>    t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
>    t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);
>
> I get this:
>
> # taskset 4 ./roundrobin.exe
>     0"000.491| WARNING: [main] Xenomai compiled with full debug enabled,
>                                very high latencies expected [--enable-debug=full]
> 0 -> 3600
> 1 -> 3592
>
> The latter is the correct behavior: both tasks get equal cpu power.
> Note the t_mode is called 2 times to make sure the change of the state
> stored in the task object is taken into account.
>

My understanding is that your latest patch in commit #eaef6154 fixes the 
issue.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
  2013-03-22 18:11 ` Philippe Gerum
@ 2013-03-22 19:05   ` Ronny Meeus
  2013-03-23  9:16     ` Philippe Gerum
  0 siblings, 1 reply; 6+ messages in thread
From: Ronny Meeus @ 2013-03-22 19:05 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Fri, Mar 22, 2013 at 7:11 PM, Philippe Gerum <rpm@xenomai.org> wrote:
> On 03/15/2013 02:10 PM, Ronny Meeus wrote:
>>
>> Hello
>>
>> In august last year I reported a problem with round-robin scheduling
>> in the pSOS skin.
>> See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".
>>
>> Now that we stepped up to the latest version of Xenomai-forge, I was
>> retrying the same test I did at that time.
>> I observe that the situation has been improved: the roundrobin
>> scheduling as such is now working well,
>> but there is an issue with the initial flags passed to the t_start call.
>>
>> The flags are not correctly taken into account by the t_start call.
>> The complete testcode is attached to the mail.
>>
>> I basically create 2 tasks which both consume all cpu power for some time.
>> If I create the tasks with timeslice enabled:
>>      t_create("WORK",10,0,0,0,&tid);
>>      t_start(tid,T_TSLICE, perform_work, args);
>>
>> I get this result:
>>
>> # taskset 4 ./roundrobin.exe
>>     0"000.493| WARNING: [main] Xenomai compiled with full debug enabled,
>>                                very high latencies expected
>> [--enable-debug=full]
>> 0 -> 7196
>> 1 -> 0
>>
>> If I explicitly add code in the taskbody to enable the timeslicing:
>>    unsigned long old_mode;
>>    t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
>>    t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);
>>
>> I get this:
>>
>> # taskset 4 ./roundrobin.exe
>>     0"000.491| WARNING: [main] Xenomai compiled with full debug enabled,
>>                                very high latencies expected
>> [--enable-debug=full]
>> 0 -> 3600
>> 1 -> 3592
>>
>> The latter is the correct behavior: both tasks get equal cpu power.
>> Note the t_mode is called 2 times to make sure the change of the state
>> stored in the task object is taken into account.
>>

Philippe

> My understanding is that your latest patch in commit #eaef6154 fixes the
> issue.
>

I think this is not correct.
The patch solved the large round-robin time, not the issue reported in
this mail.
What I observed during debugging this issue is that for example the
timer used to implement the round-robin is not started when T_TSLICE
is passed to the t_start call. If I change the mode in the taskbody
itself the timer is started.
I tried to start the timer after creating the thread but then I
observed a crash. So it looked to me that these flags need to be
processed in the trampoline code in the taskbody itself.

---
Ronny


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
  2013-03-22 19:05   ` Ronny Meeus
@ 2013-03-23  9:16     ` Philippe Gerum
  2013-03-23  9:21       ` Philippe Gerum
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2013-03-23  9:16 UTC (permalink / raw)
  To: Ronny Meeus; +Cc: xenomai

On 03/22/2013 08:05 PM, Ronny Meeus wrote:
> On Fri, Mar 22, 2013 at 7:11 PM, Philippe Gerum <rpm@xenomai.org> wrote:
>> On 03/15/2013 02:10 PM, Ronny Meeus wrote:
>>>
>>> Hello
>>>
>>> In august last year I reported a problem with round-robin scheduling
>>> in the pSOS skin.
>>> See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".
>>>
>>> Now that we stepped up to the latest version of Xenomai-forge, I was
>>> retrying the same test I did at that time.
>>> I observe that the situation has been improved: the roundrobin
>>> scheduling as such is now working well,
>>> but there is an issue with the initial flags passed to the t_start call.
>>>
>>> The flags are not correctly taken into account by the t_start call.
>>> The complete testcode is attached to the mail.
>>>
>>> I basically create 2 tasks which both consume all cpu power for some time.
>>> If I create the tasks with timeslice enabled:
>>>       t_create("WORK",10,0,0,0,&tid);
>>>       t_start(tid,T_TSLICE, perform_work, args);
>>>
>>> I get this result:
>>>
>>> # taskset 4 ./roundrobin.exe
>>>      0"000.493| WARNING: [main] Xenomai compiled with full debug enabled,
>>>                                 very high latencies expected
>>> [--enable-debug=full]
>>> 0 -> 7196
>>> 1 -> 0
>>>
>>> If I explicitly add code in the taskbody to enable the timeslicing:
>>>     unsigned long old_mode;
>>>     t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
>>>     t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);
>>>
>>> I get this:
>>>
>>> # taskset 4 ./roundrobin.exe
>>>      0"000.491| WARNING: [main] Xenomai compiled with full debug enabled,
>>>                                 very high latencies expected
>>> [--enable-debug=full]
>>> 0 -> 3600
>>> 1 -> 3592
>>>
>>> The latter is the correct behavior: both tasks get equal cpu power.
>>> Note the t_mode is called 2 times to make sure the change of the state
>>> stored in the task object is taken into account.
>>>
>
> Philippe
>
>> My understanding is that your latest patch in commit #eaef6154 fixes the
>> issue.
>>
>
> I think this is not correct.
> The patch solved the large round-robin time, not the issue reported in
> this mail.
> What I observed during debugging this issue is that for example the
> timer used to implement the round-robin is not started when T_TSLICE
> is passed to the t_start call. If I change the mode in the taskbody
> itself the timer is started.
> I tried to start the timer after creating the thread but then I
> observed a crash. So it looked to me that these flags need to be
> processed in the trampoline code in the taskbody itself.
>

They are actually. testsuite/task8.c tests the behavior of the RR code. 
Could you run all the tests there, and report about task8? TIA,

e.g.

$ cd lib/psos/testsuite
$ make DESTDIR=<xenomai_install-dir> test

-- 
Philippe.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
  2013-03-23  9:16     ` Philippe Gerum
@ 2013-03-23  9:21       ` Philippe Gerum
  2013-03-25 13:19         ` Ronny Meeus
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2013-03-23  9:21 UTC (permalink / raw)
  To: Ronny Meeus; +Cc: xenomai

On 03/23/2013 10:16 AM, Philippe Gerum wrote:
> On 03/22/2013 08:05 PM, Ronny Meeus wrote:
>> On Fri, Mar 22, 2013 at 7:11 PM, Philippe Gerum <rpm@xenomai.org> wrote:
>>> On 03/15/2013 02:10 PM, Ronny Meeus wrote:
>>>>
>>>> Hello
>>>>
>>>> In august last year I reported a problem with round-robin scheduling
>>>> in the pSOS skin.
>>>> See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".
>>>>
>>>> Now that we stepped up to the latest version of Xenomai-forge, I was
>>>> retrying the same test I did at that time.
>>>> I observe that the situation has been improved: the roundrobin
>>>> scheduling as such is now working well,
>>>> but there is an issue with the initial flags passed to the t_start
>>>> call.
>>>>
>>>> The flags are not correctly taken into account by the t_start call.
>>>> The complete testcode is attached to the mail.
>>>>
>>>> I basically create 2 tasks which both consume all cpu power for some
>>>> time.
>>>> If I create the tasks with timeslice enabled:
>>>>       t_create("WORK",10,0,0,0,&tid);
>>>>       t_start(tid,T_TSLICE, perform_work, args);
>>>>
>>>> I get this result:
>>>>
>>>> # taskset 4 ./roundrobin.exe
>>>>      0"000.493| WARNING: [main] Xenomai compiled with full debug
>>>> enabled,
>>>>                                 very high latencies expected
>>>> [--enable-debug=full]
>>>> 0 -> 7196
>>>> 1 -> 0
>>>>
>>>> If I explicitly add code in the taskbody to enable the timeslicing:
>>>>     unsigned long old_mode;
>>>>     t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
>>>>     t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);
>>>>
>>>> I get this:
>>>>
>>>> # taskset 4 ./roundrobin.exe
>>>>      0"000.491| WARNING: [main] Xenomai compiled with full debug
>>>> enabled,
>>>>                                 very high latencies expected
>>>> [--enable-debug=full]
>>>> 0 -> 3600
>>>> 1 -> 3592
>>>>
>>>> The latter is the correct behavior: both tasks get equal cpu power.
>>>> Note the t_mode is called 2 times to make sure the change of the state
>>>> stored in the task object is taken into account.
>>>>
>>
>> Philippe
>>
>>> My understanding is that your latest patch in commit #eaef6154 fixes the
>>> issue.
>>>
>>
>> I think this is not correct.
>> The patch solved the large round-robin time, not the issue reported in
>> this mail.
>> What I observed during debugging this issue is that for example the
>> timer used to implement the round-robin is not started when T_TSLICE
>> is passed to the t_start call. If I change the mode in the taskbody
>> itself the timer is started.
>> I tried to start the timer after creating the thread but then I
>> observed a crash. So it looked to me that these flags need to be
>> processed in the trampoline code in the taskbody itself.
>>
>
> They are actually. testsuite/task8.c tests the behavior of the RR code.
> Could you run all the tests there, and report about task8? TIA,
>
> e.g.
>
> $ cd lib/psos/testsuite
> $ make DESTDIR=<xenomai_install-dir> test
>

Confirmed. The test case you sent works perfectly now.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Xenomai] xenomai-forge: psos skin does not take t_start flags into account
  2013-03-23  9:21       ` Philippe Gerum
@ 2013-03-25 13:19         ` Ronny Meeus
  0 siblings, 0 replies; 6+ messages in thread
From: Ronny Meeus @ 2013-03-25 13:19 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Sat, Mar 23, 2013 at 10:21 AM, Philippe Gerum <rpm@xenomai.org> wrote:
> On 03/23/2013 10:16 AM, Philippe Gerum wrote:
>>
>> On 03/22/2013 08:05 PM, Ronny Meeus wrote:
>>>
>>> On Fri, Mar 22, 2013 at 7:11 PM, Philippe Gerum <rpm@xenomai.org> wrote:
>>>>
>>>> On 03/15/2013 02:10 PM, Ronny Meeus wrote:
>>>>>
>>>>>
>>>>> Hello
>>>>>
>>>>> In august last year I reported a problem with round-robin scheduling
>>>>> in the pSOS skin.
>>>>> See mail thread "xenomai-forge: round-robin scheduling in pSOS skin".
>>>>>
>>>>> Now that we stepped up to the latest version of Xenomai-forge, I was
>>>>> retrying the same test I did at that time.
>>>>> I observe that the situation has been improved: the roundrobin
>>>>> scheduling as such is now working well,
>>>>> but there is an issue with the initial flags passed to the t_start
>>>>> call.
>>>>>
>>>>> The flags are not correctly taken into account by the t_start call.
>>>>> The complete testcode is attached to the mail.
>>>>>
>>>>> I basically create 2 tasks which both consume all cpu power for some
>>>>> time.
>>>>> If I create the tasks with timeslice enabled:
>>>>>       t_create("WORK",10,0,0,0,&tid);
>>>>>       t_start(tid,T_TSLICE, perform_work, args);
>>>>>
>>>>> I get this result:
>>>>>
>>>>> # taskset 4 ./roundrobin.exe
>>>>>      0"000.493| WARNING: [main] Xenomai compiled with full debug
>>>>> enabled,
>>>>>                                 very high latencies expected
>>>>> [--enable-debug=full]
>>>>> 0 -> 7196
>>>>> 1 -> 0
>>>>>
>>>>> If I explicitly add code in the taskbody to enable the timeslicing:
>>>>>     unsigned long old_mode;
>>>>>     t_mode((T_TSLICE|T_NOTSLICE),T_NOTSLICE, &old_mode);
>>>>>     t_mode((T_TSLICE|T_NOTSLICE),T_TSLICE, &old_mode);
>>>>>
>>>>> I get this:
>>>>>
>>>>> # taskset 4 ./roundrobin.exe
>>>>>      0"000.491| WARNING: [main] Xenomai compiled with full debug
>>>>> enabled,
>>>>>                                 very high latencies expected
>>>>> [--enable-debug=full]
>>>>> 0 -> 3600
>>>>> 1 -> 3592
>>>>>
>>>>> The latter is the correct behavior: both tasks get equal cpu power.
>>>>> Note the t_mode is called 2 times to make sure the change of the state
>>>>> stored in the task object is taken into account.
>>>>>
>>>
>>> Philippe
>>>
>>>> My understanding is that your latest patch in commit #eaef6154 fixes the
>>>> issue.
>>>>
>>>
>>> I think this is not correct.
>>> The patch solved the large round-robin time, not the issue reported in
>>> this mail.
>>> What I observed during debugging this issue is that for example the
>>> timer used to implement the round-robin is not started when T_TSLICE
>>> is passed to the t_start call. If I change the mode in the taskbody
>>> itself the timer is started.
>>> I tried to start the timer after creating the thread but then I
>>> observed a crash. So it looked to me that these flags need to be
>>> processed in the trampoline code in the taskbody itself.
>>>
>>
>> They are actually. testsuite/task8.c tests the behavior of the RR code.
>> Could you run all the tests there, and report about task8? TIA,
>>
>> e.g.
>>
>> $ cd lib/psos/testsuite
>> $ make DESTDIR=<xenomai_install-dir> test
>>
>
> Confirmed. The test case you sent works perfectly now.
>
> --
> Philippe.

Phillippe,

I can also confirm that the code is working fine now.
Thanks for your support.

---
Ronny


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-25 13:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15 13:10 [Xenomai] xenomai-forge: psos skin does not take t_start flags into account Ronny Meeus
2013-03-22 18:11 ` Philippe Gerum
2013-03-22 19:05   ` Ronny Meeus
2013-03-23  9:16     ` Philippe Gerum
2013-03-23  9:21       ` Philippe Gerum
2013-03-25 13:19         ` Ronny Meeus

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.