Tim Gessner
|
thread scheduling jitter question
|
Tim Gessner
06/24/2008 6:26 PM
post9634
|
thread scheduling jitter question
I have 3 processes each running a number of threads. I have some of the threads running at a higher priority and system
scope. some of the threads (including those running at higher priorities) are communicating over ethernet. I have an
SMP x86 box with two gigabit ethernet ports. I am running the round robin scheduler.
I am using timers to block the thread to run at 250, 500, etc. milliseconds. I expected to see the intervals be very
close to the proscribed value. That is, I expected to see numbers close to 250 milliseconds, etc. but instead I see a
significant amount of jitter. In some cases a couple of hundred milliseconds, normally though about 5 milliseconds plus
/minus the timeout value.
One thread I have raised to 255 to see if that made any difference. It still has a great deal of jitter. I am very
surprised.
Is this normal for QNX or am I doing something wrong?
THanx
Tim
|
|
|
Attilla Danko(deleted)
|
Re: thread scheduling jitter question
|
Attilla Danko(deleted)
06/24/2008 6:59 PM
post9635
|
Re: thread scheduling jitter question
Try disabling "legacy USB support" in your bios.
Tim Gessner wrote:
> I have 3 processes each running a number of threads. I have some of the threads running at a higher priority and
system scope. some of the threads (including those running at higher priorities) are communicating over ethernet. I
have an SMP x86 box with two gigabit ethernet ports. I am running the round robin scheduler.
>
> I am using timers to block the thread to run at 250, 500, etc. milliseconds. I expected to see the intervals be very
close to the proscribed value. That is, I expected to see numbers close to 250 milliseconds, etc. but instead I see a
significant amount of jitter. In some cases a couple of hundred milliseconds, normally though about 5 milliseconds plus
/minus the timeout value.
>
> One thread I have raised to 255 to see if that made any difference. It still has a great deal of jitter. I am very
surprised.
>
> Is this normal for QNX or am I doing something wrong?
>
> THanx
> Tim
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post9634
>
|
|
|
Tim Gessner
|
Re: thread scheduling jitter question
|
Tim Gessner
06/25/2008 10:57 AM
post9672
|
Re: thread scheduling jitter question
Thanx. That feature is already disabled in the cmos. Interesting though, at times the system seems to slow down and
become unusable. At those times I run hogs and find that the io-usb is the main culprit. I am not using anything USB
directly, the keyboard, etc is PS2, there are not external devices using USB.
Any other thoughts? Sounds like you don't expect that much jitter normally?
Thanx
Tim
|
|
|
Dennis Kellly
|
Re: thread scheduling jitter question
|
Dennis Kellly
07/02/2008 8:37 AM
post9906
|
Re: thread scheduling jitter question
See http://en.wikipedia.org/wiki/System_Management_Mode. This "feature" can "steal time" from the o/s without its
knowlege. The gaps can be sizeable.
You can likely put the same program on a different pc motherboard and find the jitter is gone. (This has been my
experience) It seems that it is not possible to disable SMM on some motherboards.
|
|
|
Tim Gessner
|
Re: thread scheduling jitter question
|
Tim Gessner
07/02/2008 10:24 AM
post9925
|
Re: thread scheduling jitter question
Thanx. I'll look into that.
Tim
|
|
|
Tim Gessner
|
Re: thread scheduling jitter question
|
Tim Gessner
07/21/2008 11:16 AM
post10806
|
Re: thread scheduling jitter question
FYI...
I switched the scheduling algorithm and it made a significant difference. I was using Round Robin and switched to FIFO.
It makes sense in my case, but the FIFO eliminated the jitter problems completely.
|
|
|
Martin Doane
|
Re: thread scheduling jitter question
|
Martin Doane
07/21/2008 11:26 AM
post10807
|
Re: thread scheduling jitter question
So you had a single thread running at 255 that exhibited jitter, and if you change that thread from Round Robin to FIFO,
the jitter goes away?
> FYI...
>
> I switched the scheduling algorithm and it made a significant difference. I
> was using Round Robin and switched to FIFO. It makes sense in my case, but
> the FIFO eliminated the jitter problems completely.
|
|
|
Tim Gessner
|
RE: thread scheduling jitter question
|
Tim Gessner
07/21/2008 11:31 AM
post10808
|
RE: thread scheduling jitter question
No, I had 1 thread at 255, a few threads at above normal (12), and a
couple of threads at normal. All the threads exhibited jitter including
the thread at 255. I switched all the threads to FIFO and all the
jitter went away. I would expect that from all the threads except the
255 thread. I would have thought that that would be consistent no
matter what.
Since I'm sharing resources it makes sense that the other threads
exhibited some jitter, but not the 255 thread.
Tim
-----Original Message-----
From: Martin Doane [mailto:martin.doane@dematic.com]
Sent: Monday, July 21, 2008 8:27 AM
To: ostech-core_os
Subject: Re: thread scheduling jitter question
So you had a single thread running at 255 that exhibited jitter, and if
you change that thread from Round Robin to FIFO, the jitter goes away?
> FYI...
>
> I switched the scheduling algorithm and it made a significant
difference. I
> was using Round Robin and switched to FIFO. It makes sense in my
case, but
> the FIFO eliminated the jitter problems completely.
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post10807
|
|
|
Colin Burgess(deleted)
|
Re: thread scheduling jitter question
|
Colin Burgess(deleted)
07/21/2008 3:44 PM
post10829
|
Re: thread scheduling jitter question
Is the 255 thread holding any shared resources that would boost the lower threads?
Tim Gessner wrote:
> No, I had 1 thread at 255, a few threads at above normal (12), and a
> couple of threads at normal. All the threads exhibited jitter including
> the thread at 255. I switched all the threads to FIFO and all the
> jitter went away. I would expect that from all the threads except the
> 255 thread. I would have thought that that would be consistent no
> matter what.
>
> Since I'm sharing resources it makes sense that the other threads
> exhibited some jitter, but not the 255 thread.
>
> Tim
>
> -----Original Message-----
> From: Martin Doane [mailto:martin.doane@dematic.com]
> Sent: Monday, July 21, 2008 8:27 AM
> To: ostech-core_os
> Subject: Re: thread scheduling jitter question
>
> So you had a single thread running at 255 that exhibited jitter, and if
> you change that thread from Round Robin to FIFO, the jitter goes away?
>
>> FYI...
>>
>> I switched the scheduling algorithm and it made a significant
> difference. I
>> was using Round Robin and switched to FIFO. It makes sense in my
> case, but
>> the FIFO eliminated the jitter problems completely.
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10807
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10808
>
|
|
|
Tim Gessner
|
RE: thread scheduling jitter question
|
Tim Gessner
07/22/2008 10:18 AM
post10848
|
RE: thread scheduling jitter question
There are no mutexes or anything of that sort, they do all use Ethernet
sockets, message pulses and timers. There is nothing I can think of
that would should interrupt the 255 thread and nothing for which it
should have to wait while elevating another thread.
Tim
-----Original Message-----
From: Colin Burgess [mailto:cburgess@qnx.com]
Sent: Monday, July 21, 2008 12:44 PM
To: ostech-core_os
Subject: Re: thread scheduling jitter question
Is the 255 thread holding any shared resources that would boost the
lower threads?
Tim Gessner wrote:
> No, I had 1 thread at 255, a few threads at above normal (12), and a
> couple of threads at normal. All the threads exhibited jitter
including
> the thread at 255. I switched all the threads to FIFO and all the
> jitter went away. I would expect that from all the threads except the
> 255 thread. I would have thought that that would be consistent no
> matter what.
>
> Since I'm sharing resources it makes sense that the other threads
> exhibited some jitter, but not the 255 thread.
>
> Tim
>
> -----Original Message-----
> From: Martin Doane [mailto:martin.doane@dematic.com]
> Sent: Monday, July 21, 2008 8:27 AM
> To: ostech-core_os
> Subject: Re: thread scheduling jitter question
>
> So you had a single thread running at 255 that exhibited jitter, and
if
> you change that thread from Round Robin to FIFO, the jitter goes away?
>
>> FYI...
>>
>> I switched the scheduling algorithm and it made a significant
> difference. I
>> was using Round Robin and switched to FIFO. It makes sense in my
> case, but
>> the FIFO eliminated the jitter problems completely.
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10807
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10808
>
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post10829
|
|
|
Colin Burgess(deleted)
|
Re: thread scheduling jitter question
|
Colin Burgess(deleted)
07/22/2008 10:21 AM
post10850
|
Re: thread scheduling jitter question
At this point I would recommend using a kernel trace. The lowest impact method
would be to use a large kernel ring buffer, if you have the available memory.
Next on the list would be what is called direct mapped mode. You need to specify
a maximum size for the logfile and them also pass -M - note that each time a buffer
is copied out you will get an unexplained 'pause' in the logfile. Just be aware
of that effect when intepreting the results.
If you need help interpreting the logfile you can send it to me. Make sure you compress
it (they compress VERY well :-)
Colin
--
cburgess@qnx.com
Tim Gessner wrote:
> There are no mutexes or anything of that sort, they do all use Ethernet
> sockets, message pulses and timers. There is nothing I can think of
> that would should interrupt the 255 thread and nothing for which it
> should have to wait while elevating another thread.
>
> Tim
>
> -----Original Message-----
> From: Colin Burgess [mailto:cburgess@qnx.com]
> Sent: Monday, July 21, 2008 12:44 PM
> To: ostech-core_os
> Subject: Re: thread scheduling jitter question
>
> Is the 255 thread holding any shared resources that would boost the
> lower threads?
>
> Tim Gessner wrote:
>> No, I had 1 thread at 255, a few threads at above normal (12), and a
>> couple of threads at normal. All the threads exhibited jitter
> including
>> the thread at 255. I switched all the threads to FIFO and all the
>> jitter went away. I would expect that from all the threads except the
>> 255 thread. I would have thought that that would be consistent no
>> matter what.
>>
>> Since I'm sharing resources it makes sense that the other threads
>> exhibited some jitter, but not the 255 thread.
>>
>> Tim
>>
>> -----Original Message-----
>> From: Martin Doane [mailto:martin.doane@dematic.com]
>> Sent: Monday, July 21, 2008 8:27 AM
>> To: ostech-core_os
>> Subject: Re: thread scheduling jitter question
>>
>> So you had a single thread running at 255 that exhibited jitter, and
> if
>> you change that thread from Round Robin to FIFO, the jitter goes away?
>>
>>> FYI...
>>>
>>> I switched the scheduling algorithm and it made a significant
>> difference. I
>>> was using Round Robin and switched to FIFO. It makes sense in my
>> case, but
>>> the FIFO eliminated the jitter problems completely.
>>
>> _______________________________________________
>> OSTech
>> http://community.qnx.com/sf/go/post10807
>>
>>
>> _______________________________________________
>> OSTech
>> http://community.qnx.com/sf/go/post10808
>>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10829
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post10848
>
|
|
|
|