|
|
|
|
|
|
Figure 3.1
Expected percent of time in various
machine states (UNIX workstation
environment). |
|
|
|
|
|
|
|
|
include all uses of load and store multiples, not just calls. The Rossmann data is older than other data cited, perhaps from a time when software took a more brute-force approach to save and restore by conservatively saving more registers than required. |
|
|
|
|
|
|
|
|
The LDM/STM behavior is important, since the number of registers involved in the transfer directly determine the number of cycles or the amount of time involved in accomplishing the operation. |
|
|
|
|
|
|
|
|
3.3.2 Calls to the System |
|
|
|
|
|
|
|
|
During the execution of any user program, the operating system must usually be invoked to provide services. Inspection of 20 workstation-type programs under UNIX has shown that programs spend less than one percent of the time in systems execution for some applications, while others spend as much as 95% of the time in systems execution. The average time that UNIX applications were in the system state was 28.6% (exclusive of virtual memory swapping time). Figure 3.1 shows a rough user-to-system allocation and, within the user allocation, the execution time spent in user procedures vs. library procedures. A 60-1030 breakdown for user procedures, library procedures, and systems execution seems a reasonable expectation, although the variability from application to application is huge. |
|
|
|
|
|
|
|
|
Systems calls typically differ from user procedure calls by requiring additional activity (instructions) to complete their execution. This additional "work" depends on the type of system call invoked. Much system activity can be classified as falling into one of four categories: |
|
|
|
|
|
|
|
|
3. Page table entry change (not in TLB). |
|
|
|
|
|
|
|
|
A system call/return differs from a procedure call/return by usually requiring that all of the general-purpose registers (rather than just those required for parameters) be saved and later restored. Additionally, some bookkeeping is involved for managing the process id number. |
|
|
|
|
|
|
|
|
A trap or an interrupt requires additional work, as the floating point registers need to be saved and restored and the processor must examine the |
|
|
|
|
|