OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [doc/] [supplements/] [arm/] [timing.texi] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
@c
2
@c  COPYRIGHT (c) 1988-2002.
3
@c  On-Line Applications Research Corporation (OAR).
4
@c  All rights reserved.
5
@c
6
@c  timing.texi,v 1.1 2002/07/30 21:43:53 joel Exp
7
@c
8
 
9
 
10
@node Timing Specification, Timing Specification Introduction, Memory Requirements RTEMS RAM Workspace Worksheet, Top
11
 
12
@chapter Timing Specification
13
@ifinfo
14
@menu
15
* Timing Specification Introduction::
16
* Timing Specification Philosophy::
17
* Timing Specification Methodology::
18
@end menu
19
@end ifinfo
20
 
21
 
22
@node Timing Specification Introduction, Timing Specification Philosophy, Timing Specification, Timing Specification
23
 
24
@section Introduction
25
 
26
This chapter provides information pertaining to the
27
measurement of the performance of RTEMS, the methods of
28
gathering the timing data, and the usefulness of the data.  Also
29
discussed are other time critical aspects of RTEMS that affect
30
an applications design and ultimate throughput.  These aspects
31
include determinancy, interrupt latency and context switch times.
32
 
33
 
34
@node Timing Specification Philosophy, Timing Specification Determinancy, Timing Specification Introduction, Timing Specification
35
 
36
@section Philosophy
37
@ifinfo
38
@menu
39
* Timing Specification Determinancy::
40
* Timing Specification Interrupt Latency::
41
* Timing Specification Context Switch Time::
42
* Timing Specification Directive Times::
43
@end menu
44
@end ifinfo
45
 
46
Benchmarks are commonly used to evaluate the
47
performance of software and hardware.  Benchmarks can be an
48
effective tool when comparing systems.  Unfortunately,
49
benchmarks can also be manipulated to justify virtually any
50
claim.  Benchmarks of real-time executives are difficult to
51
evaluate for a variety of reasons.  Executives vary in the
52
robustness of features and options provided.  Even when
53
executives compare favorably in functionality, it is quite
54
likely that different methodologies were used to obtain the
55
timing data.  Another problem is that some executives provide
56
times for only a small subset of directives,  This is typically
57
justified by claiming that these are the only time-critical
58
directives.  The performance of some executives is also very
59
sensitive to the number of objects in the system.  To obtain any
60
measure of usefulness, the performance information provided for
61
an executive should address each of these issues.
62
 
63
When evaluating the performance of a real-time
64
executive, one typically considers the following areas:
65
determinancy, directive times, worst case interrupt latency, and
66
context switch time.  Unfortunately, these areas do not have
67
standard measurement methodologies.  This allows vendors to
68
manipulate the results such that their product is favorably
69
represented.  We have attempted to provide useful and meaningful
70
timing information for RTEMS.  To insure the usefulness of our
71
data, the methodology and definitions used to obtain and
72
describe the data are also documented.
73
 
74
 
75
@node Timing Specification Determinancy, Timing Specification Interrupt Latency, Timing Specification Philosophy, Timing Specification Philosophy
76
 
77
@subsection Determinancy
78
 
79
The correctness of data in a real-time system must
80
always be judged by its timeliness.  In many real-time systems,
81
obtaining the correct answer does not necessarily solve the
82
problem.  For example, in a nuclear reactor it is not enough to
83
determine that the core is overheating.  This situation must be
84
detected and acknowledged early enough that corrective action
85
can be taken and a meltdown avoided.
86
 
87
Consequently, a system designer must be able to
88
predict the worst-case behavior of the application running under
89
the selected executive.  In this light, it is important that a
90
real-time system perform consistently regardless of the number
91
of tasks, semaphores, or other resources allocated.  An
92
important design goal of a real-time executive is that all
93
internal algorithms be fixed-cost.  Unfortunately, this goal is
94
difficult to completely meet without sacrificing the robustness
95
of the executive's feature set.
96
 
97
Many executives use the term deterministic to mean
98
that the execution times of their services can be predicted.
99
However, they often provide formulas to modify execution times
100
based upon the number of objects in the system.  This usage is
101
in sharp contrast to the notion of deterministic meaning fixed
102
cost.
103
 
104
Almost all RTEMS directives execute in a fixed amount
105
of time regardless of the number of objects present in the
106
system.  The primary exception occurs when a task blocks while
107
acquiring a resource and specifies a non-zero timeout interval.
108
 
109
Other exceptions are message queue broadcast,
110
obtaining a variable length memory block, object name to ID
111
translation, and deleting a resource upon which tasks are
112
waiting.  In addition, the time required to service a clock tick
113
interrupt is based upon the number of timeouts and other
114
"events" which must be processed at that tick.  This second
115
group is composed primarily of capabilities which are inherently
116
non-deterministic but are infrequently used in time critical
117
situations.  The major exception is that of servicing a clock
118
tick.  However, most applications have a very small number of
119
timeouts which expire at exactly the same millisecond (usually
120
none, but occasionally two or three).
121
 
122
 
123
@node Timing Specification Interrupt Latency, Timing Specification Context Switch Time, Timing Specification Determinancy, Timing Specification Philosophy
124
 
125
@subsection Interrupt Latency
126
 
127
Interrupt latency is the delay between the CPU's
128
receipt of an interrupt request and the execution of the first
129
application-specific instruction in an interrupt service
130
routine.  Interrupts are a critical component of most real-time
131
applications and it is critical that they be acted upon as
132
quickly as possible.
133
 
134
Knowledge of the worst case interrupt latency of an
135
executive aids the application designer in determining the
136
maximum period of time between the generation of an interrupt
137
and an interrupt handler responding to that interrupt.  The
138
interrupt latency of an system is the greater of the executive's
139
and the applications's interrupt latency.  If the application
140
disables interrupts longer than the executive, then the
141
application's interrupt latency is the system's worst case
142
interrupt disable period.
143
 
144
The worst case interrupt latency for a real-time
145
executive is based upon the following components:
146
 
147
@itemize @bullet
148
@item the longest period of time interrupts are disabled
149
by the executive,
150
 
151
@item the overhead required by the executive at the
152
beginning of each ISR,
153
 
154
@item the time required for the CPU to vector the
155
interrupt, and
156
 
157
@item for some microprocessors, the length of the longest
158
instruction.
159
@end itemize
160
 
161
The first component is irrelevant if an interrupt
162
occurs when interrupts are enabled, although it must be included
163
in a worst case analysis.  The third and fourth components are
164
particular to a CPU implementation and are not dependent on the
165
executive.  The fourth component is ignored by this document
166
because most applications use only a subset of a
167
microprocessor's instruction set.  Because of this the longest
168
instruction actually executed is application dependent.  The
169
worst case interrupt latency of an executive is typically
170
defined as the sum of components (1) and (2).  The second
171
component includes the time necessry for RTEMS to save registers
172
and vector to the user-defined handler.  RTEMS includes the
173
third component, the time required for the CPU to vector the
174
interrupt, because it is a required part of any interrupt.
175
 
176
Many executives report the maximum interrupt disable
177
period as their interrupt latency and ignore the other
178
components.  This results in very low worst-case interrupt
179
latency times which are not indicative of actual application
180
performance.  The definition used by RTEMS results in a higher
181
interrupt latency being reported, but accurately reflects the
182
longest delay between the CPU's receipt of an interrupt request
183
and the execution of the first application-specific instruction
184
in an interrupt service routine.
185
 
186
The actual interrupt latency times are reported in
187
the Timing Data chapter of this supplement.
188
 
189
 
190
@node Timing Specification Context Switch Time, Timing Specification Directive Times, Timing Specification Interrupt Latency, Timing Specification Philosophy
191
 
192
@subsection Context Switch Time
193
 
194
An RTEMS context switch is defined as the act of
195
taking the CPU from the currently executing task and giving it
196
to another task.  This process involves the following components:
197
 
198
@itemize @bullet
199
@item Saving the hardware state of the current task.
200
 
201
@item Optionally, invoking the TASK_SWITCH user extension.
202
 
203
@item Restoring the hardware state of the new task.
204
@end itemize
205
 
206
RTEMS defines the hardware state of a task to include
207
the CPU's data registers, address registers, and, optionally,
208
floating point registers.
209
 
210
Context switch time is often touted as a performance
211
measure of real-time executives.  However, a context switch is
212
performed as part of a directive's actions and should be viewed
213
as such when designing an application.  For example, if a task
214
is unable to acquire a semaphore and blocks, a context switch is
215
required to transfer control from the blocking task to a new
216
task.  From the application's perspective, the context switch is
217
a direct result of not acquiring the semaphore.  In this light,
218
the context switch time is no more relevant than the performance
219
of any other of the executive's subroutines which are not
220
directly accessible by the application.
221
 
222
In spite of the inappropriateness of using the
223
context switch time as a performance metric, RTEMS context
224
switch times for floating point and non-floating points tasks
225
are provided for comparison purposes.  Of the executives which
226
actually support floating point operations, many do not report
227
context switch times for floating point context switch time.
228
This results in a reported context switch time which is
229
meaningless for an application with floating point tasks.
230
 
231
The actual context switch times are reported in the
232
Timing Data chapter of this supplement.
233
 
234
 
235
@node Timing Specification Directive Times, Timing Specification Methodology, Timing Specification Context Switch Time, Timing Specification Philosophy
236
 
237
@subsection Directive Times
238
 
239
Directives are the application's interface to the
240
executive, and as such their execution times are critical in
241
determining the performance of the application.  For example, an
242
application using a semaphore to protect a critical data
243
structure should be aware of the time required to acquire and
244
release a semaphore.  In addition, the application designer can
245
utilize the directive execution times to evaluate the
246
performance of different synchronization and communication
247
mechanisms.
248
 
249
The actual directive execution times are reported in
250
the Timing Data chapter of this supplement.
251
 
252
 
253
@node Timing Specification Methodology, Timing Specification Software Platform, Timing Specification Directive Times, Timing Specification
254
 
255
@section Methodology
256
@ifinfo
257
@menu
258
* Timing Specification Software Platform::
259
* Timing Specification Hardware Platform::
260
* Timing Specification What is measured?::
261
* Timing Specification What is not measured?::
262
* Timing Specification Terminology::
263
@end menu
264
@end ifinfo
265
 
266
 
267
@node Timing Specification Software Platform, Timing Specification Hardware Platform, Timing Specification Methodology, Timing Specification Methodology
268
 
269
@subsection Software Platform
270
 
271
The RTEMS timing suite is written in C.  The overhead
272
of passing arguments to RTEMS by C is not timed.  The times
273
reported represent the amount of time from entering to exiting
274
RTEMS.
275
 
276
The tests are based upon one of two execution models:
277
(1) single invocation times, and (2) average times of repeated
278
invocations.  Single invocation times are provided for
279
directives which cannot easily be invoked multiple times in the
280
same scenario.  For example, the times reported for entering and
281
exiting an interrupt service routine are single invocation
282
times.  The second model is used for directives which can easily
283
be invoked multiple times in the same scenario.  For example,
284
the times reported for semaphore obtain and semaphore release
285
are averages of multiple invocations.  At least 100 invocations
286
are used to obtain the average.
287
 
288
 
289
@node Timing Specification Hardware Platform, Timing Specification What is measured?, Timing Specification Software Platform, Timing Specification Methodology
290
 
291
@subsection Hardware Platform
292
 
293
Since RTEMS supports a variety of processors, the
294
hardware platform used to gather the benchmark times must also
295
vary.  Therefore, for each processor supported the hardware
296
platform must be defined.  Each definition will include a brief
297
description of the target hardware platform including the clock
298
speed, memory wait states encountered, and any other pertinent
299
information.  This definition may be found in the processor
300
dependent timing data chapter within this supplement.
301
 
302
 
303
@node Timing Specification What is measured?, Timing Specification What is not measured?, Timing Specification Hardware Platform, Timing Specification Methodology
304
 
305
@subsection What is measured?
306
 
307
An effort was made to provide execution times for a
308
large portion of RTEMS.  Times were provided for most directives
309
regardless of whether or not they are typically used in time
310
critical code.  For example, execution times are provided for
311
all object create and delete directives, even though these are
312
typically part of application initialization.
313
 
314
The times include all RTEMS actions necessary in a
315
particular scenario.  For example, all times for blocking
316
directives include the context switch necessary to transfer
317
control to a new task.  Under no circumstances is it necessary
318
to add context switch time to the reported times.
319
 
320
The following list describes the objects created by
321
the timing suite:
322
 
323
@itemize @bullet
324
@item All tasks are non-floating point.
325
 
326
@item All tasks are created as local objects.
327
 
328
@item No timeouts are used on blocking directives.
329
 
330
@item All tasks wait for objects in FIFO order.
331
 
332
@end itemize
333
 
334
In addition, no user extensions are configured.
335
 
336
 
337
@node Timing Specification What is not measured?, Timing Specification Terminology, Timing Specification What is measured?, Timing Specification Methodology
338
 
339
@subsection What is not measured?
340
 
341
The times presented in this document are not intended
342
to represent best or worst case times, nor are all directives
343
included.  For example, no times are provided for the initialize
344
executive and fatal_error_occurred directives.  Other than the
345
exceptions detailed in the Determinancy section, all directives
346
will execute in the fixed length of time given.
347
 
348
Other than entering and exiting an interrupt service
349
routine, all directives were executed from tasks and not from
350
interrupt service routines.  Directives invoked from ISRs, when
351
allowable, will execute in slightly less time than when invoked
352
from a task because rescheduling is delayed until the interrupt
353
exits.
354
 
355
 
356
@node Timing Specification Terminology, MYBSP Timing Data, Timing Specification What is not measured?, Timing Specification Methodology
357
 
358
@subsection Terminology
359
 
360
The following is a list of phrases which are used to
361
distinguish individual execution paths of the directives taken
362
during the RTEMS performance analysis:
363
 
364
@table @b
365
@item another task
366
The directive was performed
367
on a task other than the calling task.
368
 
369
@item available
370
A task attempted to obtain a resource and
371
immediately acquired it.
372
 
373
@item blocked task
374
The task operated upon by the
375
directive was blocked waiting for a resource.
376
 
377
@item caller blocks
378
The requested resoure was not
379
immediately available and the calling task chose to wait.
380
 
381
@item calling task
382
The task invoking the directive.
383
 
384
@item messages flushed
385
One or more messages was flushed
386
from the message queue.
387
 
388
@item no messages flushed
389
No messages were flushed from
390
the message queue.
391
 
392
@item not available
393
A task attempted to obtain a resource
394
and could not immediately acquire it.
395
 
396
@item no reschedule
397
The directive did not require a
398
rescheduling operation.
399
 
400
@item NO_WAIT
401
A resource was not available and the
402
calling task chose to return immediately via the NO_WAIT option
403
with an error.
404
 
405
@item obtain current
406
The current value of something was
407
requested by the calling task.
408
 
409
@item preempts caller
410
The release of a resource caused a
411
task of higher priority than the calling to be readied and it
412
became the executing task.
413
 
414
@item ready task
415
The task operated upon by the directive
416
was in the ready state.
417
 
418
@item reschedule
419
The actions of the directive
420
necessitated a rescheduling operation.
421
 
422
@item returns to caller
423
The directive succeeded and
424
immediately returned to the calling task.
425
 
426
@item returns to interrupted task
427
The instructions
428
executed immediately following this interrupt will be in the
429
interrupted task.
430
 
431
@item returns to nested interrupt
432
The instructions
433
executed immediately following this interrupt will be in a
434
previously interrupted ISR.
435
 
436
@item returns to preempting task
437
The instructions
438
executed immediately following this interrupt or signal handler
439
will be in a task other than the interrupted task.
440
 
441
@item signal to self
442
The signal set was sent to the
443
calling task and signal processing was enabled.
444
 
445
@item suspended task
446
The task operated upon by the
447
directive was in the suspended state.
448
 
449
@item task readied
450
The release of a resource caused a
451
task of lower or equal priority to be readied and the calling
452
task remained the executing task.
453
 
454
@item yield
455
The act of attempting to voluntarily release
456
the CPU.
457
 
458
@end table
459
 
460
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.