Efficient context saving and restoring in a multi-tasking computing system environment
First Claim
1. A process comprising:
- executing a first program on a first processor;
receiving a context switch request from a second processor;
responding to the context switch request at an appropriate point in the first program, the appropriate point being one of a plurality of predetermined points indicated by a plurality of markers in the first program, the plurality of predetermined points including selected predetermined points located at a proximate point in the first program that is predetermined to be a point in which the first processor requires a minimal amount of processor state information storage for successful restoration of the first program;
continuing to execute the first program after receiving the context switch request;
wherein the responding comprises;
encountering the marker in the first program at the appropriate point;
interrupting the first processor;
reading the context switch request with the first processor in response to encountering the marker in the first program;
storing a return address of the first program;
storing the minimal amount of processor state information required for successful restoration of the first program; and
notifying the second processor of the availability of the first processor to execute a second program.
2 Assignments
0 Petitions
Accused Products
Abstract
In a multi-tasking computing system environment, one program is halted and context switched out so that a processor may context switch in a subsequent program for execution. Processor state information exists which reflects the state of the program being context switched out. Storage of this processor state information permits successful resumption of the context switched out program. When the context switched out program is subsequently context switched in, the stored processor information is loaded in preparation for successfully resuming the program at the point in which execution was previously halted. Although, large areas of memory can be allocated to processor state information storage, only a portion of this may need to be preserved across a context switch for successfully saving and resuming the context switched out program. Unnecessarily saving and loading all available processor state information can be noticeably inefficient particularly where relatively large amounts of processor state information exists. In one embodiment, a processor requests a co-processor to context switch out the currently executing program. At a predetermined appropriate point in the executing program, the co-processor responds by halting program execution and saving only the minimal amount of processor state information necessary for successful restoration of the program. The appropriate point is chosen by the application programmer at a location in the executing program that requires preserving a minimal portion of the processor information across a context switch. By saving only a minimal amount of processor information, processor time savings are accumulated across context save and restoration operations.
-
Citations
23 Claims
-
1. A process comprising:
-
executing a first program on a first processor; receiving a context switch request from a second processor; responding to the context switch request at an appropriate point in the first program, the appropriate point being one of a plurality of predetermined points indicated by a plurality of markers in the first program, the plurality of predetermined points including selected predetermined points located at a proximate point in the first program that is predetermined to be a point in which the first processor requires a minimal amount of processor state information storage for successful restoration of the first program; continuing to execute the first program after receiving the context switch request;
wherein the responding comprises;encountering the marker in the first program at the appropriate point; interrupting the first processor; reading the context switch request with the first processor in response to encountering the marker in the first program; storing a return address of the first program; storing the minimal amount of processor state information required for successful restoration of the first program; and notifying the second processor of the availability of the first processor to execute a second program. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 23)
-
-
9. A computing system comprising:
-
a first processor in a multi-tasking environment for executing programs having respective pluralities of interspersed context switch markers, the pluralities of interspersed context switch markers being located in the programs at predetermined points, the predetermined points including points determined to be proximate to locations in which the first processor requires a minimal amount of processor state information storage for successful restoration of the programs; a first memory, coupled to the first processor, allocated to storage of processor state information; a second memory coupled to the first processor; a context switch request detector operating on the first processor for detecting, after the processor encounters one of the markers in an executing program, a request to context switch out the program; and a context saving module operating on the first processor for responding to a detected context switch request by saving in the second memory processor state information located in the first memory, wherein the contest saving module includes; a module being operable to encounter the marker in the first program at the appropriate point; a module operable to interrupt the first processor; a module operable to read the context switch request with the first processor in response to encountering the marker in the first program; a module operable to store a return address of the first program; a module operable to store the minimal amount of processor state information required for successful restoration of the first program; and a module operable to notify the second processor of the availability of the first processor to execute a second program. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. An efficient context saving process in a multi-tasking, multiprocessor computing system environment, comprising:
-
inserting conditional context switch instructions into a first program at a plurality of predetermined points in the first program; executing the first program; receiving a context switch request; detecting one of the conditional context switch instructions; determining whether the context switch request exists from a first processor following the detecting one of the conditional context switch instructions; and switching out the first program comprising; saving a return address of the program upon determining the existence of a context switch request, otherwise continuing to execute the first program; and executing a context saving module, comprising; storing processor state information corresponding to a state of the first program prior to detecting the conditional context switch instruction; saving a location of context restoration module; interrupting the first processor, continuing to execute the first program after receiving the context switch request;
wherein the first proven responds to the context switch, the responding comprises;encountering the marker in the first program at the appropriate point; interrupting the first processor; reading the context switch request with the first processor in response to encountering the marker in the first program; storing a return address of the first program; storing the processor state information required for successful restoration of the first program; and notifying a second processor of the availability of the first processor to execute a second program. - View Dependent Claims (18, 19, 20, 21, 22)
-
Specification