* [ECOS] Thread execution time @ 2003-08-28 9:17 Michele Portolan 2003-08-28 9:38 ` Andrew Lunn 2003-08-28 11:26 ` Nick Garnett 0 siblings, 2 replies; 8+ messages in thread From: Michele Portolan @ 2003-08-28 9:17 UTC (permalink / raw) To: ecos-discuss Hi, how can I know the time quantum left by eCos to a thread, i.e. the time between two context switches? I have not been able to figure it out from tm_basic outputs. Is there also a way to estimate the time needed by "load context" only and not complete context switch? Thanks you a lot, Michele -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] Thread execution time 2003-08-28 9:17 [ECOS] Thread execution time Michele Portolan @ 2003-08-28 9:38 ` Andrew Lunn 2003-08-28 9:48 ` [ECOS] R: " Michele Portolan 2003-08-28 11:26 ` Nick Garnett 1 sibling, 1 reply; 8+ messages in thread From: Andrew Lunn @ 2003-08-28 9:38 UTC (permalink / raw) To: Michele Portolan; +Cc: ecos-discuss On Thu, Aug 28, 2003 at 10:54:19AM +0200, Michele Portolan wrote: > Hi, > how can I know the time quantum left by eCos to a thread, i.e. the time > between two context switches? Im not sure i understand what you mean. Do you mean how long does a thread run before it is round robin time sliced by another thread at the same priority? By default a thread runs for five ticks. Its controlled by CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS. > Is there also a way to estimate the time needed by "load context" only and > not complete context switch? What exactly are you trying to work out? What is the reason behind these questions. Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] R: [ECOS] Thread execution time 2003-08-28 9:38 ` Andrew Lunn @ 2003-08-28 9:48 ` Michele Portolan 2003-08-28 10:12 ` Andrew Lunn 0 siblings, 1 reply; 8+ messages in thread From: Michele Portolan @ 2003-08-28 9:48 UTC (permalink / raw) Cc: ecos-discuss What do you mean by "ticks"? Do yo mean clock cycles? I am working on possible modifications of context-switching mechanism to implement fault tolerance funtionalities. I have just begun, there is not much yet, but I need these data as a comparison and make some "a priori" evaluation Michele > On Thu, Aug 28, 2003 at 10:54:19AM +0200, Michele Portolan wrote: > > Hi, > > how can I know the time quantum left by eCos to a thread, i.e. the time > > between two context switches? > > Im not sure i understand what you mean. Do you mean how long does a > thread run before it is round robin time sliced by another thread at > the same priority? By default a thread runs for five ticks. Its > controlled by CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS. > > > Is there also a way to estimate the time needed by "load context" only and > > not complete context switch? > > What exactly are you trying to work out? What is the reason behind these > questions. > > Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] R: [ECOS] Thread execution time 2003-08-28 9:48 ` [ECOS] R: " Michele Portolan @ 2003-08-28 10:12 ` Andrew Lunn 2003-08-28 10:23 ` [ECOS] R: " Michele Portolan 0 siblings, 1 reply; 8+ messages in thread From: Andrew Lunn @ 2003-08-28 10:12 UTC (permalink / raw) To: Michele Portolan; +Cc: ecos-discuss On Thu, Aug 28, 2003 at 11:24:22AM +0200, Michele Portolan wrote: > What do you mean by "ticks"? Do yo mean clock cycles? A tick is normally 10ms, but as with everything else in eCos, its configurable. > I am working on possible modifications of context-switching mechanism to > implement fault tolerance funtionalities. > I have just begun, there is not much yet, but I need these data as a > comparison and make some "a priori" evaluation Well 50ms round robin times and micro second context switches? There are orders of magnitude differences here! What sort of fault tolerance functionalities? IMHO, they don't make much sense in an embedded system. You don't have a process context you can clean up when something goes wrong. The thread could have all sorts of mutex's locked, semaphores signaled, memory allocated etc. Killing a thread will probably result in a deadlock sometime later or memory exhortion. You just have a cascade of faults.... About the only fault tolerance functionality that makes sense to me is "Something major has happened, lets try to do a controlled shutdown and reboot before the watchdog timer reboot us anyway." The eCos exception handling gives you enough to do this already. Andrew > > Michele > > > On Thu, Aug 28, 2003 at 10:54:19AM +0200, Michele Portolan wrote: > > > Hi, > > > how can I know the time quantum left by eCos to a thread, i.e. the time > > > between two context switches? > > > > Im not sure i understand what you mean. Do you mean how long does a > > thread run before it is round robin time sliced by another thread at > > the same priority? By default a thread runs for five ticks. Its > > controlled by CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS. > > > > > Is there also a way to estimate the time needed by "load context" only > and > > > not complete context switch? > > > > What exactly are you trying to work out? What is the reason behind these > > questions. > > > > Andrew > > > -- > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] R: [ECOS] R: [ECOS] Thread execution time 2003-08-28 10:12 ` Andrew Lunn @ 2003-08-28 10:23 ` Michele Portolan 2003-08-28 10:49 ` Gary Thomas 2003-08-28 11:17 ` Andrew Lunn 0 siblings, 2 replies; 8+ messages in thread From: Michele Portolan @ 2003-08-28 10:23 UTC (permalink / raw) To: ecos-discuss There is a couple of things that I still don't understand: When tm_basic mesures "Thread switch" it is just the time needed to make a context switch (i.e. save the context of old thread, load the new one's and let it start), is it? Where CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS is set? I cannot find it I also find really strange for "ticks" to be a fixed time, regardless of the actual work frequency. In my configration I get a "Thread Switch" of approximately 50ms. So it seems that OS executes for at least as much time as threads. Is it correct? Michele ----- Original Message ----- From: Andrew Lunn <andrew.lunn@ascom.ch> To: Michele Portolan <michele.Portolan@imag.fr> Cc: <ecos-discuss@sources.redhat.com> Sent: Thursday, August 28, 2003 12:12 PM Subject: Re: [ECOS] R: [ECOS] Thread execution time > On Thu, Aug 28, 2003 at 11:24:22AM +0200, Michele Portolan wrote: > > What do you mean by "ticks"? Do yo mean clock cycles? > > A tick is normally 10ms, but as with everything else in eCos, its > configurable. > > > I am working on possible modifications of context-switching mechanism to > > implement fault tolerance funtionalities. > > I have just begun, there is not much yet, but I need these data as a > > comparison and make some "a priori" evaluation > > Well 50ms round robin times and micro second context switches? There > are orders of magnitude differences here! > > What sort of fault tolerance functionalities? IMHO, they don't make > much sense in an embedded system. You don't have a process context you > can clean up when something goes wrong. The thread could have all > sorts of mutex's locked, semaphores signaled, memory allocated > etc. Killing a thread will probably result in a deadlock sometime > later or memory exhortion. You just have a cascade of faults.... > > About the only fault tolerance functionality that makes sense to me is > "Something major has happened, lets try to do a controlled shutdown > and reboot before the watchdog timer reboot us anyway." The eCos > exception handling gives you enough to do this already. > > Andrew > > > > Michele > > > > > On Thu, Aug 28, 2003 at 10:54:19AM +0200, Michele Portolan wrote: > > > > Hi, > > > > how can I know the time quantum left by eCos to a thread, i.e. the time > > > > between two context switches? > > > > > > Im not sure i understand what you mean. Do you mean how long does a > > > thread run before it is round robin time sliced by another thread at > > > the same priority? By default a thread runs for five ticks. Its > > > controlled by CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS. > > > > > > > Is there also a way to estimate the time needed by "load context" only > > and > > > > not complete context switch? > > > > > > What exactly are you trying to work out? What is the reason behind these > > > questions. > > > > > > Andrew > > > > > > -- > > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > > > > -- > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] R: [ECOS] R: [ECOS] Thread execution time 2003-08-28 10:23 ` [ECOS] R: " Michele Portolan @ 2003-08-28 10:49 ` Gary Thomas 2003-08-28 11:17 ` Andrew Lunn 1 sibling, 0 replies; 8+ messages in thread From: Gary Thomas @ 2003-08-28 10:49 UTC (permalink / raw) To: Michele Portolan; +Cc: eCos Discussion On Thu, 2003-08-28 at 04:00, Michele Portolan wrote: > There is a couple of things that I still don't understand: > When tm_basic mesures "Thread switch" it is just the time needed to make a > context switch (i.e. save the context of old thread, load the new one's and > let it start), is it? > Where CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS is set? I cannot find it > I also find really strange for "ticks" to be a fixed time, regardless of the > actual work frequency. In my configration I get a "Thread Switch" of > approximately 50ms. So it seems that OS executes for at least as much time > as threads. Is it correct? > Think of system "ticks" as the heartbeat of the OS. They are designed to be a fixed quantity, normally 10ms. To generate such a periodic quantity, we rely on hardware which may have a timer run from a periodic clock at a high rate. This can be anything, so long as we can determine when 10ms have gone by (and hopefully get an interrupt at that point). The relationship between hardware clock "ticks" and system "ticks" (sadly the same name is used for two very different things) is kept in the constant CYGNUM_HAL_RTC_PERIOD which is calculated by the CDL for your platform. As for 50ms thread switch times, there is something very wrong with your setup. Times around 50us (1000 times faster) are more usual. > Michele > > ----- Original Message ----- > From: Andrew Lunn <andrew.lunn@ascom.ch> > To: Michele Portolan <michele.Portolan@imag.fr> > Cc: <ecos-discuss@sources.redhat.com> > Sent: Thursday, August 28, 2003 12:12 PM > Subject: Re: [ECOS] R: [ECOS] Thread execution time > > > > On Thu, Aug 28, 2003 at 11:24:22AM +0200, Michele Portolan wrote: > > > What do you mean by "ticks"? Do yo mean clock cycles? > > > > A tick is normally 10ms, but as with everything else in eCos, its > > configurable. > > > > > I am working on possible modifications of context-switching mechanism to > > > implement fault tolerance funtionalities. > > > I have just begun, there is not much yet, but I need these data as a > > > comparison and make some "a priori" evaluation > > > > Well 50ms round robin times and micro second context switches? There > > are orders of magnitude differences here! > > > > What sort of fault tolerance functionalities? IMHO, they don't make > > much sense in an embedded system. You don't have a process context you > > can clean up when something goes wrong. The thread could have all > > sorts of mutex's locked, semaphores signaled, memory allocated > > etc. Killing a thread will probably result in a deadlock sometime > > later or memory exhortion. You just have a cascade of faults.... > > > > About the only fault tolerance functionality that makes sense to me is > > "Something major has happened, lets try to do a controlled shutdown > > and reboot before the watchdog timer reboot us anyway." The eCos > > exception handling gives you enough to do this already. > > > > Andrew > > > > > > Michele > > > > > > > On Thu, Aug 28, 2003 at 10:54:19AM +0200, Michele Portolan wrote: > > > > > Hi, > > > > > how can I know the time quantum left by eCos to a thread, i.e. the > time > > > > > between two context switches? > > > > > > > > Im not sure i understand what you mean. Do you mean how long does a > > > > thread run before it is round robin time sliced by another thread at > > > > the same priority? By default a thread runs for five ticks. Its > > > > controlled by CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS. > > > > > > > > > Is there also a way to estimate the time needed by "load context" > only > > > and > > > > > not complete context switch? > > > > > > > > What exactly are you trying to work out? What is the reason behind > these > > > > questions. > > > > > > > > Andrew > > > > > > > > > -- > > > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > > > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > > > > > > > -- > > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos > > and search the list archive: http://sources.redhat.com/ml/ecos-discuss > > -- Gary Thomas <gary@mlbassoc.com> MLB Associates -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] R: [ECOS] R: [ECOS] Thread execution time 2003-08-28 10:23 ` [ECOS] R: " Michele Portolan 2003-08-28 10:49 ` Gary Thomas @ 2003-08-28 11:17 ` Andrew Lunn 1 sibling, 0 replies; 8+ messages in thread From: Andrew Lunn @ 2003-08-28 11:17 UTC (permalink / raw) To: Michele Portolan; +Cc: ecos-discuss > Where CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS is set? I cannot find it Its a configuration parameter, so it will be in your ecos.ecc file and put into install/include/pkgconf/kernel.h. Andrew -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] Thread execution time 2003-08-28 9:17 [ECOS] Thread execution time Michele Portolan 2003-08-28 9:38 ` Andrew Lunn @ 2003-08-28 11:26 ` Nick Garnett 1 sibling, 0 replies; 8+ messages in thread From: Nick Garnett @ 2003-08-28 11:26 UTC (permalink / raw) To: Michele Portolan; +Cc: ecos-discuss "Michele Portolan" <michele.Portolan@imag.fr> writes: > Hi, > how can I know the time quantum left by eCos to a thread, i.e. the time > between two context switches? > I have not been able to figure it out from tm_basic outputs. I'm not sure I understand what you want here. Threads are scheduled according to priority, so it depends on the activities of this thread, other threads and interrupts how long a thread gets to run before it is preempted or goes to sleep. Threads are not given fixed time quanta. > Is there also a way to estimate the time needed by "load context" only and > not complete context switch? Since saving a context and loading one use the same number of memory references, then half the context switch time is a good estimate. However, I'm not sure there is very much utility in knowing this number. We never load a context without saving one. The extra housekeeping work in the scheduler also needs to be accounted for, and not all of that can be attributed to the "save side" or the "load side". So, the entire context switch time is the most useful figure. -- Nick Garnett eCos Kernel Architect http://www.ecoscentric.com The eCos and RedBoot experts -- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2003-08-28 11:26 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2003-08-28 9:17 [ECOS] Thread execution time Michele Portolan 2003-08-28 9:38 ` Andrew Lunn 2003-08-28 9:48 ` [ECOS] R: " Michele Portolan 2003-08-28 10:12 ` Andrew Lunn 2003-08-28 10:23 ` [ECOS] R: " Michele Portolan 2003-08-28 10:49 ` Gary Thomas 2003-08-28 11:17 ` Andrew Lunn 2003-08-28 11:26 ` Nick Garnett
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).