United States Patent (19) 11 Patent Number: 4,912,628 Briggs (45) Date of Patent: Mar
Total Page:16
File Type:pdf, Size:1020Kb
United States Patent (19) 11 Patent Number: 4,912,628 Briggs (45) Date of Patent: Mar. 27, 1990 54 SUSPENDING AND RESUMING or processing of a program running in a virtual machine PROCESSING OF TASKS RUNNING INA is described. The method involves creating and running WRTUAL MACHINE DATA PROCESSENG a special program in the virtual machine which is to be SYSTEM accorded suspend and resume control functions. The (75) Inventor: Alton A. Briggs, Scottsdale, Ariz. suspend/resume control function program is run first before a user's task is run. The special suspend/resume 73 Assignee: International Business Machines program seizes control over the virtual machine's exter Corp., Armonk, N.Y. mal interrupt controls and modifies them to direct all 21 Appl. No.: 168,300 incoming interrupts to the program itself rather than allowing CMS of the virtual machine to handle inter (22 Filed: Mar. 15, 1988 rupts as is normally done. With incoming interrupts 51 Int. Cl." ................................................ G06F 9/44 being sent to the suspend/resume program for analysis 52 U.S. C. ................................. 364/200; 364/228.2; and response, incoming commands that generate such 364/230.2; 364/261.2; 364/264.2; 364/300 interrupts may be responded to and sub-routines con (58) Field of Search ........................ 364/200, 900, 300 tained within the suspend/resume task program may be 56 References Cited employed to save all of these addressing registers and general register contents. The suspend/resume task U.S. PATENT DOCUMENTS program operates to modify the interrupt controls of 4,400,769 8/1983 Kaneda et al. ...................... 364/200 the virtual machine to create a suspension of operation 4,631,674 12/1986 Blandy .............. ... 364/300 4,642,756 2/1987. Sherrod ............. ... 364/200 of the user's task program by enabling the virtual ma 4,674,038 6/1987 Brelsford et al. ... 364/200 chine only for external interrupts. The machine is later 4,695,945 9/1987 Irwin ..................... ... 364/200 restored to operation and the user's task is resumed 4,860,190 8/1989 Kaneda et al. ...................... 364/200 from its interrupted point by restoring all register con tents, resetting the program status words and resetting Primary Examiner-Thomas C. Lee the interrupt controls to enable full restoration of all Attorney, Agent, or Firm-Edward H. Duffield operations. (57 - ABSTRACT A method for suspending and later resuming operation 7 Claims, 4 Drawing Sheets U.S. Patent Mar. 27, 1990 Sheet 1 of 4 4,912,628 (TYPICAL VM COMPUTER SYSTEM) (SYSTEM 37O) SYSTEM CONTROL PROGRAM (CP) F.G. 1 - CONTROLS ALL PHYSICAL/LOGICAL RESOURCES OF SYSTEM - PROVIDES COMMUNICATIONS AMONG PROGRAMS AND WIRTUAL MACHINES 2-1 - MANAGES SYSTEM-WIDE SERVICES - ALLOCATES SHARED RESOURCES AMONG WMS - RECEIVES EXTERNAL INTERRUPTS SGNALS CMS EXTERNA AUTHORIZED VM OR USER INTERRUPTS/ INTER-PROGRAM COMMANDS COMMUNICATIONS ONE TYPCAL VM) Psws VMCF-SMSG CONVERSATIONAL MONTOR SYSTEM CMS 5 - PROVIDES SERVICE TO THS VM-B ONY - NORMALLY SERVICES INTERRUPTS - SUPPORTS EXECUTION OF USERS APPLICATION PROGRAM, INTERACTIVE OR BATCH - U.S. Patent Mar. 27, 1990 Sheet 2 of 4 4,912,628 FG. 2A FLOW DAGRAM OF SUSPEND/RESUME PROCESS ON VM SYSTEM (ALL STATEMENTS ON () ARE TO BE OMITTED FROM ACTUAL FIND CHART THEY ARE JUST FOR EXPLANATION NOW) (BEGIN) 1OO 105 (SPECIAL TASK PROG...) TASK VM'S CMS NVOKES MODFES VM CONTROL SPECIAL ASK PROG. REGS TO ACCEPT ONLY N. S. VM EXT. INTERRUPTS FOR WMCF-SMSG COMMUNICATIONS SPECIAL TASK PROG, BEGINS TO EXECUTE 106 (SPECIAL TASK PROG...) SAVES ORIGINAL CMS (SPECIAL TASK PROG) EXTERNAL INTERRUPT RELOCATES ITSELF TO PSW SETINGS RESERVED STROAGE AREA TO AVOD POTENTIAL CONFLCTS WITH USER'S O7 TASK PROG TO BE RUN IN SAME VM) (SPECIAL TASK PROG...) WRITES A NEW CMS EXT. INTERRUPT NEW PSW TO ROUTE EXT. INTERRUPTS TO SPECIAL (SPECIAL ASK PROG) TASK PROG, FOR NITALIZES VM TO RESPONSE AND RE SUPPORT WMCF-SMSG ENABLES INTERRUPTS COMMUNICATIONS WH TO TASK WM THAT AUTHORIZED CONTROL WERE EARLIER DISABLED VM OR USER WHICH ISSUES SUSPEND/ OE RESUME COMMANDS (SPECIAL TASK PROG...) SIGNALS CMS OF TS (SPECIAL TASK PROG...) TASK WM TO INITIATE TEMPORARY DISABLES USER'S TASK PROCESSING ALL INTERRUPTS TO WM (BY PASSING STARTUP (BY SETTING MACHINE PARAMETERS FOR USER'S CONTROL MASK BITS EN TASK TO TASK VM'S CMS) MACHINES PSW TO DISALLOW INTERRUPTS) U.S. Patent Mar. 27, 1990 Sheet 3 of 4 4.912,628 (FROM 126) O9 s USERS ASK EXECUTES N TASK WM UNTIL (SPECIAL TASK PROG) SAVES D INTERRUPTED OR FINISHED CONTENTS OF TASK WMS GEN, REG, RX USED AS BASE FENSH ADDRESS REGAT TIME OF NTERRUPT AND SETS NEW INTERRUPT O RX CONTENTS TO A PRE ARRANGED CONTEN AS USERS TASK FINISHED; NEW BASE ADDRESS FOR SPECIAL TASK PROG. SUBSEOUENT MEMORY RETURNS CONTROL BY ACCESSES TO HANDLE SIGNALNG CMS O LOGOFF INTERRUPT, AND SAVES FROM VM CONTROL PROG, ALL REMAINING GEN. REG CONTENS AT TIME OF INTERRUPT. 14 is EXT. INTERRUPT YES (NTERRUPT PROCESSING) PATH AN ENCOMING SMSG 15 NO e f MOME ORIGINAL CMS CONTROL PROG FOR WM EXTERNAL INTERRUPT NEW RECOGNIZES ARECUEST PSW THAT WAS SAVED FROM AUTHORIZED CONTROL IN 108 TO SCRATCH VM OR USER TO SEND AREA OF MEMORY FOR VMCFSMSG TO USERS ASK. CONTROL PROG GENERATES EX, INTERRUPT TO ASK 18 VMAND PASSESSMSG TO RESTORE CONTENTS OF RX TASK VMWHICH ROUTES AND ALL OTHER GEN, REGS, SMSG AND INTERRUPT SAVED IN 13) TO CON DIRECY TO SPECIAL TEN AT TIME OF EXT. TASK PROG FOR HANDLING NTERRUPT SPECIAL ASK PROG RECEIVES RELOAD CMSS EXT INTER EX, INTERRUPT FROMAND RUPT NEW PSW FROM SMSG PASSED ON EY SCRATCH AREA FOR CMS CONTROL PROG TO PROCESS INTERRUPT 118 USERS TASK EXECUTION FG. 2B CONTINUES IN 109 U.S. Patent Mar. 27, 1990 Sheet 4 of 4 4.912,628 19 120 ATESIS SMSG FROMNos YES is SMSG SUSPEND"? YES NO 122 t21 AREADY IN S SMSG "RESUME" SUSPENDED STATE YES 12 5 YES NO ALREADY IN (TO 130 123 NO C. SUSPENDED STATE SAVE EXISTING EXTERNA INTERRUPT OLD PSW OF YES ASK VMAND COPY SAVED 28 REGS CONTENTS (FORM STEP 113) TO RESERVED COPY EXT, NTERRUPT OLD SPACE FOR LATER PSW OF TASK WM SAVED RELOADING N STEP 123) TO SCRATCH AREA OF MEMORY RESTORE REG8 TO CONTENTS 124 8AVED (IN 123) MODIFY SETING FOR OLD RELOAD OLD PSW OF TASK PSW OF TASK WM TO ENABLE VM, THUS CAUSING ONLY FOR EXT. INTERRUPTS. RESUMPTION OF OPERATION LOAD MODIFIED PSW, FROM PONT WHERE US SUSPENDING OFPERATIO OF PROCESSING IN TASK SUSPEND OCCURRED, VM FOR ALL EXCEPT EX, INTERRUPTS. (RETURN TO Og 27 S SMSG LOGOFF (SUSPENDED STATE) YES 28 t22) CLOSE ANY OPEN FILES RESTORE ALL GEN, REG8. TO CONTENT SAVEDAT 29 NTERRUPT ON STEP 113 ERMINATE VM EXECUTION VIA LOGOFF RECUEST 13 TO CONTROL PROG LOAD OLD PSW FOR TASK VM (As SAMED INSTEP 123) TASK PROG, CONTINUES FG, OR REMAINS SUSPENDED 2A F.G. 2 A8 APPROPRIATE 4,912,628 1. 2 suitable for usage by the characteristic users of such a SUSPENDING AND RESUMNG PROCESSING OF system or of the system operators themselves. TASKS RUNNING IN A WRTUAL MACHINE In light of these difficulties with the known prior DATA PROCESSING SYSTEM systems, it is an object of this invention to provide a means of suspending and resuming operation of process BACKGROUND OF THE INVENTION ing a task in a virtual machine data processing system 1. Field of the Invention utilizing only standard available programming and con This invention relates to data processing computer trol techniques and without jeopardizing any other system controls and architecture generally and specifi programs or processes operating in the data processing cally to the so-called "virtual machine' operational O system at that time. systems known as the IBM System 370 and 370/XA and other similar systems. BRIEF SUMMARY 2. Prior Art The foregoing and still other objects of the invention In virtual machine operating systems such as the IBM not specifically enumerated are accomplished in a pre System 370 or the like, it has long been desirable but not 15 ferred embodiment of the invention that will be de practically feasible to perform temporary suspension of scribed further herein. Briefly, the process of safely a job running in a particular virtual machine without risking interference with other programs running in facilitating suspension and later resumption of a task other virtual machines in the same system. There are being processed in a virtual machine involves execution numerous reasons why users of such systems may wish 20 of a small special task program in the virtual machine in to suspend and ordinarily resume at some later point the which a given task or job is to be run just prior to run work being done as a task in one or more portions of the ning the job itself. computer system's workload. A common reason that The special small program implements the techniques suspension of a given task or tasks may be requested is for facilitating suspension and resumption of the actual to reduce contention for the computer system's re 25 task that will be run in that virtual machine. When the sources and to allow temporary allocation of the re special program for suspend and resume operation is sources for other work. For example, interactive system loaded, it first noves itself to an area of otherwise free users often experience a slower response time when the or reserved storage so that its operation will not be computer system is occupied with long-term tasks such overwritten or interfered with when the task program as batch tasks for which the actual completion time of 30 runs.