Reusing snapshots shared between restoration and recovery
Sharing snapshots between restoration and recovery. A snapshot to be used for recovery and restoration is obtained. The snapshot includes restoration state for a plurality of architected registers. The plurality of architected registers includes one or more architected registers associated with an instruction to alter an execution path and one or more architected registers associated with a save request. At least one architected register of the plurality of architected registers is restored, based on a recovery request to recover at least one architected register associated with the instruction to alter the execution path or a restoration request to restore at least one architected register associated with the save request.
1 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:
at least one computer readable storage medium readable by at least one processing circuit and storing instructions for performing a method comprising:
receiving a first request to take a snapshot;
obtaining, based on receiving the first request to take the snapshot, a chosen snapshot comprising a mapping of architected register identifications to physical register identifications at a particular point in time, the chosen snapshot to be used for and shared with multiple types of processing, the multiple types of processing including recovery and restoration, the recovery being recovery from an instruction to alter an execution path, and the restoration being based on a bulk save request based on a function call, the chosen snapshot including restoration state for a plurality of architected registers, the plurality of architected registers including one or more first architected registers associated with the instruction to alter the execution path and usable in recovery and one or more second architected registers associated with the bulk save request and usable in restoration, wherein the chosen snapshot is a shared snapshot which includes a mapping of one or more architected register identifications to physical register identifications associated with the instruction to alter the execution path and usable in recovery, and a mapping of other architected register identifications to physical register identifications associated with the bulk save request and usable in restoration;
determining whether the one or more first architected registers and the one or more second architected registers of the plurality of architected registers have been modified since the chosen snapshot was taken by tracking, via a bitmap, registers that have not been written to since the chosen snapshot was taken;
restoring, using the chosen snapshot, at least one first architected register of the plurality of architected registers, based on a selected request, the selected request being a recovery request to recover at least one first architected register mapping associated with the instruction to alter the execution path, wherein the restoring for a given first architected register, of the at least one first architected register, replaces a physical register identification currently mapped to the given first architected register with a physical register identification previously mapped to the given first architected register; and
based on receiving a second request to take another snapshot comprising a mapping of architected register identifications to physical register identifications at another point in time, and based on determining, via the bitmap, that the one or more first architected registers and the one or more second architected registers have not been modified since the chosen snapshot was taken, reusing the chosen snapshot in place of taking the another snapshot to satisfy the second request to take the another snapshot, the reusing including setting a snapshot identifier (this_snapshot_ID) for identifying the another snapshot to an existing snapshot identifier (prev_snapshot_ID) identifying the chosen snapshot, wherein the reusing the chosen snapshot comprises maintaining a reference to the chosen snapshot as a last restoration snapshot taken that is shared between the recovery and the restoration.
2 . The computer program product of claim 1 , wherein the instruction to alter the execution path comprises a branch conditional instruction.
3 . The computer program product of claim 1 , wherein the instruction to alter the execution path comprises a jump instruction.
4 . The computer program product of claim 1 , wherein the bulk save request comprises a bulk store request.
5 . The computer program product of claim 1 , wherein the method further comprises creating the another snapshot based on determining that at least one selected architected register has been modified.
6 . The computer program product of claim 5 , wherein the another snapshot includes the at least one selected architected register that has been modified and fails to include architected registers of a set of architected registers that have not been modified.
7 . A computer system for facilitating processing within a computing environment, the computer system comprising:
a memory; and
a processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
receiving a first request to take a snapshot;
obtaining, based on receiving the first request to take the snapshot, a chosen snapshot comprising a mapping of architected register identifications to physical register identifications at a particular point in time, the chosen snapshot to be used for and shared with multiple types of processing, the multiple types of processing including recovery and restoration, the recovery being recovery from an instruction to alter an execution path, and the restoration being based on a bulk save request based on a function call, the chosen snapshot including restoration state for a plurality of architected registers, the plurality of architected registers including one or more first architected registers associated with the instruction to alter the execution path and usable in recovery and one or more second architected registers associated with the bulk save request and usable in restoration, wherein the chosen snapshot is a shared snapshot which includes a mapping of one or more architected register identifications to physical register identifications associated with the instruction to alter the execution path and usable in recovery, and a mapping of other architected register identifications to physical register identifications associated with the bulk save request and usable in restoration;
determining whether the one or more first architected registers and the one or more second architected registers of the plurality of architected registers have been modified since the chosen snapshot was taken by tracking, via a bitmap, registers that have not been written to since the chosen snapshot was taken;
restoring, using the chosen snapshot, at least one first architected register of the plurality of architected registers, based on a selected request, the selected request being a recovery request to recover at least one first architected register mapping associated with the instruction to alter the execution path, wherein the restoring for a given first architected register, of the at least one first architected register, replaces a physical register identification currently mapped to the given first architected register with a physical register identification previously mapped to the given first architected register; and
based on receiving a second request to take another snapshot comprising a mapping of architected register identifications to physical register identifications at another point in time, and based on determining, via the bitmap, that the one or more first architected registers and the one or more second architected registers have not been modified since the chosen snapshot was taken, reusing the chosen snapshot in place of taking the another snapshot to satisfy the second request to take the another snapshot, the reusing including setting a snapshot identifier (this_snapshot_ID) for identifying the another snapshot to an existing snapshot identifier (prev_snapshot_ID) identifying the chosen snapshot, wherein the reusing the chosen snapshot comprises maintaining a reference to the chosen snapshot as a last restoration snapshot taken that is shared between the recovery and the restoration.
8 . The computer system of claim 7 , wherein the instruction to alter the execution path comprises a branch conditional instruction.
9 . The computer system of claim 7 , wherein the instruction to alter the execution path comprises a jump instruction.
10 . The computer system of claim 7 , wherein the bulk save request comprises a bulk store request.
11 . The computer system of claim 7 , wherein the method further comprises creating the another snapshot based on determining that at least one selected architected register has been modified.
12 . A computer-implemented method of facilitating processing within a computing environment, the computer-implemented method comprising:
receiving a first request to take a snapshot;
obtaining, based on receiving the first request to take the snapshot, a chosen snapshot comprising a mapping of architected register identifications to physical register identifications at a particular point in time, the chosen snapshot to be used for and shared with multiple types of processing, the multiple types of processing including recovery and restoration, the recovery being recovery from an instruction to alter an execution path, and the restoration being based on a bulk save request based on a function call, the chosen snapshot including restoration state for a plurality of architected registers, the plurality of architected registers including one or more first architected registers associated with the instruction to alter the execution path and usable in recovery and one or more second architected registers associated with the bulk save request and usable in restoration, wherein the chosen snapshot is a shared snapshot which includes a mapping of one or more architected register identifications to physical register identifications associated with the instruction to alter the execution path and usable in recovery, and a mapping of other architected register identifications to physical register identifications associated with the bulk save request and usable in restoration;
determining whether the one or more first architected registers and the one or more second architected registers of the plurality of architected registers have been modified since the chosen snapshot was taken by tracking, via a bitmap, registers that have not been written to since the chosen snapshot was taken;
restoring, using the chosen snapshot, at least one first architected register of the plurality of architected registers, based on a selected request, the selected request being a recovery request to recover at least one first architected register mapping associated with the instruction to alter the execution path, wherein the restoring for a given first architected register, of the at least one first architected register, replaces a physical register identification currently mapped to the given first architected register with a physical register identification previously mapped to the given first architected register;
receiving a second request to take another snapshot comprising a mapping of architected register identifications to physical register identifications at another point in time;
detecting, via the bitmap, that the one or more first architected registers and the one or more second architected registers have not been modified since the chosen snapshot was taken; and
based on receiving the second request, and based on the detecting, reusing the chosen snapshot in place of taking the another snapshot to satisfy the second request to take the another snapshot, the reusing including setting a snapshot identifier (this_snapshot_ID) for identifying the another snapshot to an existing snapshot identifier (prev_snapshot_ID) identifying the chosen snapshot, wherein the reusing the chosen snapshot comprises maintaining a reference to the chosen snapshot as a last restoration snapshot taken that is shared between the recovery and the restoration.
13 . The computer-implemented method of claim 12 , wherein the instruction to alter the execution path comprises a branch conditional instruction.
14 . The computer-implemented method of claim 12 , wherein the instruction to alter the execution path comprises a jump instruction.
15 . The computer-implemented method of claim 12 , wherein the bulk save request comprises a bulk store request.
16 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:
at least one computer readable storage medium readable by at least one processing circuit and storing instructions for performing a method comprising:
receiving a first request to take a snapshot;
obtaining, based on receiving the first request to take the snapshot, a chosen snapshot comprising a mapping of architected register identifications to physical register identifications at a particular point in time, the chosen snapshot to be used for and shared with multiple types of processing, the multiple types of processing including recovery and restoration, the recovery being recovery from an instruction to alter an execution path, and the restoration being based on a bulk save request based on a function call, the chosen snapshot including restoration state for a plurality of architected registers, the plurality of architected registers including one or more first architected registers associated with the instruction to alter the execution path and usable in recovery and one or more second architected registers associated with the bulk save request and usable in restoration, wherein the chosen snapshot is a shared snapshot which includes a mapping of one or more architected register identifications to physical register identifications associated with the instruction to alter the execution path and usable in recovery, and a mapping of other architected register identifications to physical register identifications associated with the bulk save request and usable in restoration;
determining whether the one or more first architected registers and the one or more second architected registers of the plurality of architected registers have been modified since the chosen snapshot was taken by tracking, via a bitmap, registers that have not been written to since the chosen snapshot was taken;
restoring, using the chosen snapshot, at least one second architected register, of the plurality of architected registers, based on a selected request, the selected request being a restoration request to restore the at least one second architected register associated with the bulk save request, wherein the restoring for a given second architected register of the at least one second architected register, replaces a physical register identification currently mapped to the given second architected register with a physical register identification previously mapped to the given second architected register; and
based on receiving a second request to take another snapshot comprising a mapping of architected register identifications to physical register identifications at another point in time, and based on determining, via the bitmap, that the one or more first architected registers and the one or more second architected registers have not been modified since the chosen snapshot was taken, reusing the chosen snapshot in place of taking the another snapshot to satisfy the second request to take the another snapshot, the reusing including setting a snapshot identifier (this_snapshot_ID) for identifying the another snapshot to an existing snapshot identifier (prev_snapshot_ID) identifying the chosen snapshot, wherein the reusing the chosen snapshot comprises maintaining a reference to the chosen snapshot as a last restoration snapshot taken that is shared between the recovery and the restoration.
17 . The computer program product of claim 16 , wherein the method further comprises creating the another snapshot based on determining that at least one selected architected register has been modified.
18 . The computer program product of claim 17 , wherein the another snapshot includes the at least one second architected register that has been modified and fails to include other architected registers of the plurality of architected registers that have not been modified.