WO2010116405A1 - Calculation system provided with nonvolatile main memory - Google Patents

Calculation system provided with nonvolatile main memory Download PDF

Info

Publication number
WO2010116405A1
WO2010116405A1 PCT/JP2009/001589 JP2009001589W WO2010116405A1 WO 2010116405 A1 WO2010116405 A1 WO 2010116405A1 JP 2009001589 W JP2009001589 W JP 2009001589W WO 2010116405 A1 WO2010116405 A1 WO 2010116405A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
stable state
main memory
computer system
information
Prior art date
Application number
PCT/JP2009/001589
Other languages
French (fr)
Japanese (ja)
Inventor
顕義 橋本
崇仁 中村
正法 高田
政弘 新井
健太郎 島田
淳 江端
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2009/001589 priority Critical patent/WO2010116405A1/en
Publication of WO2010116405A1 publication Critical patent/WO2010116405A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering

Definitions

  • the present invention relates to a computer system having a processor and a main memory.
  • Journaling is a history of data updates. For example, when updating data stored in the secondary storage in multiple steps, the update history (journal) is written to the secondary storage, and then the data is updated and written to the secondary storage. The success of updating the data is recorded (this record is called “checkpoint”). With this method, even if the data update is interrupted due to a power failure during the data update, the journal remains, so that the state before the start of the data update process can be restored. And the same process should just be performed anew. In this way, consistency is guaranteed at the level of the file stored in secondary storage.
  • Non-Patent Document 1 defines a power state of a computer system. Among them is the “S4 state”.
  • the “S4 state” is a state in which the CPU context, the contents of the main memory (data stored in the main memory), etc. are all stored in the secondary memory and the power of most components is turned off.
  • hibernation This technique is called “hibernation”.
  • this technique stores all the contents of the main memory in the secondary memory, the execution time has become longer due to the increase in the capacity of the main memory. As a result, it cannot be executed frequently and it takes a long time to recover from a power failure. This effectively made it impossible to use hibernation technology as a technology to maintain system state consistency.
  • the hibernation technique is originally intended to save power, the stored system state is erased when the operation state is restored. For this reason, even if recovery is possible after a power failure, when the next power failure occurs, the system state that should be restored is erased, so it cannot be restored to the state before the power failure occurred. Therefore, hibernation technology cannot prepare for power outages.
  • Logical partitioning is a technology that makes a single computer system appear to be virtually operated by multiple software systems called “VMM (Virtual Machine Monitor)” that operates on the computer system.
  • VMM Virtual Machine Monitor
  • a virtual computer generated by VMM is called “VM (Virtual Machine)”.
  • An OS (Operating System) running on a VM cannot distinguish between a VM and a physical computer. This is because VMM generates virtual hardware on the main memory. Therefore, the VMM can save the state of the VM stored in the main memory in the secondary storage regardless of the state of the VM.
  • VMM can store any number of VM state files at any time. Therefore, it is possible to return to the VM state at any time in the past.
  • Patent Document 2 can be said to be a technique for applying a logical partitioning technique to prepare for a power failure.
  • the logical partitioning technology has a problem of performance degradation.
  • the following examples exist.
  • VMM emulates hardware behavior and returns processing to the OS and applications.
  • the software called VMM runs for such an emulation operation, so performance degradation is significant.
  • VM hardware access by the OS and applications as described above frequently occurs, which greatly increases performance degradation.
  • the VMM saves the VM state on the main memory in the secondary memory. The overhead for that is also large.
  • Patent Document 2 As described above, the problem of Patent Document 2 is performance deterioration during normal operation and system state storage.
  • MRAM Magnetic Random Access Memory
  • DRAM Dynamic RAM
  • the OS sends a command (denoted as “cmd” in the figure) to the secondary storage (4516).
  • the secondary storage (4516) executes the command and reports the command execution completion to the OS.
  • the response time of the secondary memory (4516) is very long compared with the processing time of the CPU (4501). For this reason, normally, the OS executes another process while the secondary storage (4516) executes the command.
  • the OS registers a command for which a command execution completion report has not been transmitted from the secondary memory (4516) in the command completion queue (805) in the nonvolatile main memory (4502).
  • the OS registers cmd0 (806) and cmd1 (807) in the command completion waiting queue (805).
  • the state of the computer system is as shown in FIG. That is, since the main memory (4502) is non-volatile, cmd0 (806) and cmd1 (807) remain registered in the command completion waiting queue (805) by the OS.
  • cmd0 (806) and cmd1 (807) received from the OS have disappeared due to a power failure. Therefore, the secondary storage (4516) does not transmit a command execution completion report.
  • the OS waits for completion reports of cmd0 (806) and cmd1 (807). Since the command execution completion report does not come indefinitely, the OS determines that a failure has occurred in the secondary storage (4516).
  • the main memory is only nonvolatile, there is a possibility that a mismatch occurs between the state of the peripheral device (for example, the secondary memory) and the state of the main memory due to the occurrence of a power failure or the like. For this reason, the computer system cannot resume operation after a power failure.
  • the stable state information which is information including the instruction address, is stored in the nonvolatile main memory.
  • the non-volatile medium used as the main memory may be any medium.
  • Stored steady state information can be used for several things. For example, after a failure such as a power failure, it can be recovered using stable state information. Alternatively, for example, debugging can be performed with reference to stable state information.
  • FIG. 1 is a block diagram of a computer system according to Embodiment 1 of the present invention.
  • FIG. 2 is a functional block diagram of the OS (117).
  • FIG. 3 is a functional block diagram of the I / O controller (103).
  • FIG. 4 is an explanatory diagram of the main memory setting register group (306).
  • FIG. 5 is an explanatory diagram of the flag area (114) in the firmware storage memory (104).
  • FIG. 6 is a flowchart of the address translation mechanism of the I / O controller (103).
  • FIG. 7 is a flowchart showing the operation of the firmware.
  • FIG. 8 is a diagram for explaining the operation between the OS (117) and the secondary storage (106).
  • FIG. 9 is a diagram illustrating an example of processing between the OS and the secondary storage.
  • FIG. 1 is a block diagram of a computer system according to Embodiment 1 of the present invention.
  • FIG. 2 is a functional block diagram of the OS (117).
  • FIG. 3 is
  • FIG. 10 shows an example of the nonvolatile main memory and the secondary memory when the power failure occurs in FIG.
  • FIG. 11 is a diagram illustrating the “stable state”.
  • FIG. 12 is a diagram illustrating an example of a method for storing the “stable state”.
  • FIG. 13 is a diagram illustrating an example of a method for storing the “stable state”.
  • FIG. 14 is a diagram illustrating an example of a method for storing the “stable state”.
  • FIG. 15 is a diagram illustrating an example of a method for storing the “stable state”.
  • FIG. 16 is a diagram illustrating an example of a trigger for starting the “stable state” saving process.
  • FIG. 17 is a diagram illustrating an example of a trigger for starting the “stable state” saving process.
  • FIG. 11 is a diagram illustrating the “stable state”.
  • FIG. 12 is a diagram illustrating an example of a method for storing the “stable state”.
  • FIG. 13 is a
  • FIG. 18 is a flowchart for explaining processing in which the OS (117) stores the “stable state”.
  • FIG. 19 is a flowchart for explaining processing in which the OS (117) stores the “stable state”.
  • FIG. 20 is a flowchart for explaining processing in which the OS (117) stores the “stable state”.
  • FIG. 21 is a flowchart for explaining processing in which the OS (117) stores the “stable state”.
  • FIG. 22 is a schematic diagram for explaining the resumption of operation after storing the “stable state”.
  • FIG. 23 is a schematic diagram for explaining the resumption of operation after storing the “stable state”.
  • FIG. 24 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”.
  • FIG. 25 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”.
  • FIG. 26 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”.
  • FIG. 27 is a schematic diagram for explaining network communication processing of the computer system (100).
  • FIG. 28 is a flowchart of network communication resumption processing of the failure recovery program (203).
  • FIG. 29 is a block diagram of a computer system (2900) according to the second embodiment of the present invention.
  • FIG. 30 is a diagram of the flag area (2902) of the firmware storage memory (104).
  • FIG. 31 is a functional block diagram of the OS (2903).
  • FIG. 32 is an explanatory diagram of the page management information (3103) and the page table (3104).
  • FIG. 33 is an explanatory diagram of the page table pointer (3001) and the check code (3105).
  • FIG. 34 is a schematic diagram illustrating the process of copying the page table (3104).
  • FIG. 35 is a flowchart for explaining processing in which the OS (2903) stores the “stable state”.
  • FIG. 36 is a flowchart showing firmware processing.
  • FIG. 37 is a flowchart showing processing when the computer system (2900) is restarted.
  • FIG. 38 is a schematic diagram illustrating the process of updating the page (3102).
  • FIG. 39 is a ladder chart explaining the process of updating the page (3102).
  • FIG. 40 is a flowchart for explaining the processing of the OS (2903) that makes an old generation page unused.
  • FIG. 41 is a flowchart for explaining the process of writing an old generation page to the secondary storage (106).
  • FIG. 42 is a diagram showing an example of the data structure of the write-once file system.
  • FIG. 43 shows the data structure of sub-inode (4206).
  • FIG. 44 is a flowchart showing the operation of the OS when the user requests the OS (2903) to open the file.
  • FIG. 45A is a diagram illustrating a state before the “stable state” is stored for the first time.
  • FIG. 45B is an explanatory diagram of processing when the “stable state” is stored for the first time.
  • FIG. 45C is an explanatory diagram of processing when the “stable state” is stored for the second time.
  • FIG. 45D is an explanatory diagram of processing when the “stable state” is stored after the third time.
  • saving (storing) stable state information may be referred to as “saving (storing)“ stable state ”.
  • the secondary storage may be built in the computer system or may exist outside.
  • the secondary storage may be a drive such as a hard disk drive or a storage system (for example, a disk array device) provided with a plurality of storage media.
  • FIG. 1 shows a computer system (100) according to the first embodiment of the present invention.
  • the computer system (100) consists of a CPU (Central Processing Unit) (101), nonvolatile main memory (102), I / O controller (103), firmware storage memory (104), I / O bus (105), HBA (Host Bus (Adapter) (107) and NIC (Network Interface Card) (109).
  • CPU Central Processing Unit
  • nonvolatile main memory 102
  • I / O controller 103
  • firmware storage memory 104
  • I / O bus 105
  • HBA Hypervisor
  • NIC Network Interface Card
  • CPU (101) is in charge of calculation.
  • the non-volatile main memory (102) stores an OS (117) and an application (not shown).
  • the nonvolatile main memory (102) is divided into two areas. These are referred to as region 1 (110) and region 2 (111).
  • the “stable state” is stored in one of the two areas, and the OS (117) in the area in which the “stable state” is saved is activated at the time of restart after a power failure occurs.
  • the I / O controller (103) is connected to the CPU (101) and the nonvolatile main memory (102), and controls the nonvolatile main memory (102) and the data transfer between the above elements.
  • Firmware storage memory (104) is a non-volatile storage medium that stores firmware executed by CPU (101) when computer system (100) is started.
  • the firmware storage memory (104) stores a firmware storage area (112) and a flag area (113) unique to the present embodiment.
  • the I / O bus (105) is a data transfer medium between the HBA (107) and NIC (109) and the I / O controller (103).
  • the HBA (107) controls the secondary storage (106) according to the instruction of the OS (117).
  • NIC communicates with other computer systems via LAN (Local Area Network) (108) in accordance with instructions of OS (117). Communication between computer systems may be performed via another type of network instead of the LAN (108).
  • LAN Local Area Network
  • FIG. 2 shows the configuration of OS (117).
  • the OS (117) is a kernel (201), a device driver (202), an OS failure recovery program (203) specific to this embodiment that is executed at the time of restart after power-off, and a device incorporated in the OS (117)
  • a device driver list (204), which is a list of drivers (202), and a device recovery program (205) for performing failure recovery processing specific to the device driver are included.
  • a recovery stack pointer (206) indicating the instruction address immediately before the stored "stable state"
  • a system state variable (207) indicating whether the computer system (100) is in the "stable state” or in an unstable state There is.
  • Figure 3 shows the configuration of the I / O controller (103).
  • the I / O controller (103) includes a CPU interface controller (301) that controls communication with the CPU (101), a main memory interface controller (302) that controls the main memory (102), and a firmware storage memory (104). Connected to the firmware interface controller (303) that controls communication with the I / O bus (105), the I / O bus interface controller (304) that controls communication with the I / O bus (105), and the I / O controller (103) A routing control unit (305) for arbitrating data transfer between the interfaces.
  • the I / O controller (103) further includes a main memory setting register group (306) for storing state variables for storing a “stable state” in the nonvolatile main memory (102), and a nonvolatile main memory (102). And a data transfer engine unit (307) that executes data transfer between the nonvolatile main memory (102) and the I / O bus.
  • Figure 4 shows the main memory setting register group (306).
  • the operation mode register (401) is a register indicating a mode of writing to the area 1 (110) and the area 2 (111). At the first startup after the computer system (100) is normally shut down, it is necessary to write data to both the area 1 (110) and the area 2 (111). If the “stable state” is stored in the area 1 (110), the OS (117) proceeds with the calculation using the area 2 (111). Accordingly, the main memory interface control unit (302) has a mode for writing data in both the area 1 (110) and the area 2 (111) and a mode for writing data in one of the areas. Therefore, an area that is not in a “stable state” and is currently in use is referred to as an “active area”. For this reason, the operation mode register (401) has two modes of “0: write only to active area” and “1: write to all areas”.
  • the active area register (402) indicates a currently active area.
  • the area size register (403) indicates the size of the divided area.
  • the stable area register (404) indicates an area where “stable state” is stored.
  • Area number register (405) indicates the total number of areas.
  • the area of the nonvolatile main memory (102) is divided into two.
  • Figure 5 shows the flag area (114).
  • the shutdown completion flag (501) is a flag that indicates whether a normal shutdown or a power failure occurred at the previous startup.
  • 0xFF indicates an initial value.
  • 0x00 indicates that the computer system (100) is normally shut down.
  • 0xEE indicates that the computer system is stopped due to a power failure, and the “stable state” is stored in the nonvolatile main memory (102). Otherwise, it indicates that a failure has occurred. It goes without saying that the meaning of the present invention does not change even if the meaning of the numerical value of the flag is changed.
  • the stable area number flag (502) stores a numerical value indicating the latest stable area.
  • the OS failure recovery program vector (503) stores the instruction address of the OS failure recovery program (203).
  • the area size (504) stores the size of the area obtained by dividing the nonvolatile main memory (102).
  • the number of areas (505) indicates the number of areas in the nonvolatile main memory (102).
  • Fig. 6 shows the address transmission procedure for the nonvolatile main memory (102) of the I / O controller (103).
  • Step (601) The I / O controller (103) receives the physical address a (p) transmitted by the CPU (101) and others.
  • Step (602) The I / O controller (103) refers to the active area register (402). Let that value be n.
  • Step (603) The I / O controller (103) determines whether or not the value of the active area register (402) is zero. If the value of the active area register (402) is 0, the I / O controller (103) transmits an address to both of the divided areas (step (604) is performed). On the other hand, if the value of the active area register (402) is not 0, the I / O controller (103) transmits an address only to the active area (step (610) is performed).
  • Step (604) The I / O controller (103) refers to the area size register (403). Let this value be s.
  • Step (605) The I / O controller (103) calculates the address ns + a (p).
  • Step (606) The I / O controller (103) transmits the above address to the nonvolatile main memory (102).
  • Step (607) The I / O controller (103) increments n.
  • Step (608) The I / O controller (103) determines whether n is greater than 2. If n is greater than 2, step (609) is performed, and if n is 2 or less, step (605) is performed. In this embodiment, since the nonvolatile main memory (102) is divided into two, the I / O controller (103) compares n with the magnitude of 2. When the nonvolatile main memory (102) is divided into m (m is an integer of 2 or more), the I / O controller (103) compares n and m.
  • Step (609) This is the end of the process.
  • Step (610) The I / O controller (103) refers to the area size register (403). Let this value be s.
  • Step (611) The I / O controller (103) calculates the address (n-1) s + a (p).
  • Step (612) The I / O controller (103) transmits the address to the nonvolatile main memory (102).
  • the I / O controller (103) transmits the address to the nonvolatile main memory (102).
  • the operation of the I / O controller (103) is expressed as a software flowchart, but it goes without saying that the operation is actually a hardware operation equivalent to FIG.
  • Step 701 The user turns on the power.
  • Step 702 The firmware initializes the CPU (101).
  • Step 703 The firmware refers to the shutdown completion flag (501).
  • Step 704 The firmware operates in three ways depending on the value of the shutdown completion flag (501).
  • Step 705 If the shutdown completion flag (705) is 0xFF or 0x00, it was shut down normally last time, so the firmware initializes the hardware of the computer system (100) and the OS from the secondary storage (106) Read (117).
  • Step 705 The firmware initializes the I / O controller (103).
  • Step 706 The firmware initializes the interface between the I / O controller (103) and the nonvolatile main memory (102).
  • Step 707 The firmware clears the nonvolatile main memory (102) to zero.
  • Step 708 The firmware sets half the capacity of the nonvolatile main memory (102) in the area size register (403).
  • the firmware sets 0 in the stable area register (404).
  • the firmware sets 2 in the area number register (if the division number is m, the register is set to m). Further, the firmware sets the main memory setting register group (306).
  • the firmware sets 0 in the operation mode register (401).
  • the firmware sets 0 in the active area register (402).
  • Step 709 The firmware initializes the I / O bus (105).
  • Step 710 The firmware initializes the HBA (107) and NIC (109).
  • Step 711 The firmware loads the OS boot program from the secondary storage (106) to the nonvolatile main storage (102).
  • Step 712 The firmware jumps to the OS startup program.
  • Step 713 The OS startup program starts running.
  • Step 714 When the shutdown completion flag is 0xEE, the flag means that a power failure has occurred while the “stable state” is stored.
  • the firmware calls the OS failure recovery program 203 after initializing the hardware.
  • the firmware initializes the I / O controller.
  • Step 715 The firmware initializes an interface between the I / O controller (103) and the nonvolatile main memory (102).
  • Step 716 The firmware reads the stable area number flag (502) and writes the value in the stable area register (404).
  • Step 717 The firmware calculates the size of the area from the value of the number of areas (505).
  • Step 718 The firmware sets the area size in the area size register (403).
  • Step 719 The firmware initializes the I / O bus (105).
  • Step 720 The firmware initializes the HBA (107) and NIC (109).
  • Step 721 The firmware reads the OS failure recovery program vector (503) and jumps to the vector.
  • Step 722 The OS failure recovery program (203) takes over the processing. The operation of the OS failure recovery program (203) will be described after the “stable state” saving process is described.
  • Step 723 The value of the shutdown completion flag (501) is invalid except for 0x00, 0xEE, and 0xFF. For this reason, the fault processing is started.
  • the firmware initializes the I / O bus.
  • Step 724 The firmware initializes a VGA (Video Graphics Array) device (not shown).
  • VGA Video Graphics Array
  • Step 725 The firmware displays an error on the console.
  • FIGS. 10 and 11 represent divided areas n (110) (111) of the nonvolatile main memory (102).
  • the nonvolatile main memory (102) includes a file system layer (801) and a device driver layer (802) of the OS (117).
  • the file system layer (801) has a device driver transmission queue (803).
  • the file system layer (801) writes the contents of the nonvolatile main memory (102) to the secondary storage (106) in response to any one of swap-out, an explicit instruction from the application, and an instruction from the user.
  • the device driver (202) takes charge of the actual writing operation.
  • the device driver transmission queue (803) is a queue for the file system layer (801) to request the device driver (202) to write data. 10 and 11, cmd4 (810) and cmd5 (811) are registered in the device driver transmission waiting queue (803).
  • the device driver layer (802) has a command transmission waiting queue (804) and a command completion waiting queue (805). Cmd2 (808) and cmd3 (809) are registered in the command transmission queue (804). In FIG. 11, since the command completion waiting queue (805) is empty, it can be said to be in a “stable state”.
  • the secondary storage (106) reports the completion of execution of cmd0 (806) and cmd1 (807).
  • cmd0 806
  • cmd1 807
  • the command completion queue (805) is empty.
  • the command execution queue (queue storing the command being executed) (812) in the secondary storage (106) is also empty. Therefore, the state of the nonvolatile main memory (102) and the state of the secondary memory (106) are the same. Even if a power failure occurs in this state, the computer system (100) can resume operation. This is because the states of the OS (117) and the secondary storage (106) are the same even when restarting after a power failure. As a result, the OS (117) does not need to wait for a command execution completion report from the secondary storage (106).
  • the “stable state” means that any command transmitted to the peripheral device (secondary storage (106) in this embodiment) is not in progress, in other words, transmitted to the peripheral device. It can be defined as the state where all the completed commands are completed.
  • FIG. 11 represents the “stable state”. There are multiple ways to store the “stable state”. Each method will be described below.
  • the OS (117) retrieves the cmd2 (808) and cmd3 (809) from the command transmission queue (804) and saves the cmd2 (808) and cmd3 ( 809) is registered in the device driver transmission waiting queue (803). Then, the state of the computer system (100) transitions to the state shown in FIG. Since the state shown in FIG. 13 is synonymous with the initialization of the device driver layer (802), there is an aspect that the design of the OS failure recovery program (203) is easy.
  • FIG. 11 does not represent the “stable state” depending on the specifications of the HBA (107).
  • the explanation is based on the assumption that the OS (117) actively retrieves the command from the command transmission queue (804) (via the HBA (107)) and sends the command to the secondary storage (106). I have done it.
  • the method described in FIG. 12 that is, the method in which the OS (117) extracts a command from the command transmission queue (804) and registers the command in the device driver transmission queue (803) is “stable state”.
  • the method of FIG. 12 can be said to be a method capable of storing the “stable state” without depending on the type of HBA.
  • the command save queue (1401) exists in the device driver layer (802).
  • the OS (117) saves the command registered in the command transmission queue (804) to the command save queue (1401).
  • the HBA (107) since no command is registered in the command transmission queue (804), the HBA (107) does not transmit the command to the secondary storage (106), and the computer system (100 ) Is the “stable state”.
  • the save destination is different from the method of FIG.
  • the design change part is closed in the device driver (202), so that it can be said that it is easy to realize.
  • triggers for starting the “stable state” saving process there are multiple types of triggers for starting the “stable state” saving process. For example, there is an opportunity either periodically when receiving an instruction from the user, or when the state of the command completion waiting queue (805) becomes a predetermined state. “When the state of the command completion waiting queue (805) becomes a predetermined state” is, for example, when “unstable state” is detected or when “stable state” is detected. An “unstable state” is a state that is not a “stable state”.
  • Fig. 16 shows that "stable state” is stored when “unstable state” is detected.
  • a thick line (1601) indicates that the computer system (100) is in an “unstable state”.
  • a thick line (1062) indicates that the computer system (100) is in a “stable state”.
  • commands cmd1 (1603), cmd2 (1604), and cmd3 (1605) are registered in the command completion waiting queue (805).
  • cmd1 (1603) is completed, and a transition is made to the state in which commands cmd2 (1604) and cmd3 (1605) are registered in the command completion queue (805).
  • the processing of cmd2 (1604) and cmd3 (1605) is completed, the command completion waiting queue (805) is emptied, and the computer system (100) transitions to the “stable state” (OS (117) is “ Detect stable state).
  • OS (117) does not save the “stable state” and continues operation.
  • the OS (117) saves the “stable state” triggered by the event that cmd4 (1605) is registered in the command completion waiting queue (1606). That is, the OS (117) stores the “stable state” when it detects the “unstable state”.
  • the “stable state” stored at this opportunity is a past state closer to the “stable state” stored at the opportunity shown in FIG. 17 (when the “stable state” is detected). Therefore, the failure recovery time is shorter than in the case of FIG.
  • the OS (117) in order to save the “stable state” when the “unstable state” is detected, the OS (117) must recognize its own state. Therefore, the OS (117) must identify whether it is “stable state” or “unstable state” using the system state variable (207).
  • a device driver (not shown) that is part of the OS (117) sends a command to the secondary storage (106). There is a method of checking whether the command completion waiting queue (1606) is empty before sending.
  • FIG. 17 shows that “stable state” is saved when the command completion waiting queue (805) becomes empty, that is, “stable state” is saved when “stable state” is detected. It shows that.
  • the “stable state” stored at this opportunity is a past state farther than the “stable state” stored at the opportunity shown in FIG. Therefore, the failure recovery time is longer than in the case of FIG.
  • the OS (117) does not need to recognize its own state, the system state variable (207) is unnecessary.
  • the device driver (802) that is a part of the OS (117) reports a command completion report from the secondary storage (106). There is also a method of checking whether or not the command completion waiting queue (1606) is empty when it is received.
  • FIG. 18 is a flowchart of processing for storing the “stable state” for the first time after the computer system (100) is started.
  • the OS (117) executes one program for several milliseconds, and when executing another program, information necessary to resume execution of the former program (how many lines the program has run to) , Data to be calculated) is stored in the nonvolatile main memory (102). This is called context.
  • the OS (117) interrupts execution of one program and starts to execute another program, it is called “context switch”.
  • the CPU (101) is volatile. Therefore, in order to save the state of the computer system (100), it is necessary to flush the cache of the CPU (101) and save it in the nonvolatile main memory (102).
  • Step (1810) The OS (117) sets the stable region number flag (502) to “1”.
  • FIG. 19 is a flowchart of processing for storing the “stable state” again when the “stable state” has already been stored.
  • step (x) step (y)
  • This copying may be performed by the CPU (101), but is preferably performed by the data transfer engine unit (307) built in the I / O controller (103).
  • the data transfer engine unit (307) is a so-called DMA (Direct Memory Access) engine.
  • the OS (117) instructs the data transfer engine unit (307) about the transfer source address, the transfer destination address, and the transfer size (not shown).
  • the data transfer engine unit (307) copies data for the designated transfer size from the designated transfer source address to the designated transfer destination address.
  • the data in the nonvolatile main memory (102) can be copied at a higher speed than when the software performs copying.
  • Step (1910) The OS (117) sets the active area number in the active area register (402). If the active area is unchanged, this process is not necessary.
  • FIG. 20 shows a flowchart of the “stable state” saving process corresponding to FIG. 12 and FIG. FIG. 20 shows a process of storing the “stable state” for the first time after the computer system (100) is activated.
  • Step (2001) Step (1801).
  • FIG. 21 is a flowchart of processing for storing the “stable state” again when the “stable state” has already been stored.
  • FIG. 22 shows an outline of the restart process after the “stable state” storage process of FIG. 12 is executed.
  • the OS (117) generates commands cmd2 (808) and cmd3 (809) registered in the command transmission waiting queue (804) of the device driver layer (802) in order to generate a ⁇ stable state ''. 801) is registered in the device driver transmission waiting queue (803). Therefore, since the device driver layer (802) is in the initial state, the restart process only needs to execute the initialization process again.
  • FIG. 23 shows an outline of the restart process after the “stable state” storage process of FIGS. 14 and 15 is executed.
  • the OS (117) returns the cmd2 (808) and cmd3 (809) saved in the command save queue (808) to the command transmission queue (804). If the HBA (107) is a specification for acquiring a command from the command transmission queue (804), further write the head pointer of the command transmission queue (804) to the register (not shown) of the HBA (107). is required. This is because the HBA (107) does not know which address of the command transmission queue (804) is the head address of the command group not yet transmitted.
  • the initialization of the device driver may be only the initial setting of the HBA (107). If the HBA (107) is a specification for acquiring a command from the command transmission queue (804), further write the head pointer of the command transmission queue (804) to the register (not shown) of the HBA (107). is required.
  • Fig. 24 shows the restart process from the "stable state”.
  • Step (2401) Processing starts.
  • Step (2402) The OS failure recovery program (203) refers to the device driver list (204).
  • Step (2403) The OS failure recovery program (203) can know the instruction address of the device recovery program (205) for each device from the device driver list (204). Therefore, the OS failure recovery program (203) executes the device recovery program (205) for each device including the HBA (107) and the NIC (109).
  • Step (2404) When the recovery process of each device is completed, the OS failure recovery program (203) jumps to the OS stack pointer (206) to return to the “stable state”.
  • Step (2405) The OS (117) restarts the operation from the “stable state”.
  • FIG. 25 shows a flowchart of the HBA (107) device recovery program when the “stable state” saving process of FIGS. 14 and 15 is executed.
  • Step (2501) The HBA device recovery program is called from the OS failure recovery program (203).
  • Step (2502) The HBA device recovery program restores the command transmission queue (804). That is, the commands (cmd2 (808) and cmd3 (809) shown in FIGS. 14 and 15) saved in the command save queue (1401) in FIG. 15 are moved to the command transmission queue (804).
  • Step (2503) The HBA failure recovery program sets an initial value in the register of HBA (107).
  • Step (2504) If the specification is that the HBA (107) retrieves the command from the command transmission queue (804) and sends it to the secondary storage (106), the HBA recovery program will not execute the command transmission queue (804). Set the start address of the command in the HBA register (not shown).
  • Step (2505) The failure recovery process of the HBA (107) is completed, and the control of the CPU (101) is transferred from the HBA failure recovery program to the OS failure recovery program (203).
  • FIG. 26 shows the operation of the HBA failure recovery program when the “stable state” described with reference to FIGS. 11 and 12 is stored.
  • Step (2601) The OS failure recovery program (203) calls the HBA failure recovery program.
  • Step (2602) The HBA failure recovery program executes the same HBA initialization process as during normal startup.
  • the OS (117) returns the command from the device driver layer (802) to the file system layer (801). Therefore, the nonvolatile main memory (102) used by the HBA device driver is returned to the initial state.
  • the command registered in the device driver transmission waiting queue (803) of the file system layer (801) is moved to the device driver layer (802). Therefore, the HBA failure recovery program only needs to initialize the HBA (107).
  • the OS (117) transmits a command in the command transmission queue (804) to the secondary storage (106) via the HBA (107).
  • the HBA (107) may be initialized. If the HBA (107) reads the command registered in the command transmission queue (804) and sends it to the secondary storage (106), the "stable state" saving process described with reference to FIG. 11 is applied. I can't. Therefore, it should be noted that there is no HBA failure recovery program in this case.
  • Step (2603) The failure recovery process of the HBA (107) is finished, and the control of the CPU (101) is transferred from the HBA failure recovery program to the OS failure recovery program (203).
  • one of the features of this embodiment is that no extra resources are required.
  • the OS (117) stores a journal file, which is a history of command transmission to the secondary storage (106), in the secondary storage (106).
  • the OS (117) stores the corresponding journal file in the nonvolatile main memory (102). Therefore, a small overhead due to journaling is also a feature of this embodiment.
  • the “stable state” storage processing and recovery processing of the computer system (100) has been described from the viewpoint of the relationship between the secondary memory (106) and the nonvolatile main memory (102). Further, it is necessary to explain from the viewpoint of NIC (109) or LAN (108).
  • the computer system (100) that is, the OS (117)
  • the OS (117) can continue operation even when the communication of the LAN (108) is interrupted. This is because the communication of the LAN (108) has no state (it has a state in the TCP protocol layer but does not seem to have a state from the upper layer). Therefore, it is not necessary to save the “stable state”.
  • the NIC (109) recovery process only needs to initialize the NIC (109) or the TCP / IP stack of the OS (117).
  • FIG. 27 shows a schematic diagram of LAN (109) communication when the computer system (100) is a file server.
  • Nonvolatile main memory (102) includes an NFS (Network File System) layer (2701) and a TCP / IP layer (2702). Outside the computer system is a client (2703) connected via a LAN (108).
  • the TCP / IP layer (2702) has a TCP / IP layer reception queue (2704).
  • the command cmd4 (2705) and data “dat4” (2706) transmitted by the client (2703) are registered in the TCP / IP layer transmission / reception queue (2704).
  • the TCP / IP layer (2702) has a TCP / IP transmission queue (2711).
  • a command completion report message cmp2 (2712) is registered.
  • the NFS layer (2701) which is an upper layer of the TCP / IP layer (2702), has an NFS layer reception queue (2707).
  • the command cmd3 (2708) is registered.
  • the NFS layer (2701) has an NFS reception completion queue (2709). This is a queue for registering a command that has been processed in the NFS layer (2701). For example, when the client (2703) sends a write command to the computer system (100), the computer system (100) has a nonvolatile main memory (102), so when the reception of the NFS layer (2701) is completed.
  • a write completion report can be sent to the client (2703).
  • the command for which the reception process of the NFS layer (2701) is completed is registered in the NFS layer reception completion queue (2709) by the OS (117).
  • command cmd1 (2714) and data (2715) are registered.
  • the computer system (100) has an NFS layer transmission queue (2710) for transmitting a completion message and the like to the client (2703).
  • FIG. 27 shows a state in which the completion message cmp1 (2713) indicating that the OS (117) has completed processing of the command cmd1 (2714) has reached the client (2703).
  • the OS failure recovery program (203) initializes all the queues of FIG.
  • the OS (117) must always write the received data dat1 (2715) to the secondary storage (106). This is because the computer system (100) has already reported the normal end of the command cmd1 (2714) to the client (2703).
  • Step (2801) Processing starts.
  • Step (2802) The OS failure recovery program (203) checks whether there is a command or data in the NFS layer reception completion queue (2709).
  • Step (2803) If a command or data exists in the NFS layer reception completion queue (2709), the OS failure recovery program (203) writes the data in the secondary storage (106).
  • the OS failure recovery program (203) does not need to write directly to the secondary storage (106), but only instructs the file system layer (801) to write the data to the secondary storage (106).
  • the processing of the OS failure recovery processing program (203) is finished, and the OS (117) executes normal NFS processing from the next time.
  • Step (2804) Check whether the OS (117) has received the NFS command. If no NFS command is received, monitoring continues.
  • Step (2805) When the OS (117) receives the NFS command, it executes the command and returns to step (2804).
  • storing the ⁇ stable state '' of the computer system (100) in the nonvolatile main memory (102) enables the computer system (100) to be restarted consistently during a power failure.
  • the state storage overhead of this embodiment is short and the performance degradation during normal operation is small.
  • the computer system to which this embodiment is applied can store the state at short intervals. Therefore, when the computer system (100) is restarted after the occurrence of a power failure, it becomes possible to save the state of the computer system (100) in the past that is shorter than that of the prior art.
  • the method of dividing the nonvolatile main memory (102) into two and storing the “stable state” on one side has been described.
  • the effect of the present invention is not affected even when the nonvolatile main memory (102) is divided by all integers of 2 or more.
  • the following operation is possible.
  • the OS (117) when the nonvolatile main memory (102) is divided into three, the OS (117) first stores data in all the areas 1 to 3 (that is, the areas 1 to 3). Are all active areas).
  • the OS (117) saves the “stable state” in any one of the active areas 1 to 3 (for example, the area 1).
  • the OS (117) saves the “stable state” in any one of the active areas 2 to 3 (for example, the area 2). (That is, one of the active areas 2 to 3 becomes a stable area). Thereafter, when the “stable state” is further stored, as shown in FIG. 45D, the OS (117) sends the contents of the current active area to one of the other two stable areas as shown in FIG. 45D. To copy.
  • the nonvolatile main memory (102) is divided into m, it is preferable that all m areas have the same capacity, but the capacity of at least one area may be different from the capacity of other areas.
  • OS (117) selectively adopts whether to save "stable state” when “unstable state” is detected or to save “stable state” when “stable state” is detected. (That is, the method described with reference to FIG. 16 or the method described with reference to FIG. 17 can be dynamically changed).
  • a specific file system for example, the Linux (registered trademark) / proc file system is a file system that allows a user to read and write the values of variables in the OS (117), and exists in the / proc file system.
  • the behavior of the OS (117) can be changed by changing the value of the variable inside the OS (117). If this is used, the trigger for storing the “stable state” can be changed during operation.
  • the specific operation is as follows.
  • the OS (117) incorporates a variable indicating the timing for saving the “stable state”. This is called a “timing variable”.
  • the “timing variable” is a first value (eg, “0”)
  • the OS (117) saves the “stable state” when transitioning from the “stable state” to the “unstable state”. It means to do.
  • the “timing variable” is the second value (for example, “1”)
  • the OS (117) stores the “stable state” when transitioning to the “stable state”.
  • the OS (117) is designed to operate as described below.
  • the OS (117) refers to the “timing variable” when transmitting the command to the secondary storage (106).
  • the OS (117) checks the command completion waiting queue (805). If the command completion waiting queue (805) is empty, the “stable state” saving process is started. If the command completion queue (805) is not empty, the OS (117) does nothing. Thereafter, the OS (117) transmits the command to the secondary storage (106). On the other hand, if the “timing variable” is the second value (eg, “1”), the next process is executed without doing anything. The OS (117) refers to the “timing variable” after receiving the command completion report from the secondary storage (106). If the “timing variable” is the second value (for example, “1”), the OS (117) checks the command completion waiting queue (805).
  • the OS (117) If the command completion waiting queue (805) is empty according to the received command completion report, the OS (117) stores the “stable state”. If the command completion queue (805) is not empty, nothing is done and the process proceeds to the next process. On the other hand, if the “timing variable” is the first value (eg, “0”), the OS (117) receives the command completion report from the secondary storage (106), and proceeds to the next processing without doing anything.
  • the “timing variable” is the first value (eg, “0”)
  • the method in which the nonvolatile main memory (102) is divided and the OS stores the “stable state” in the one area has been described.
  • the second embodiment an implementation example in which the nonvolatile main memory (102) is not divided will be described. At this time, differences from the first embodiment will be mainly described, and description of common points with the first embodiment will be omitted or simplified.
  • FIG. 29 shows a computer system (2900) according to the second embodiment of the present invention.
  • the differences from the first embodiment are the I / O controller (2901), the flag area (2902) in the firmware storage memory (104), and the OS (2903).
  • Fig. 30 shows the flag area (2902) in the firmware storage memory (104).
  • the flag area (2902) has a shutdown completion flag (501), a page table pointer (3001), and an OS failure recovery program vector (503).
  • the page table pointer (3001) is a pointer to a page table (explained later) which is management information of the nonvolatile main memory (102).
  • the shutdown completion flag (501) and the OS failure recovery program vector (503) are the same as in the first embodiment.
  • Fig. 31 shows the structure of OS (2903).
  • the OS has a kernel (3101), a device driver (202), an OS failure recovery program (203), recovery stack pointers (3107) and (3108), and a system state variable (207).
  • the kernel (3101) has a device driver list (204) as in the first embodiment.
  • the characteristic point of the second embodiment is the structure of the memory management information held by the kernel (3101).
  • the computer system manages the main memory in units of fixed sizes called pages. This size depends on the specifications of the CPU (101).
  • the page size is often 4KiB. Here, “KiB” indicates 1024 bytes.
  • page management information (3103) for each page (3102).
  • the kernel (3101) manages the page table (3104), the page table pointer (3001), the check code (3105), the page management information list (3109), and the free page list (3110).
  • the page table (3104) is a list indicating physical page numbers corresponding to virtual addresses. At first glance, it seems that only one page table (3104) is required, but one feature of the present embodiment is that the kernel (3101) has a plurality of page tables (3104).
  • the page table pointer (3001) is a list of pointers to each page table (3104).
  • the check code (3105) is an error detection / correction code for checking whether the page table (main memory management information) is updated correctly when it is updated.
  • the page management information list (3109) is a list of used page management information (3103).
  • the free page list (3110) is a list of page management information (3103) of unused pages.
  • the OS (2903) manages the stable state storage time table (3111).
  • the stable state storage time table (3111) stores the time (3113) when the “stable state” of each generation is stored.
  • FIG. 32 shows page management information (3103) and a page table (3104).
  • the page management information (3103) has a page number (3201), a page attribute (3202), a page physical address (3203), and a reference count (3204).
  • the page number (3201) is an identification number for uniquely identifying the page (3102).
  • the page attribute (3202) is information indicating the type of access to which the corresponding page that can be read or written.
  • Page physical address (3203) indicates the physical address of the page.
  • Reference count (3204) indicates the number of page tables (3104) pointing to the page.
  • the page table (3104) has a generation number (3205), a virtual address (3206), a page number (3207), and a page attribute (3208).
  • the number of generations (3205) is a numerical value indicating the “stable state” generation of the nonvolatile main memory (102). Although details will be described later, the page table (3104) is newly generated every time the OS (2903) stores the “stable state”. Therefore, a plurality of “stable states” may exist in the nonvolatile main memory (102).
  • the number of generations (3205) is a number assigned to each of a plurality of “stable states”.
  • the virtual address (3206) is an address in the process space sent by a program (application) running on the OS (2903).
  • the page number (3207) indicates the number of the page (3102) corresponding to the virtual address (3206).
  • the page attribute (3208) indicates the type of operation permitted for the page. For example, READ ONLY, READ enabled, or WRITE enabled.
  • the above virtual address (3206), page number (3207), and page attribute (3208) are collectively referred to as a page table entry (3209).
  • the page table (3104) is a list of page table entries (3209).
  • the process of converting a virtual address and a physical address using the page table (3104) is executed by an address translation function called TLB (Translate Look-aside Buffer) of the CPU (101).
  • TLB Translate Look-aside Buffer
  • the address conversion process may be performed by the OS (2903).
  • a physical address may be set in the virtual address (3206) of the page table entry (3209).
  • An area of the nonvolatile main memory (102) that is not the target of virtual storage can also be placed under the management of the page table and can be a target of “stable state” storage.
  • the above data structure is taken as an example, but the present invention can be applied to other data structures without being limited to the data structure.
  • Figure 33 shows the contents of the page table pointer (3001).
  • the 0th generation page table pointer (3301), the (G-1) generation page table pointer (3302), and the G generation page table pointer (3303) have a double linked list configuration. Each page table pointer points to the corresponding generation page table (3104).
  • the check code (3105) also has a double linked list structure of check codes (3304) to (3306) of each generation.
  • FIG. 34 shows the change in the data structure when the OS (2903) stores the “stable state”.
  • the OS (2903) When saving the “stable state”, the OS (2903) first creates a new page table (3401) by copying the page table (3104). Then, the OS (2903) adds a new page table pointer (3402) to the page table pointer (3001). Then, the OS (2903) increments the generation number (3201) of the new page table (3401). Then, the OS (2903) starts using the new page table (3401). At this time, the old and new page tables point to the same page management information (3103). Therefore, the OS (2903) increments the reference count (3207) of each page management information (3103). In the first embodiment, it is necessary to copy all the contents of the “stable state” area to another area, but in the method of the second embodiment, the OS (2903) changes only the management information.
  • Fig. 35 shows the flowchart for saving the "stable state" of the OS (2903).
  • Step (3501) Processing starts.
  • the trigger for starting the process may be any of the multiple types of triggers described in the first embodiment.
  • Step (3502) The OS (2903) suppresses transmission of a new command to the secondary storage (106).
  • any of the several methods described in the first embodiment may be selected.
  • Step (3503) The OS (2903) checks whether there is an incomplete command among the commands transmitted to the secondary storage (106). This step is not necessary when the OS (2903) selects a method of saving the “stable state” when there is no unfinished command.
  • Step (3504) The OS (2903) stores the recovery stack pointers (3107) to (3108).
  • the recovery stack pointers (3107) to (3108) are in the form of a doubly linked list. Therefore, the OS (2903) adds a new recovery stack pointer to the double linked list of the recovery stack pointers (3107) to (3108).
  • Step (3506) The OS (2903) copies the page table (3104).
  • Step (3507) The OS (2903) increments the number of generations of the new page table (3104) (the number of generations for the copied page table). For example, if the number of generations is P (P is an integer), the number of generations is set to (P + 1) by this step.
  • Step (3508) The OS (2903) increments the reference count (3204) of the page management information (3103) of the page in use.
  • Step (3509) The OS (2903) sets the page attribute (3205) of the page in use to READ ONLY.
  • Step (3510) The OS (2903) saves the OS failure recovery program vector (503) in the firmware storage memory (104).
  • CRC Cyclic Redundancy Check
  • FIG. 37 shows a flowchart of the OS failure recovery program (3106).
  • Step (3701) This step is the step immediately after the firmware processing is completed and jumps to the OS failure recovery program (3106).
  • Step (3702) In the second embodiment, a plurality of “stable states” of the nonvolatile main memory (102) can be maintained. Therefore, the user can specify the generation of the nonvolatile main memory (102).
  • the OS failure recovery program (3106) can display a screen for accepting designation of the generation of the nonvolatile main memory (102) on a console (not shown). Therefore, in this step, the OS failure recovery program (3106) determines whether or not the user has specified the generation of the nonvolatile main memory (102).
  • Step (3702) When the generation of the nonvolatile main memory (102) is not designated by the user, the OS failure recovery program (3106) executes the latest generation of the nonvolatile main memory (102) (the G generation in the second embodiment). Page table pointer (3301) is selected and referred to.
  • Step (3703) The OS failure recovery program (3106) reads the check code (3105).
  • Step (3705) If the two check codes match, the OS (2903) uses the G-th generation page table pointer (3301).
  • Step (3706) If the two check codes do not match, the OS (2903) uses the (G-1) generation page table pointer (3302).
  • Step (3707) The OS failure recovery program (3106) refers to the page table pointer (3001) of the generation designated by the user (X generation in this embodiment).
  • Step (3708) The OS (2903) selects and references the Xth generation page table pointer (3301).
  • Step (3709) The OS failure recovery program (3106) regenerates a check code from the page table (3104), page table pointer (3001), and page management information (3103), and the check code referenced in step (3803) Compare with (3105).
  • Step (3710) This step is the same as Step (3805). However, the determination is made with respect to the Xth generation page table (3104).
  • Step (3711) This step is the same as Step (3805). However, the Xth generation page table (3104) is used.
  • Step (3712) This step is the same as Step (3805). However, the (X-1) th generation page table pointer (3001) is used.
  • Step (3813) Subsequent processes are the same as those in FIGS.
  • the page table (3104) and the new page table (3401) point to the same page.
  • the OS (2903) takes out an unused page and changes the content of the page (3801) to be changed to the page that has been taken out. Copying is performed, and the copy destination page is set as a new page (3802). Then, the OS (2903) changes the pointer to the page (3801) in the new page table to the pointer to the new page (3802).
  • Fig. 39 shows a ladder chart of the page rewriting process.
  • Step (3901) Application or OS (2903) tries to update page (3801).
  • the TLB of the CPU (101) refers to the page table entry (3209) of the page (3801) and determines whether or not the page can be rewritten.
  • the page attribute is READ ONLY. Therefore, the CPU (101) generates a page fault exception (3902).
  • Step (3903) The CPU (101) calls a page fault handler in the OS.
  • Step (3904) The page fault handler is called.
  • Step (3905) The page fault handler takes out one page from the unused pages and copies the contents of page (3801). Then, the page fault handler makes the page attribute READ READ.
  • Step (3906) The page fault handler changes the pointer to the page (3801) of the new page table to the pointer to the new page (3802).
  • Step (3907) Processing of the page fault handler ends, and the application or OS (2903) resumes operation.
  • Step (3908) The application updates the new page (3802).
  • the application or OS (2903) does not notice that another page (3802) has been updated.
  • Step (4001) This step is the start of OS (2903) processing. This process is started by at least one of various triggers such as an instruction from the user, the free capacity of the nonvolatile main memory (102) being less than a certain value, a certain time interval, and the number of generations exceeding a certain value.
  • various triggers such as an instruction from the user, the free capacity of the nonvolatile main memory (102) being less than a certain value, a certain time interval, and the number of generations exceeding a certain value.
  • Step (4002) The OS (2903) refers to the page table (3104) of the oldest generation.
  • Step (4003) The OS (2903) refers to the page management information (3103) of each page (3102) pointed to by the oldest generation page table (3104), and reads the reference count (3204).
  • Step (4004) The OS (2903) checks whether the reference count (3204) is equal to 1.
  • Step (4005) If the reference count (3204) is 1, the page (3102) may be released because the other page table (3104) is not used.
  • the OS (2903) sets the reference count (3204) of the page (3102) to 0 and registers it in the free page list (3110).
  • Step (4006) The OS (2903) determines whether all pages registered in the page table (3104) have been confirmed. When confirmation for all pages is completed, the process proceeds to step (4007). If confirmation has not been completed for all pages, the process proceeds to step (4003).
  • Step (4007) Processing ends.
  • the process of FIG. 40 may be repeated until a predetermined condition is satisfied. For example, if the process of FIG. 40 is started when the free capacity of the nonvolatile main memory (102) has fallen below a certain value, the free capacity of the nonvolatile main memory (102) even after the process of FIG. If the value is still below a certain value, the process of FIG. 40 is executed again.
  • FIG. 40 the OS (2903) virtually erases the data by setting the old generation page to the “unused” state.
  • a process of writing the contents of the old generation page (3102) to the secondary storage (106) is also conceivable.
  • FIG. 41 is a flowchart of the processing.
  • Step (4101) Step (4001).
  • Step (4103) The OS (2903) writes the selected page table (3104) and the page (3102) pointed to to the secondary storage (106).
  • the OS (2903) newly adds an update page (3102) from the nonvolatile main memory (102) in the “stable state”. Since the entire nonvolatile main memory (102) cannot be changed at once, even if the OS (2903) adds an update page (3102), it is updated when viewed from the entire nonvolatile main memory (102) The range is small. Therefore, it can be said that the OS (2903) efficiently uses the capacity of the nonvolatile main memory (102).
  • the capacity required for the nonvolatile main memory (102) is more than m times the capacity required for one active area when the nonvolatile main memory is divided into m.
  • the capacity required for the nonvolatile main memory (102) may be approximately the same as the capacity required for one active area. Further, in the method of the first embodiment, it is necessary to copy the entire contents of the active area to another region, but in the method of the second embodiment, only the management information in the nonvolatile main memory (102) needs to be updated. For this reason, the “stable state” storage operation hardly affects the performance of the computer system (2900).
  • the “stable state” of the nonvolatile main memory (102) is saved, and the computer system (2900) resumes operation while ensuring consistency when a failure occurs.
  • the past state of the file stored in the secondary storage (106) is also extracted.
  • Some file systems that store file change history are known. For example, Apple (registered trademark) HFS + stores a file change history. Then, the user can read out a desired file at an arbitrary point in the past. Combining this technology with such a so-called write-once file system allows the computer system (2900) to resume operation from a certain state in the past.
  • Apple (registered trademark) HFS + stores a file change history. Then, the user can read out a desired file at an arbitrary point in the past.
  • write-once file system allows the computer system (2900) to resume operation from a certain state in the past.
  • FIG. 42 shows the management information of the write-once file system assumed in the third embodiment.
  • the OS (2903) stores these management information in the secondary storage (106).
  • the inode map (4201) is a set of pointers (4202) to the inode.
  • “inode” is management information in which information related to a file (creation date, update time, access permission information, etc.) is stored.
  • inode0 (4203) is the 0th inode in the secondary storage (106).
  • the inode0 (4203) includes an inode number (4205) and a sub-inode pointer (4206).
  • the inode number (4205) is a number uniquely assigned to the inode (4203).
  • the sub-inode (4208) is file management information at a certain point in the past.
  • a plurality of inodes (4203) may exist in one file.
  • the inode (4203) is typically designed to be basically stored in a specific area in the secondary storage (106) with a specific size.
  • the OS (2903) saves the change history, it must be variable. Therefore, the inode (4203) has a fixed size and has only a pointer to actual management information, and saves the actual file information in an undefined address and indefinite size data structure called sub-inode (4206).
  • the sub-inode (4206) has an inode number, an update time, a version number, and a pointer to a file block (4207) that is the contents of the file. Furthermore, sub-inode (4208) is connected to each other in a doubly linked list.
  • Figure 43 shows the sub-inode (4206).
  • Sub-inode (4206) has inode number (4301), update time (4302), version (4303), and pointer to file block (4304) (the forward pointer and backward pointer are omitted).
  • the inode number (4301) is a number uniquely assigned to the inode (4203).
  • sub-inode (4206) has the same number.
  • the update time (4302) indicates the time when the version of the file was updated.
  • Version (4303) is a number uniquely assigned to sub-inode (4208). When the file is updated, the number increases by one. The update timing of the file and the “stable state” storage timing of the nonvolatile main memory (102) may or may not match.
  • the OS when the file is updated, the OS (2903) duplicates the latest sub-inode (4206). The OS (2903) then changes the pointer to the file block (4207) of the duplicated sub-inode (4206), increments the version number, and ends the double-linked list of sub-inode (4206). Add to the tail.
  • the inode (4203) sub-inode pointer (4206) is the head of the doubly linked list of sub-inode (4206) (oldest sub-inode (4206)) and tail (newest sub-inode (4206)) Pointing.
  • FIG. 44 is a flowchart of processing performed when the user issues an instruction to the OS (2903) to open a certain file in the “stable state” of the computer system (2900) at a certain time t in the past. Indicates.
  • Step 4401 The user instructs the OS (2903) to open the file.
  • Step 4402 The OS (2903) collects the storage time (3113) of the operating “stable state”. Furthermore, the elapsed time after restarting the operation from the “stable state” is added to the storage time (3113). This is a variable t.
  • Step (4403) The OS (2903) takes out the latest sub-inode (4206).
  • the version is V.
  • Step (4404) The OS (2903) substitutes V for the variable v indicating the version.
  • Step (4405) The OS (2903) extracts the update time T (v) of the version from the sub-inode (4206).
  • Step (4408) Conversely, if t ⁇ T (v), it means that the file of version v did not exist at the time of operation. Then, the OS (2903) determines whether v is 0.
  • Step (4409) If v is 0, it means that the file did not exist during operation. Therefore, the OS (2903) reports to the user “File not Found”.
  • Step (4410) If v is not 0, v is decremented and the process returns to step (4405).
  • Step (4411) The process ends.
  • the user can resume operation from the past state (nonvolatile main memory (102) and file) of the computer system (2900). is there.
  • the entire computer system (including the main memory and the file system) can be saved and the operation can be resumed without using the logical partitioning technique.
  • the performance in this embodiment may be compared with the performance of a general logical partitioning technique.
  • the performance here refers to two performances of normal operation performance and state preservation processing. Note that the present invention can also be applied to a write-once file system having a data structure different from that shown in FIG.

Abstract

The generation of mismatches between the state of a nonvolatile main memory and the state of a peripheral device is prevented. An operating system (OS) detects the transition to the stable state which is the state where each command transmitted to the peripheral device is not pending, and stores stable state information, which is information containing the data stored in the main memory in the stable state and the command address when transitioning to the stable state, in the main memory.

Description

不揮発性の主記憶を備えた計算機システムComputer system with non-volatile main memory
 本発明は、プロセッサと主記憶とを備えた計算機システムに関する。 The present invention relates to a computer system having a processor and a main memory.
 従来より、計算機システムの分野では、不意の停電によりデータが不正に書き変えられることを防ぐ技術が研究されている。その技術でもっとも普及している技術は、トランザクション処理技術である。トランザクション処理技術については、特許文献1に詳しく開示されている。トランザクション処理には、さまざまな実現方法があるが、その要諦は、ジャーナリングにある。ジャーナリングとは、データの更新の履歴のことである。例えば、二次記憶に格納されたデータを複数のステップで更新する場合に、その更新履歴(ジャーナル)が二次記憶に書き込まれ、その後に当該データが更新され、二次記憶に書き込まれたジャーナルに、当該データの更新の成功が記録される(この記録を「チェックポイント」と呼ぶ)。この方式により、データ更新中に停電によりデータ更新が中断されても、ジャーナルが残っているので、データ更新処理の開始以前の状態に戻ることができる。そして、改めて同じ処理が実行されればよい。このようにして、二次記憶に格納されるファイルのレベルで一貫性が保証される。 Conventionally, in the field of computer systems, a technique for preventing data from being rewritten illegally due to an unexpected power failure has been studied. The most popular technology is transaction processing technology. The transaction processing technique is disclosed in detail in Patent Document 1. There are various ways to implement transaction processing, but the key is in journaling. Journaling is a history of data updates. For example, when updating data stored in the secondary storage in multiple steps, the update history (journal) is written to the secondary storage, and then the data is updated and written to the secondary storage. The success of updating the data is recorded (this record is called “checkpoint”). With this method, even if the data update is interrupted due to a power failure during the data update, the journal remains, so that the state before the start of the data update process can be restored. And the same process should just be performed anew. In this way, consistency is guaranteed at the level of the file stored in secondary storage.
 このように、ファイルレベルでの一貫性が保証されるようになると、主記憶内の演算の途中結果などを含んだシステム状態(システムレベルでの状態)を保存し、システム状態に一貫性を持たせようとする要求が高まり始めた。その一例が非特許文献1である。非特許文献1では、計算機システムの電源状態が定義されている。その中に「S4状態」がある。「S4状態」は、CPUのコンテキスト及び主記憶の内容(主記憶に記憶されているデータ)等がすべて二次記憶に保存されほとんどの部品の電源が切断される状態である。計算機システムのキーボードを押すなどの操作を契機に、計算機システムが、「S4状態」から「運転状態G0」に復帰すると、計算機システムの状態が、「S4状態」に遷移する直前の状態に復帰する。この技術を「ハイバネーション(hibernation)」という。しかし、この技術は、主記憶の内容をすべて二次記憶に保存するため、主記憶の大容量化に伴い実行時間が長時間に及ぶようになった。そのため、頻繁に実行できず、停電からの復帰に長時間かかるようになった。これによって、事実上、システム状態の一貫性を保つための技術としてハイバネーション技術を使うことができなくなった。また、ハイバネーション技術は、もともと省電力を目的としているため、運転状態に復帰した際に、保存したシステム状態を消去してしまう。そのため、停電後から復帰はできても、次回の停電発生時には、復帰すべきシステム状態が消去されているため、停電発生前の状態に復帰することができない。したがって、ハイバネーション技術では停電に備えることはできない。 When consistency at the file level is assured in this way, the system state (state at the system level) including intermediate results of operations in the main memory is saved, and the system state is consistent. The demand to do so began to increase. One example is Non-Patent Document 1. Non-Patent Document 1 defines a power state of a computer system. Among them is the “S4 state”. The “S4 state” is a state in which the CPU context, the contents of the main memory (data stored in the main memory), etc. are all stored in the secondary memory and the power of most components is turned off. When the computer system returns from the "S4 state" to the "operating state G0" when an operation such as pressing the keyboard of the computer system is performed, the computer system state returns to the state immediately before the transition to the "S4 state". . This technique is called “hibernation”. However, since this technique stores all the contents of the main memory in the secondary memory, the execution time has become longer due to the increase in the capacity of the main memory. As a result, it cannot be executed frequently and it takes a long time to recover from a power failure. This effectively made it impossible to use hibernation technology as a technology to maintain system state consistency. Further, since the hibernation technique is originally intended to save power, the stored system state is erased when the operation state is restored. For this reason, even if recovery is possible after a power failure, when the next power failure occurs, the system state that should be restored is erased, so it cannot be restored to the state before the power failure occurred. Therefore, hibernation technology cannot prepare for power outages.
 一方、「論理分割」という技術を用いることで、システム状態を保存し停電に備える技術も存在する。それが特許文献2に開示の技術である。論理分割とは、1台の計算機システムを、その計算機システム上で稼働する「VMM(Virtual Machine Monitor)」というソフトウェアにより、仮想的に複数の計算機システムが稼働しているようにみせる技術である。VMMによって生成された仮想的な計算機を「VM(Virtual Machine)」という。VM上を走行するOS(Operating System)は、VMと物理計算機を区別できない。なぜなら、VMMが主記憶上に仮想的なハードウェアを生成しているからである。そのため、VMMは、主記憶に格納されたVMの状態を、たとえVMがどのような状態にあっても、それを二次記憶に保存することができる。二次記憶に格納されたVMの状態を、以下、「VM状態ファイル」と呼ぶ。VMMは、VM状態ファイルを、いつでもいくつでも保存することができる。そのため、過去のどの時点のVM状態にも復帰することができる。このように、特許文献2は、論理分割技術を応用して停電に備える技術であるといえる。 On the other hand, there is also a technology that preserves the system state and prepares for a power failure by using a technology called “logical partition”. That is the technique disclosed in Patent Document 2. Logical partitioning is a technology that makes a single computer system appear to be virtually operated by multiple software systems called “VMM (Virtual Machine Monitor)” that operates on the computer system. A virtual computer generated by VMM is called “VM (Virtual Machine)”. An OS (Operating System) running on a VM cannot distinguish between a VM and a physical computer. This is because VMM generates virtual hardware on the main memory. Therefore, the VMM can save the state of the VM stored in the main memory in the secondary storage regardless of the state of the VM. The state of the VM stored in the secondary storage is hereinafter referred to as “VM state file”. VMM can store any number of VM state files at any time. Therefore, it is possible to return to the VM state at any time in the past. Thus, Patent Document 2 can be said to be a technique for applying a logical partitioning technique to prepare for a power failure.
 しかし、論理分割技術は、性能劣化という問題を抱えている。具体的には、以下の例が存在する。
(1)OSまたはアプリケーションがハードウェア(ここではVMMによって実現された仮想的なハードウェア)にアクセスするときや、CPUの特権命令を実行しようとするたびに、CPUが例外を発生させて処理をVMMに移す。VMMはハードウェアの動作をエミュレートして、処理をOS、アプリケーションに戻す。このようなエミュレート動作のためにVMMというソフトウェアが走行してしまうため、性能劣化が大きい。また、上記のようなOS、アプリケーションによるVMのハードウェアアクセスが頻繁に発生する点も、性能劣化を大きくしている。
(2)VMMは、主記憶上のVM状態を二次記憶に保存する。そのためのオーバーヘッドも大きい。
However, the logical partitioning technology has a problem of performance degradation. Specifically, the following examples exist.
(1) When an OS or application accesses hardware (here, virtual hardware implemented by VMM) or tries to execute a privileged instruction of the CPU, the CPU generates an exception and performs processing. Move to VMM. VMM emulates hardware behavior and returns processing to the OS and applications. The software called VMM runs for such an emulation operation, so performance degradation is significant. In addition, VM hardware access by the OS and applications as described above frequently occurs, which greatly increases performance degradation.
(2) The VMM saves the VM state on the main memory in the secondary memory. The overhead for that is also large.
 このように、通常運転時、システム状態保存時の性能劣化が特許文献2の課題である。 As described above, the problem of Patent Document 2 is performance deterioration during normal operation and system state storage.
 これらの課題の根源は、現在の計算機システムにおいて不揮発媒体が二次記憶のみに限定されている点にある。その課題を解決するため、主記憶として使用できる不揮発性の半導体デバイスの研究が進められている。その代表的な例が特許文献3である。特許文献3に記載されている半導体デバイスは、MRAM(Magnetic Random Access Memory)と呼ばれている。MRAMは、ランダムアクセスが可能で、不揮発、DRAM(Dynamic RAM)より短い応答時間という3つの特徴をあわせもつ半導体デバイスである。そのため、将来、MRAMの集積度が向上すれば、主記憶となる可能性がある。そしてMRAMによって、これまで述べてきた計算機システムの状態保存に関する課題を解決されることが期待されている。 The root of these problems is that the nonvolatile medium is limited to secondary storage in the current computer system. In order to solve the problem, research on a nonvolatile semiconductor device that can be used as a main memory is underway. A typical example is Patent Document 3. The semiconductor device described in Patent Document 3 is called MRAM (Magnetic Random Access Memory). MRAM is a semiconductor device that can be randomly accessed and has three characteristics: non-volatile, and response time shorter than DRAM (Dynamic RAM). Therefore, if the degree of integration of MRAM is improved in the future, it may become a main memory. The MRAM is expected to solve the problems related to the state preservation of the computer system described so far.
米国特許第7467330号明細書U.S. Pat. No. 7,673,330 米国特許第6795966号明細書U.S. Patent No. 6795966 米国特許第7154772号明細書U.S. Pat.No. 7,147,472
 しかし、MRAMのような不揮発でランダムアクセス可能な半導体デバイスを主記憶として採用するだけでは、前記の課題は解決されない。以下、その理由を説明する。 However, the above problem cannot be solved only by adopting a nonvolatile and randomly accessible semiconductor device such as MRAM as the main memory. The reason will be described below.
 図8に示すように、OSは、二次記憶(4516)に対しコマンド(図では"cmd"と記載)を送信する。二次記憶(4516)は、コマンドを実行し、コマンド実行完了をOSに報告する。 As shown in FIG. 8, the OS sends a command (denoted as “cmd” in the figure) to the secondary storage (4516). The secondary storage (4516) executes the command and reports the command execution completion to the OS.
 一般に、二次記憶(4516)の応答時間は、CPU(4501)の処理時間と比較して非常に長い。このため、通常、OSは、二次記憶(4516)がコマンドを実行している間、別の処理を実行する。 Generally, the response time of the secondary memory (4516) is very long compared with the processing time of the CPU (4501). For this reason, normally, the OS executes another process while the secondary storage (4516) executes the command.
 そこで、図8に示すように、二次記憶(4516)からコマンド実行完了報告が送信されていないコマンドを、OSが、不揮発主記憶(4502)内のコマンド完了待ちキュー(805)に登録する。図8では、OSが、cmd0(806)とcmd1(807)をコマンド完了待ちキュー(805)に登録している。 Therefore, as shown in FIG. 8, the OS registers a command for which a command execution completion report has not been transmitted from the secondary memory (4516) in the command completion queue (805) in the nonvolatile main memory (4502). In FIG. 8, the OS registers cmd0 (806) and cmd1 (807) in the command completion waiting queue (805).
 図8に示す状態で停電が発生し、その後、計算機システム(4500)が再起動した状態を考察する。このとき、計算機システムの状態は、図9に示す状態になっている。すなわち、主記憶(4502)は不揮発なので、コマンド完了待ちキュー(805)には、cmd0(806)とcmd1(807)がOSによって登録された状態のまま残っている。一方、二次記憶(4516)では、OSから受信したcmd0(806)、cmd1(807)は、停電により消滅している。したがって、二次記憶(4516)は、コマンド実行完了報告を送信しない。しかし、OSは、cmd0(806)、cmd1(807)の完了報告を待っている。いつまでたってもコマンド実行完了報告は来ないのでOSは、二次記憶(4516)に障害が発生したと判断する。 Suppose that a power failure occurs in the state shown in Fig. 8, and then the computer system (4500) is restarted. At this time, the state of the computer system is as shown in FIG. That is, since the main memory (4502) is non-volatile, cmd0 (806) and cmd1 (807) remain registered in the command completion waiting queue (805) by the OS. On the other hand, in the secondary storage (4516), cmd0 (806) and cmd1 (807) received from the OS have disappeared due to a power failure. Therefore, the secondary storage (4516) does not transmit a command execution completion report. However, the OS waits for completion reports of cmd0 (806) and cmd1 (807). Since the command execution completion report does not come indefinitely, the OS determines that a failure has occurred in the secondary storage (4516).
 このように、主記憶を不揮発としただけでは、停電発生等が原因で、周辺機器(例えば二次記憶)の状態と主記憶の状態との間に不整合が生じてしまう可能性がある。このため、計算機システムは、停電後に運転を再開することはできない。 As described above, if the main memory is only nonvolatile, there is a possibility that a mismatch occurs between the state of the peripheral device (for example, the secondary memory) and the state of the main memory due to the occurrence of a power failure or the like. For this reason, the computer system cannot resume operation after a power failure.
 OSが、周辺装置に送信したいずれのコマンドも仕掛り中に無い状態である安定状態への遷移を検出し、安定状態での不揮発主記憶に記憶されているデータと安定状態に遷移したときの命令アドレスとを含む情報である安定状態情報を不揮発主記憶に保存する。なお、主記憶とされる不揮発な媒体は、どんな媒体でも良い。 When the OS detects a transition to a stable state in which none of the commands sent to the peripheral device is in progress, and when the OS transitions to the stable state with the data stored in the nonvolatile main memory in the stable state The stable state information, which is information including the instruction address, is stored in the nonvolatile main memory. The non-volatile medium used as the main memory may be any medium.
 保存された安定状態情報は、幾つかのことに利用することができる。例えば、停電等の障害の後に、安定状態情報を用いて回復することができる。或いは、例えば、安定状態情報を参考にデバッグを行うこともできる。 Stored steady state information can be used for several things. For example, after a failure such as a power failure, it can be recovered using stable state information. Alternatively, for example, debugging can be performed with reference to stable state information.
 不揮発主記憶の状態と周辺機器の状態との間に不整合が発生することを防ぐことができる。 It is possible to prevent inconsistency between the state of the nonvolatile main memory and the state of the peripheral device.
図1は、本発明の実施例1に係る計算機システムのブロック図である。FIG. 1 is a block diagram of a computer system according to Embodiment 1 of the present invention. 図2は、OS(117)の機能ブロック図である。FIG. 2 is a functional block diagram of the OS (117). 図3は、I/Oコントローラ(103)の機能ブロック図である。FIG. 3 is a functional block diagram of the I / O controller (103). 図4は、主記憶設定レジスタ群(306)の説明図である。FIG. 4 is an explanatory diagram of the main memory setting register group (306). 図5は、ファームウェア格納メモリ(104)内のフラグ領域(114)の説明図である。FIG. 5 is an explanatory diagram of the flag area (114) in the firmware storage memory (104). 図6は、I/Oコントローラ(103)のアドレス変換機構のフローチャートである。FIG. 6 is a flowchart of the address translation mechanism of the I / O controller (103). 図7は、ファームウェアの動作を示すフローチャートである。FIG. 7 is a flowchart showing the operation of the firmware. 図8は、OS(117)と二次記憶(106)間の動作を説明した図である。FIG. 8 is a diagram for explaining the operation between the OS (117) and the secondary storage (106). 図9は、OSと二次記憶との間の処理の一例を示す図である。FIG. 9 is a diagram illustrating an example of processing between the OS and the secondary storage. 図10は、図9における停電発生時の不揮発主記憶及び二次記憶の一例を示す。FIG. 10 shows an example of the nonvolatile main memory and the secondary memory when the power failure occurs in FIG. 図11は、「安定状態」を説明した図である。FIG. 11 is a diagram illustrating the “stable state”. 図12は、「安定状態」を保存する方法の一例を示した図である。FIG. 12 is a diagram illustrating an example of a method for storing the “stable state”. 図13は、「安定状態」を保存する方法の一例を示した図である。FIG. 13 is a diagram illustrating an example of a method for storing the “stable state”. 図14は、「安定状態」を保存する方法の一例を示した図である。FIG. 14 is a diagram illustrating an example of a method for storing the “stable state”. 図15は、「安定状態」を保存する方法の一例を示した図である。FIG. 15 is a diagram illustrating an example of a method for storing the “stable state”. 図16は、「安定状態」保存処理の開始の契機の一例を示した図である。FIG. 16 is a diagram illustrating an example of a trigger for starting the “stable state” saving process. 図17は、「安定状態」保存処理の開始の契機の一例を示した図である。FIG. 17 is a diagram illustrating an example of a trigger for starting the “stable state” saving process. 図18は、OS(117)が「安定状態」を保存する処理を説明したフローチャートである。FIG. 18 is a flowchart for explaining processing in which the OS (117) stores the “stable state”. 図19は、OS(117)が「安定状態」を保存する処理を説明したフローチャートである。FIG. 19 is a flowchart for explaining processing in which the OS (117) stores the “stable state”. 図20は、OS(117)が「安定状態」を保存する処理を説明したフローチャートである。FIG. 20 is a flowchart for explaining processing in which the OS (117) stores the “stable state”. 図21は、OS(117)が「安定状態」を保存する処理を説明したフローチャートである。FIG. 21 is a flowchart for explaining processing in which the OS (117) stores the “stable state”. 図22は、「安定状態」保存後の運転再開を説明した模式図である。FIG. 22 is a schematic diagram for explaining the resumption of operation after storing the “stable state”. 図23は、「安定状態」保存後の運転再開を説明した模式図である。FIG. 23 is a schematic diagram for explaining the resumption of operation after storing the “stable state”. 図24は、「安定状態」保存後に運転再開する障害回復プログラム(203)のフローチャートである。FIG. 24 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”. 図25は、「安定状態」保存後に運転再開する障害回復プログラム(203)のフローチャートである。FIG. 25 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”. 図26は、「安定状態」保存後に運転再開する障害回復プログラム(203)のフローチャートである。FIG. 26 is a flowchart of the failure recovery program (203) for resuming operation after saving the “stable state”. 図27は、計算機システム(100)のネットワーク通信処理を説明する模式図である。FIG. 27 is a schematic diagram for explaining network communication processing of the computer system (100). 図28は、障害回復プログラム(203)のネットワーク通信再開処理のフローチャートである。FIG. 28 is a flowchart of network communication resumption processing of the failure recovery program (203). 図29は、本発明の実施例2に係る計算機システム(2900)のブロック図である。FIG. 29 is a block diagram of a computer system (2900) according to the second embodiment of the present invention. 図30は、ファームウェア格納メモリ(104)のフラグ領域(2902)の図である。FIG. 30 is a diagram of the flag area (2902) of the firmware storage memory (104). 図31は、OS(2903)の機能ブロック図である。FIG. 31 is a functional block diagram of the OS (2903). 図32は、ページ管理情報(3103)とページテーブル(3104)の説明図である。FIG. 32 is an explanatory diagram of the page management information (3103) and the page table (3104). 図33は、ページテーブルポインタ(3001)とチェックコード(3105)の説明図である。FIG. 33 is an explanatory diagram of the page table pointer (3001) and the check code (3105). 図34は、ページテーブル(3104)のコピーの過程を説明した模式図である。FIG. 34 is a schematic diagram illustrating the process of copying the page table (3104). 図35は、OS(2903)が「安定状態」を保存する処理を説明したフローチャートである。FIG. 35 is a flowchart for explaining processing in which the OS (2903) stores the “stable state”. 図36は、ファームウェアの処理を示したフローチャートである。FIG. 36 is a flowchart showing firmware processing. 図37は、計算機システム(2900)が再起動するときの処理を示したフローチャートである。FIG. 37 is a flowchart showing processing when the computer system (2900) is restarted. 図38は、ページ(3102)の更新の過程を説明した模式図である。FIG. 38 is a schematic diagram illustrating the process of updating the page (3102). 図39は、ページ(3102)の更新の過程を説明したラダーチャートである。FIG. 39 is a ladder chart explaining the process of updating the page (3102). 図40は、古い世代のページを未使用にするOS(2903)の処理を説明したフローチャートである。FIG. 40 is a flowchart for explaining the processing of the OS (2903) that makes an old generation page unused. 図41は、古い世代のページを二次記憶(106)に書き出す処理を説明したフローチャートである。FIG. 41 is a flowchart for explaining the process of writing an old generation page to the secondary storage (106). 図42は、追記型ファイルシステムのデータ構造の一例を示した図である。FIG. 42 is a diagram showing an example of the data structure of the write-once file system. 図43は、sub-inode(4206)のデータ構造を示した図である。FIG. 43 shows the data structure of sub-inode (4206). 図44は、ユーザがファイルを開くようにOS(2903)に要求したときのOSの動作を示したフローチャートである。FIG. 44 is a flowchart showing the operation of the OS when the user requests the OS (2903) to open the file. 図45Aは、初めて「安定状態」が保存される前の状態を示す図である。図45Bは、初めて「安定状態」が保存される場合の処理の説明図である。図45Cは、2回目に「安定状態」が保存される場合の処理の説明図である。図45Dは、3回目以降に「安定状態」が保存される場合の処理の説明図である。FIG. 45A is a diagram illustrating a state before the “stable state” is stored for the first time. FIG. 45B is an explanatory diagram of processing when the “stable state” is stored for the first time. FIG. 45C is an explanatory diagram of processing when the “stable state” is stored for the second time. FIG. 45D is an explanatory diagram of processing when the “stable state” is stored after the third time.
100…計算機システム 100 ... computer system
 以下、図面を参照して、本発明の幾つかの実施例を説明する。なお、以下の説明では、安定状態情報が保存(格納)されることを「「安定状態」が保存(格納)される」と言うことがある。また、以下の説明では、計算機システムに接続される周辺機器は、二次記憶であるとする。二次記憶は、計算機システムに内蔵されていても良いし外に存在しても良い。また、二次記憶は、ハードディスクドライブ等のドライブであっても良いし、複数の記憶メディアを備えたストレージシステム(例えばディスクアレイ装置)であっても良い。 Hereinafter, some embodiments of the present invention will be described with reference to the drawings. In the following description, saving (storing) stable state information may be referred to as “saving (storing)“ stable state ”. In the following description, it is assumed that the peripheral device connected to the computer system is a secondary storage. The secondary storage may be built in the computer system or may exist outside. The secondary storage may be a drive such as a hard disk drive or a storage system (for example, a disk array device) provided with a plurality of storage media.
 本発明の実施例1に係る計算機システム(100)を図1に示す。 FIG. 1 shows a computer system (100) according to the first embodiment of the present invention.
 計算機システム(100)は、CPU(Central Processing Unit)(101)、不揮発主記憶(102)、I/Oコントローラ(103)、ファームウェア格納メモリ(104)、I/Oバス(105)、HBA(Host Bus Adapter)(107)、及びNIC(Network Interface Card)(109)を有する。 The computer system (100) consists of a CPU (Central Processing Unit) (101), nonvolatile main memory (102), I / O controller (103), firmware storage memory (104), I / O bus (105), HBA (Host Bus (Adapter) (107) and NIC (Network Interface Card) (109).
 CPU(101)は、演算を担当する。 CPU (101) is in charge of calculation.
 不揮発主記憶(102)には、OS(117)及びアプリケーション(図示せず)が格納されている。また、不揮発主記憶(102)は、二つの領域に分割されている。それらを領域1(110)、領域2(111)と呼ぶ。二つの領域のいずれか一方に「安定状態」が格納され、停電が発生した後の再起動時に、「安定状態」が保存された領域のOS(117)が起動する。 The non-volatile main memory (102) stores an OS (117) and an application (not shown). The nonvolatile main memory (102) is divided into two areas. These are referred to as region 1 (110) and region 2 (111). The “stable state” is stored in one of the two areas, and the OS (117) in the area in which the “stable state” is saved is activated at the time of restart after a power failure occurs.
 I/Oコントローラ(103)は、CPU(101)及び不揮発主記憶(102)に接続されており、不揮発主記憶(102)の制御および上記各要素間のデータ転送を制御する。 The I / O controller (103) is connected to the CPU (101) and the nonvolatile main memory (102), and controls the nonvolatile main memory (102) and the data transfer between the above elements.
 ファームウェア格納メモリ(104)は、計算機システム(100)の起動時にCPU(101)が実行するファームウェアを格納する不揮発記憶媒体である。ファームウェア格納メモリ(104)には、ファームウェア格納領域(112)と、本実施例に特有のフラグ領域(113)とが格納されている。 Firmware storage memory (104) is a non-volatile storage medium that stores firmware executed by CPU (101) when computer system (100) is started. The firmware storage memory (104) stores a firmware storage area (112) and a flag area (113) unique to the present embodiment.
 I/Oバス(105)は、HBA(107)及びNIC(109)とI/Oコントローラ(103)との間のデータ転送媒体である。 The I / O bus (105) is a data transfer medium between the HBA (107) and NIC (109) and the I / O controller (103).
 HBA(107)は、OS(117)の命令に従って二次記憶(106)を制御する。 The HBA (107) controls the secondary storage (106) according to the instruction of the OS (117).
 NIC(109)は、OS(117)の命令に従ってLAN(Local Area Network)(108)を通じて他の計算機システムと通信を行う。計算機システム間の通信は、LAN(108)に代えて他種のネットワークを介して行われて良い。 NIC (109) communicates with other computer systems via LAN (Local Area Network) (108) in accordance with instructions of OS (117). Communication between computer systems may be performed via another type of network instead of the LAN (108).
 OS(117)の構成を図2に示す。 Figure 2 shows the configuration of OS (117).
 OS(117)は、カーネル(201)、デバイスドライバ(202)、電源切断後の再起動時に実行される本実施例に特有のOS障害回復プログラム(203)、OS(117)に組み込まれたデバイスドライバ(202)のリストであるデバイスドライバリスト(204)、及び、デバイスドライバ特有の障害回復処理を行うデバイス回復プログラム(205)を有する。また、保存された「安定状態」の直前の命令アドレスを示す回復スタックポインタ(206)、計算機システム(100)が「安定状態」にあるのか不安定状態にあるのかを示すシステム状態変数(207)がある。 The OS (117) is a kernel (201), a device driver (202), an OS failure recovery program (203) specific to this embodiment that is executed at the time of restart after power-off, and a device incorporated in the OS (117) A device driver list (204), which is a list of drivers (202), and a device recovery program (205) for performing failure recovery processing specific to the device driver are included. Also, a recovery stack pointer (206) indicating the instruction address immediately before the stored "stable state", and a system state variable (207) indicating whether the computer system (100) is in the "stable state" or in an unstable state There is.
 図3にI/Oコントローラ(103)の構成を示す。 Figure 3 shows the configuration of the I / O controller (103).
 I/Oコントローラ(103)は、CPU(101)との通信を制御するCPUインタフェース制御部(301)、主記憶(102)を制御する主記憶インタフェース制御部(302)、ファームウェア格納メモリ(104)との通信を制御するファームウェアインタフェース制御部(303)、I/Oバス(105)との通信を制御するI/Oバスインタフェース制御部(304)、及び、I/Oコントローラ(103)に接続されている各インタフェース間のデータ転送を調停するルーティング制御部(305)を有する。I/Oコントローラ(103)は、さらに、不揮発主記憶(102)内の「安定状態」保存のための状態変数を格納する主記憶設定レジスタ群(306)、及び、不揮発主記憶(102)内のデータ転送と不揮発主記憶(102)-I/Oバス間のデータ転送とを実行するデータ転送エンジン部(307)を持つ。 The I / O controller (103) includes a CPU interface controller (301) that controls communication with the CPU (101), a main memory interface controller (302) that controls the main memory (102), and a firmware storage memory (104). Connected to the firmware interface controller (303) that controls communication with the I / O bus (105), the I / O bus interface controller (304) that controls communication with the I / O bus (105), and the I / O controller (103) A routing control unit (305) for arbitrating data transfer between the interfaces. The I / O controller (103) further includes a main memory setting register group (306) for storing state variables for storing a “stable state” in the nonvolatile main memory (102), and a nonvolatile main memory (102). And a data transfer engine unit (307) that executes data transfer between the nonvolatile main memory (102) and the I / O bus.
 図4に主記憶設定レジスタ群(306)を示す。 Figure 4 shows the main memory setting register group (306).
 動作モードレジスタ(401)は、領域1(110)と領域2(111)への書き込みのモードを示すレジスタである。計算機システム(100)が正常にシャットダウンした後、最初の起動時には、領域1(110)、領域2(111)の両方にデータを書き込む必要がある。そして領域1(110)に「安定状態」を保存してしまうと、OS(117)は、領域2(111)を使って計算を進めていく。従って、主記憶インタフェース制御部(302)は、領域1(110)、領域2(111)の両方にデータを書き込むモードと、いずれか一方の領域にデータを書き込むモードとを持つ。そこで、「安定状態」になくて、現在使用中の領域を「アクティブ領域」と呼ぶことにする。このため、動作モードレジスタ(401)は、「0:アクティブ領域のみ書き込み」と「1:全領域に書き込み」の二つのモードを持つ。 The operation mode register (401) is a register indicating a mode of writing to the area 1 (110) and the area 2 (111). At the first startup after the computer system (100) is normally shut down, it is necessary to write data to both the area 1 (110) and the area 2 (111). If the “stable state” is stored in the area 1 (110), the OS (117) proceeds with the calculation using the area 2 (111). Accordingly, the main memory interface control unit (302) has a mode for writing data in both the area 1 (110) and the area 2 (111) and a mode for writing data in one of the areas. Therefore, an area that is not in a “stable state” and is currently in use is referred to as an “active area”. For this reason, the operation mode register (401) has two modes of “0: write only to active area” and “1: write to all areas”.
 アクティブ領域レジスタ(402)は、現在アクティブな領域を示す。 The active area register (402) indicates a currently active area.
 領域サイズレジスタ(403)は、分割された領域のサイズを示す。 The area size register (403) indicates the size of the divided area.
 安定領域レジスタ(404)は、「安定状態」が保存された領域を示す。 The stable area register (404) indicates an area where “stable state” is stored.
 領域数レジスタ(405)は、領域の総数を示す。本実施例では、不揮発主記憶(102)の領域が2分割されている。しかし、領域の分割数が変わった場合も、本発明の範囲内であることはいうまでもない。 Area number register (405) indicates the total number of areas. In this embodiment, the area of the nonvolatile main memory (102) is divided into two. However, it goes without saying that even when the number of divisions of the region changes, it is within the scope of the present invention.
 図5にフラグ領域(114)を示す。 Figure 5 shows the flag area (114).
 シャットダウン完了フラグ(501)は、前回起動時に、正常なシャットダウンで終了したのか、停電となったのかを示すフラグである。0xFFは初期値を示す。0x00は、計算機システム(100)が正常にシャットダウンしたことを示す。0xEEは、計算機システムが停電で停止しており、「安定状態」が不揮発主記憶(102)に保存されていることを示す。それ以外は、障害が発生したことを示す。本フラグの数値に対する意味付けを変更しても、本発明の趣旨は何ら変わることがないことは言うまでもない。 The shutdown completion flag (501) is a flag that indicates whether a normal shutdown or a power failure occurred at the previous startup. 0xFF indicates an initial value. 0x00 indicates that the computer system (100) is normally shut down. 0xEE indicates that the computer system is stopped due to a power failure, and the “stable state” is stored in the nonvolatile main memory (102). Otherwise, it indicates that a failure has occurred. It goes without saying that the meaning of the present invention does not change even if the meaning of the numerical value of the flag is changed.
 安定領域番号フラグ(502)は、最新の安定領域を示す数値を格納する。 The stable area number flag (502) stores a numerical value indicating the latest stable area.
 OS障害回復プログラムベクタ(503)は、OS障害回復プログラム(203)の命令アドレスを格納する。 The OS failure recovery program vector (503) stores the instruction address of the OS failure recovery program (203).
 領域サイズ(504)は、不揮発主記憶(102)を分割した領域のサイズを格納する。 The area size (504) stores the size of the area obtained by dividing the nonvolatile main memory (102).
 領域数(505)は、不揮発主記憶(102)内の領域数を示す。 The number of areas (505) indicates the number of areas in the nonvolatile main memory (102).
 次に、I/Oコントローラ(103)の不揮発主記憶(102)に対するアドレス送信の手順を図6に示す。 Next, Fig. 6 shows the address transmission procedure for the nonvolatile main memory (102) of the I / O controller (103).
 ステップ(601):I/Oコントローラ(103)は、CPU(101)その他が送信した物理アドレスa(p)を受信する。 Step (601): The I / O controller (103) receives the physical address a (p) transmitted by the CPU (101) and others.
 ステップ(602):I/Oコントローラ(103)は、アクティブ領域レジスタ(402)を参照する。その値をnとする。 Step (602): The I / O controller (103) refers to the active area register (402). Let that value be n.
 ステップ(603):I/Oコントローラ(103)は、アクティブ領域レジスタ(402)の値が0かどうかを判定する。アクティブ領域レジスタ(402)の値が0であれば、I/Oコントローラ(103)は、2分割した領域の両方にアドレスを送信する(ステップ(604)が行われる)。一方、アクティブ領域レジスタ(402)の値が0でなければ、I/Oコントローラ(103)は、アクティブ領域のみにアドレスを送信する(ステップ(610)が行われる)。 Step (603): The I / O controller (103) determines whether or not the value of the active area register (402) is zero. If the value of the active area register (402) is 0, the I / O controller (103) transmits an address to both of the divided areas (step (604) is performed). On the other hand, if the value of the active area register (402) is not 0, the I / O controller (103) transmits an address only to the active area (step (610) is performed).
 ステップ(604):I/Oコントローラ(103)は、領域サイズレジスタ(403)を参照する。この値をsとする。 Step (604): The I / O controller (103) refers to the area size register (403). Let this value be s.
 ステップ(605):I/Oコントローラ(103)は、アドレスns+a(p)を計算する。 Step (605): The I / O controller (103) calculates the address ns + a (p).
 ステップ(606):I/Oコントローラ(103)は、上記アドレスを不揮発主記憶(102)に送信する。 Step (606): The I / O controller (103) transmits the above address to the nonvolatile main memory (102).
 ステップ(607):I/Oコントローラ(103)は、nをインクリメントする。 Step (607): The I / O controller (103) increments n.
 ステップ(608):I/Oコントローラ(103)は、nが2より大きいか判定する。nが2より大きければ、ステップ(609)が行われ、nが2以下であれば、ステップ(605)が行われる。なお、本実施例では、不揮発主記憶(102)を2分割したため、I/Oコントローラ(103)は、nと2の大小を比較した。不揮発主記憶(102)がm(mは2以上の整数)分割された場合には、I/Oコントローラ(103)は、nとmを比較する。 Step (608): The I / O controller (103) determines whether n is greater than 2. If n is greater than 2, step (609) is performed, and if n is 2 or less, step (605) is performed. In this embodiment, since the nonvolatile main memory (102) is divided into two, the I / O controller (103) compares n with the magnitude of 2. When the nonvolatile main memory (102) is divided into m (m is an integer of 2 or more), the I / O controller (103) compares n and m.
 ステップ(609):処理の終了である。 Step (609): This is the end of the process.
 ステップ(610): I/Oコントローラ(103)は、領域サイズレジスタ(403)を参照する。この値をsとする。 Step (610): The I / O controller (103) refers to the area size register (403). Let this value be s.
 ステップ(611): I/Oコントローラ(103)は、アドレス( n-1)s+a(p)を計算する。 Step (611): The I / O controller (103) calculates the address (n-1) s + a (p).
 ステップ(612):I/Oコントローラ(103)は、アドレスを不揮発主記憶(102)に送信する。 Step (612): The I / O controller (103) transmits the address to the nonvolatile main memory (102).
 このようにして、I/Oコントローラ(103)は、アドレスを不揮発主記憶(102)に送信する。本実施例では、ソフトウェアのフローチャートとしてI/Oコントローラ(103)の動作を表現したが、実際には図6と等価なハードウェアの動作であることはいうまでもない。 In this way, the I / O controller (103) transmits the address to the nonvolatile main memory (102). In the present embodiment, the operation of the I / O controller (103) is expressed as a software flowchart, but it goes without saying that the operation is actually a hardware operation equivalent to FIG.
 次に図7を用いて、ファームウェアの動作を説明する。 Next, the operation of the firmware will be described with reference to FIG.
 ステップ701:利用者が電源を投入する。 Step 701: The user turns on the power.
 ステップ702:ファームウェアが、CPU(101)を初期化する。 Step 702: The firmware initializes the CPU (101).
 ステップ703:ファームウェアは、シャットダウン完了フラグ(501)を参照する。 Step 703: The firmware refers to the shutdown completion flag (501).
 ステップ704:シャットダウン完了フラグ(501)の値によって、ファームウェアは、3通りの動作をする。 Step 704: The firmware operates in three ways depending on the value of the shutdown completion flag (501).
 ステップ705:シャットダウン完了フラグ(705)が0xFF又は0x00の場合、前回正常にシャットダウンされているので、ファームウェアは、計算機システム(100)のハードウェアの初期設定を行い、二次記憶(106)からOS(117)を読み込む。 Step 705: If the shutdown completion flag (705) is 0xFF or 0x00, it was shut down normally last time, so the firmware initializes the hardware of the computer system (100) and the OS from the secondary storage (106) Read (117).
 ステップ705:ファームウェアは、I/Oコントローラ(103)を初期化する。 Step 705: The firmware initializes the I / O controller (103).
 ステップ706:ファームウェアは、I/Oコントローラ(103)と不揮発主記憶(102)の間のインタフェースを初期化する。 Step 706: The firmware initializes the interface between the I / O controller (103) and the nonvolatile main memory (102).
 ステップ707: ファームウェアは、不揮発主記憶(102)を0クリアする。 Step 707: The firmware clears the nonvolatile main memory (102) to zero.
 ステップ708: ファームウェアは、領域サイズレジスタ(403)に不揮発主記憶(102)の1/2の容量を設定する。ファームウェアは、安定領域レジスタ(404)に0を設定する。ファームウェアは、領域数レジスタに2を設定する(分割数が上記mであれば、そのレジスタにはmが設定される)。さらに、ファームウェアは、主記憶設定レジスタ群(306)の設定をする。ファームウェアは、動作モードレジスタ(401)に0を設定する。ファームウェアは、アクティブ領域レジスタ(402)に0を設定する。 Step 708: The firmware sets half the capacity of the nonvolatile main memory (102) in the area size register (403). The firmware sets 0 in the stable area register (404). The firmware sets 2 in the area number register (if the division number is m, the register is set to m). Further, the firmware sets the main memory setting register group (306). The firmware sets 0 in the operation mode register (401). The firmware sets 0 in the active area register (402).
 ステップ709:ファームウェアは、I/Oバス(105)を初期化する。 Step 709: The firmware initializes the I / O bus (105).
 ステップ710:ファームウェアは、HBA(107)とNIC(109)を初期化する。 Step 710: The firmware initializes the HBA (107) and NIC (109).
 ステップ711:ファームウェアは、二次記憶(106)からOS起動プログラムを不揮発主記憶(102)にロードする。 Step 711: The firmware loads the OS boot program from the secondary storage (106) to the nonvolatile main storage (102).
 ステップ712:ファームウェアは、OS起動プログラムへジャンプする。 Step 712: The firmware jumps to the OS startup program.
 ステップ713:OS起動プログラムが走行し始める。 Step 713: The OS startup program starts running.
 ステップ714:シャットダウン完了フラグが0xEEであった場合、そのフラグは、「安定状態」が保存されたまま停電が発生したことを意味する。ファームウェアは、ハードウェアの初期設定をした後、OS障害回復プログラム203を呼び出す。ファームウェアは、I/Oコントローラを初期化する。 Step 714: When the shutdown completion flag is 0xEE, the flag means that a power failure has occurred while the “stable state” is stored. The firmware calls the OS failure recovery program 203 after initializing the hardware. The firmware initializes the I / O controller.
 ステップ715:ファームウェアは、I/Oコントローラ(103)と不揮発主記憶(102)の間のインタフェースを初期化する。 Step 715: The firmware initializes an interface between the I / O controller (103) and the nonvolatile main memory (102).
 ステップ716:ファームウェアは、安定領域番号フラグ(502)を読み取り、安定領域レジスタ(404)にその値を書き込む。 Step 716: The firmware reads the stable area number flag (502) and writes the value in the stable area register (404).
 ステップ717:ファームウェアは、領域数(505)の値から領域のサイズを計算する。 Step 717: The firmware calculates the size of the area from the value of the number of areas (505).
 ステップ718:ファームウェアは、上記領域サイズを領域サイズレジスタ(403)に設定する。 Step 718: The firmware sets the area size in the area size register (403).
 ステップ719: ファームウェアは、I/Oバス(105)を初期化する。 Step 719: The firmware initializes the I / O bus (105).
 ステップ720: ファームウェアは、HBA(107)とNIC(109)を初期化する。 Step 720: The firmware initializes the HBA (107) and NIC (109).
 ステップ721:ファームウェアは、OS障害回復プログラムベクタ(503)を読み込み、前記ベクタへジャンプする。 Step 721: The firmware reads the OS failure recovery program vector (503) and jumps to the vector.
 ステップ722:OS障害回復プログラム(203)が処理を引き継ぐ。OS障害回復プログラム(203)の動作については、「安定状態」保存処理について説明した後に説明する。 Step 722: The OS failure recovery program (203) takes over the processing. The operation of the OS failure recovery program (203) will be described after the “stable state” saving process is described.
 ステップ723:シャットダウン完了フラグ(501)の値は、0x00、0xEE、0xFF以外は不正な値である。このため、障害処理に入る。まず、ファームウェアは、I/Oバスを初期化する。 Step 723: The value of the shutdown completion flag (501) is invalid except for 0x00, 0xEE, and 0xFF. For this reason, the fault processing is started. First, the firmware initializes the I / O bus.
 ステップ724:ファームウェアは、VGA(Video Graphics Array)デバイス(図示せず)の初期化を行う。 Step 724: The firmware initializes a VGA (Video Graphics Array) device (not shown).
 ステップ725:ファームウェアは、コンソールにエラーを表示する。 Step 725: The firmware displays an error on the console.
 ところで、「安定状態」を、図10及び図11を用いて説明する。 By the way, the “stable state” will be described with reference to FIGS.
 図10及び11は、不揮発主記憶(102)の分割された領域n(110)(111)を表現している。不揮発主記憶(102)には、OS(117)のファイルシステム層(801)とデバイスドライバ層(802)がある。 FIGS. 10 and 11 represent divided areas n (110) (111) of the nonvolatile main memory (102). The nonvolatile main memory (102) includes a file system layer (801) and a device driver layer (802) of the OS (117).
 ファイルシステム層(801)は、デバイスドライバ送信待ちキュー(803)を持つ。ファイルシステム層(801)は、不揮発主記憶(102)の内容を、スワップアウト、アプリケーションからの明示的な指示及びユーザからの指示のいずれかの契機で、二次記憶(106)に書き出す。実際の書き出し動作は、デバイスドライバ(202)が担当する。デバイスドライバ送信待ちキュー(803)は、ファイルシステム層(801)がデバイスドライバ(202)にデータ書き出しを依頼するための待ち行列である。図10及び11では、cmd4(810)とcmd5(811)がデバイスドライバ送信待ちキュー(803)に登録されている。 The file system layer (801) has a device driver transmission queue (803). The file system layer (801) writes the contents of the nonvolatile main memory (102) to the secondary storage (106) in response to any one of swap-out, an explicit instruction from the application, and an instruction from the user. The device driver (202) takes charge of the actual writing operation. The device driver transmission queue (803) is a queue for the file system layer (801) to request the device driver (202) to write data. 10 and 11, cmd4 (810) and cmd5 (811) are registered in the device driver transmission waiting queue (803).
 デバイスドライバ層(802)は、コマンド送信待ちキュー(804)とコマンド完了待ちキュー(805)がある。コマンド送信待ちキュー(804)にはcmd2(808)、cmd3(809)が登録されている。図11では、コマンド完了待ちキュー(805)は空であるため、「安定状態」であるといえる。 The device driver layer (802) has a command transmission waiting queue (804) and a command completion waiting queue (805). Cmd2 (808) and cmd3 (809) are registered in the command transmission queue (804). In FIG. 11, since the command completion waiting queue (805) is empty, it can be said to be in a “stable state”.
 図10では、二次記憶(106)が、cmd0(806)及びcmd1(807)の実行完了を報告している。この状態でOS(117)がcmd2(808)を二次記憶(106)に送信しなかった場合を考えてみる。この状態を図11に示す。 In FIG. 10, the secondary storage (106) reports the completion of execution of cmd0 (806) and cmd1 (807). Consider the case where the OS (117) did not send cmd2 (808) to the secondary storage (106) in this state. This state is shown in FIG.
 図11では、コマンド完了待ちキュー(805)は空である。当然、二次記憶(106)のコマンド実行中キュー(実行中のコマンドが格納されるキュー)(812)も空である。したがって、不揮発主記憶(102)の状態と二次記憶(106)の状態は一致している。この状態で停電が発生しても、計算機システム(100)は運転再開可能である。なぜなら、OS(117)と二次記憶(106)の状態は停電後の再起動時にも一致しているからである。その結果、OS(117)は、二次記憶(106)からコマンド実行完了報告を待つ必要はない。 In FIG. 11, the command completion queue (805) is empty. Naturally, the command execution queue (queue storing the command being executed) (812) in the secondary storage (106) is also empty. Therefore, the state of the nonvolatile main memory (102) and the state of the secondary memory (106) are the same. Even if a power failure occurs in this state, the computer system (100) can resume operation. This is because the states of the OS (117) and the secondary storage (106) are the same even when restarting after a power failure. As a result, the OS (117) does not need to wait for a command execution completion report from the secondary storage (106).
 以上のことから、「安定状態」とは、周辺装置(本実施例では二次記憶(106))に送信したいずれのコマンドも仕掛り中に無い状態であること、言い換えれば、周辺装置に送信した全てのコマンドが完了している状態と定義することができる。 From the above, the “stable state” means that any command transmitted to the peripheral device (secondary storage (106) in this embodiment) is not in progress, in other words, transmitted to the peripheral device. It can be defined as the state where all the completed commands are completed.
 次に、「安定状態」の保存の方法について説明する。図11は「安定状態」を表現していることはすでに説明した。「安定状態」の保存方法は複数ある。以下、それぞれの方法を説明していく。 Next, a method for storing the “stable state” will be described. It has already been explained that FIG. 11 represents the “stable state”. There are multiple ways to store the “stable state”. Each method will be described below.
 図12及び図13を用いて、「安定状態」の保存方法の一つを説明する。 Using Fig. 12 and Fig. 13, one of the methods for storing the "stable state" will be described.
 図12に示すように、OS(117)は、「安定状態」を保存する際に、cmd2(808)及びcmd3(809)をコマンド送信待ちキュー(804)から取り出し、cmd2(808)及びcmd3(809)をデバイスドライバ送信待ちキュー(803)に登録する。そして、計算機システム(100)の状態は、図13に示す状態に遷移する。図13に示す状態は、デバイスドライバ層(802)が初期化されたことと同義であるため、OS障害回復プログラム(203)の設計が容易であるという面がある。 As shown in FIG. 12, the OS (117) retrieves the cmd2 (808) and cmd3 (809) from the command transmission queue (804) and saves the cmd2 (808) and cmd3 ( 809) is registered in the device driver transmission waiting queue (803). Then, the state of the computer system (100) transitions to the state shown in FIG. Since the state shown in FIG. 13 is synonymous with the initialization of the device driver layer (802), there is an aspect that the design of the OS failure recovery program (203) is easy.
 また、図11は、HBA(107)の仕様次第では「安定状態」を表現していない可能性も存在する。これまでは、OS(117)が能動的にコマンド送信待ちキュー(804)からコマンドを取り出して(HBA(107)を経由して)、二次記憶(106)にコマンドを送信するという前提で説明してきた。しかし、不揮発主記憶(102)内のコマンド送信待ちキュー(804)からコマンドを取り出して、二次記憶(106)にコマンドを送信するHBAもある。この場合、図12で説明した方法、すなわち、OS(117)がコマンド送信待ちキュー(804)からコマンドを取り出して当該コマンドをデバイスドライバ送信待ちキュー(803)に登録する方法が、「安定状態」を保存することを意味する。このように、図12の方法は、HBAの種類に依存しないで「安定状態」を保存できる方法であるといえる。 Also, there is a possibility that FIG. 11 does not represent the “stable state” depending on the specifications of the HBA (107). Until now, the explanation is based on the assumption that the OS (117) actively retrieves the command from the command transmission queue (804) (via the HBA (107)) and sends the command to the secondary storage (106). I have done it. However, there is also an HBA that takes out a command from the command transmission queue (804) in the nonvolatile main memory (102) and transmits the command to the secondary storage (106). In this case, the method described in FIG. 12, that is, the method in which the OS (117) extracts a command from the command transmission queue (804) and registers the command in the device driver transmission queue (803) is “stable state”. Means to save. Thus, the method of FIG. 12 can be said to be a method capable of storing the “stable state” without depending on the type of HBA.
 また、「安定状態」の保存方法には別の方法がある。それを、図14及び図15を用いて説明する。 In addition, there is another method for storing the “stable state”. This will be described with reference to FIG. 14 and FIG.
 図14では、デバイスドライバ層(802)にコマンド退避キュー(1401)が存在する。OS(117)は、「安定状態」を保存する際に、コマンド送信待ちキュー(804)に登録されていたコマンドをコマンド退避キュー(1401)に退避する。このことによって、図15のように、コマンド送信待ちキュー(804)にコマンドが1つも登録されていないので、HBA(107)は二次記憶(106)にコマンドを送信せず、計算機システム(100)の状態が「安定状態」となる。 In FIG. 14, the command save queue (1401) exists in the device driver layer (802). When saving the “stable state”, the OS (117) saves the command registered in the command transmission queue (804) to the command save queue (1401). As a result, as shown in FIG. 15, since no command is registered in the command transmission queue (804), the HBA (107) does not transmit the command to the secondary storage (106), and the computer system (100 ) Is the “stable state”.
 本方法によれば、図12の方法と退避先が異なる。図14の方法では、設計変更箇所がデバイスドライバ(202)内に閉じているため、実現が容易であるといえる。 に よ According to this method, the save destination is different from the method of FIG. In the method of FIG. 14, the design change part is closed in the device driver (202), so that it can be said that it is easy to realize.
 さて、これまで、「安定状態」の保存方法について説明してきた。次に、「安定状態」保存処理の開始の契機について説明する。 So far, we have described how to store the “stable state”. Next, the trigger for starting the “stable state” saving process will be described.
 「安定状態」保存処理の開始の契機としては、複数種類の契機がある。たとえば、定期的、ユーザからの指示を受けたとき、及び、コマンド完了待ちキュー(805)の状態が所定の状態になったときのいずれかの契機がある。「コマンド完了待ちキュー(805)の状態が所定の状態になったとき」とは、例えば、「不安定状態」が検出されたときか、或いは、「安定状態」が検出されたときである。「不安定状態」とは、「安定状態」ではない状態のことである。 There are multiple types of triggers for starting the “stable state” saving process. For example, there is an opportunity either periodically when receiving an instruction from the user, or when the state of the command completion waiting queue (805) becomes a predetermined state. “When the state of the command completion waiting queue (805) becomes a predetermined state” is, for example, when “unstable state” is detected or when “stable state” is detected. An “unstable state” is a state that is not a “stable state”.
 図16に、「不安定状態」が検出されたときに「安定状態」を保存することを示す。 Fig. 16 shows that "stable state" is stored when "unstable state" is detected.
 図面の左から右への方向が時間の経過を表している。太線(1601)は、計算機システム(100)が「不安定状態」にあることを示している。太線(1062)は、計算機システム(100)が「安定状態」にあることを示している。 The direction from the left to the right of the drawing represents the passage of time. A thick line (1601) indicates that the computer system (100) is in an “unstable state”. A thick line (1062) indicates that the computer system (100) is in a “stable state”.
 はじめは、コマンド完了待ちキュー(805)にコマンドcmd1(1603)、cmd2(1604)及びcmd3(1605)が登録されている。次に、cmd1(1603)は完了し、コマンド完了待ちキュー(805)にコマンドcmd2(1604)及びcmd3(1605)が登録されている状態に遷移する。さらに、cmd2(1604)及びcmd3(1605)の処理が完了し、コマンド完了待ちキュー(805)が空になって、計算機システム(100)は「安定状態」に遷移する(OS(117)が「安定状態」を検出する)。 First, commands cmd1 (1603), cmd2 (1604), and cmd3 (1605) are registered in the command completion waiting queue (805). Next, cmd1 (1603) is completed, and a transition is made to the state in which commands cmd2 (1604) and cmd3 (1605) are registered in the command completion queue (805). Further, the processing of cmd2 (1604) and cmd3 (1605) is completed, the command completion waiting queue (805) is emptied, and the computer system (100) transitions to the “stable state” (OS (117) is “ Detect stable state).
 しかし、OS(117)は、「安定状態」を保存せず、そのまま運転を続行する。 However, OS (117) does not save the “stable state” and continues operation.
 そして、コマンド完了待ちキュー(1606)にcmd4(1605)が登録されるイベントを契機として、OS(117)は、「安定状態」を保存する。つまり、OS(117)は、「不安定状態」を検出したときに、「安定状態」を保存する。 And the OS (117) saves the “stable state” triggered by the event that cmd4 (1605) is registered in the command completion waiting queue (1606). That is, the OS (117) stores the “stable state” when it detects the “unstable state”.
 この契機で保存された「安定状態」は、図17に示す契機(「安定状態」が検出されたとき)に保存された「安定状態」よりも近い過去の状態である。そのため、図17のケースよりも障害回復時間が短くて済む。しかし、「不安定状態」を検出したという契機で「安定状態」を保存するためには、OS(117)は、自らの状態を認識せねばならない。そのため、OS(117)は、システム状態変数(207)を使って「安定状態」であるか「不安定状態」であるかを識別しなければならない。また、「安定状態」から「不安定状態」への遷移を「検出」する別の方法として、OS(117)の一部であるデバイスドライバ(図示せず)が二次記憶(106)にコマンドを送信する前にコマンド完了待ちキュー(1606)が空であるかどうかをチェックする方法がある。 The “stable state” stored at this opportunity is a past state closer to the “stable state” stored at the opportunity shown in FIG. 17 (when the “stable state” is detected). Therefore, the failure recovery time is shorter than in the case of FIG. However, in order to save the “stable state” when the “unstable state” is detected, the OS (117) must recognize its own state. Therefore, the OS (117) must identify whether it is “stable state” or “unstable state” using the system state variable (207). In addition, as another method of “detecting” the transition from “stable state” to “unstable state”, a device driver (not shown) that is part of the OS (117) sends a command to the secondary storage (106). There is a method of checking whether the command completion waiting queue (1606) is empty before sending.
 一方、図17は、コマンド完了待ちキュー(805)が空になったことを契機に「安定状態」を保存すること、つまり、「安定状態」が検出されたときに「安定状態」を保存することを示す。 On the other hand, FIG. 17 shows that “stable state” is saved when the command completion waiting queue (805) becomes empty, that is, “stable state” is saved when “stable state” is detected. It shows that.
 この契機で保存された「安定状態」は、図16に示した契機で保存された「安定状態」よりも遠い過去の状態である。そのため、図16のケースよりも障害回復時間が長くなる。しかし、OS(117)は自らの状態を認識する必要がないため、システム状態変数(207)が不要である。また、OS(117)が「安定状態」への遷移を検出する別の方法として、OS(117)の一部であるデバイスドライバ(802)が、二次記憶(106)からのコマンド完了報告を受信したときに、コマンド完了待ちキュー(1606)が空になったか否かをチェックする方法もある。 The “stable state” stored at this opportunity is a past state farther than the “stable state” stored at the opportunity shown in FIG. Therefore, the failure recovery time is longer than in the case of FIG. However, since the OS (117) does not need to recognize its own state, the system state variable (207) is unnecessary. As another method for detecting the transition to the `` stable state '' by the OS (117), the device driver (802) that is a part of the OS (117) reports a command completion report from the secondary storage (106). There is also a method of checking whether or not the command completion waiting queue (1606) is empty when it is received.
 以上、「安定状態」保存処理の開始の契機について説明してきた。次に、「安定状態」保存処理について、図18~図21を用いて説明する。複数の「安定状態」保存処理がある。 So far, the trigger for starting the “stable state” storage process has been described. Next, the “stable state” storage process will be described with reference to FIGS. There are multiple “stable state” save processes.
 図18は、計算機システム(100)が起動してから初めて「安定状態」を保存する処理のフローチャートである。 FIG. 18 is a flowchart of processing for storing the “stable state” for the first time after the computer system (100) is started.
 ステップ(1801): 「安定状態」保存処理の開始である。この処理の開始の契機としては前述の通り複数種類の契機が存在するが、その中のどれでもよいことはいうまでもない。 Step (1801): “Stable state” storage process starts. As described above, there are a plurality of types of triggers for starting this process, but it goes without saying that any of them may be used.
 ステップ(1802):OS(117)が、新たなコマンドを二次記憶(106)に送信しないようにする。 Step (1802): The OS (117) does not send a new command to the secondary storage (106).
 ステップ(1803): OS(117)が、完了待ちのコマンドがないか、チェックする。「安定状態」保存処理の開始の契機が、ユーザ指示或いは定期的であれば、このステップは必要であるが、図16及び図17で説明した契機では、このステップは無くても良い。 Step (1803): The OS (117) checks whether there is a command waiting for completion. This step is necessary if the start of the “stable state” storage process is a user instruction or periodic, but this step may not be required for the trigger described in FIGS. 16 and 17.
 ステップ(1804): OS(117)が、回復スタックポインタ(206)を保存する。これは、「安定状態」保存処理の開始直前の状態(コンテキスト)を、OS障害回復処理プログラム(203)が認識できる所定のアドレスに保存することを意味する。ちなみに、「コンテキスト」とは、プロセスの状態(例えばプログラムが何行目まで走行しているのか)を示す情報を含む。現代のほとんどのOS(117)は1つのプログラムを数ミリ秒実行すると、前記プログラムの実行を中断し、他のプログラムを実行する。この動作は、人間からみるとあたかも複数のプログラムが同時並行して実行されているように見える。これを「マルチタスク」という。したがって、OS(117)は、1つのプログラムを数ミリ秒実行して、他のプログラムを実行する際に前者のプログラムの実行を再開するために必要な情報(プログラムが何行目まで走行したか、演算対象のデータなど)を不揮発主記憶(102)に保存する。これをコンテキストという。そして、OS(117)が1つのプログラムの実行を中断し、別のプログラムを実行し始めることを「コンテキストスイッチ」という。 Step (1804): The OS (117) saves the recovery stack pointer (206). This means that the state (context) immediately before the start of the “stable state” saving process is saved at a predetermined address that can be recognized by the OS failure recovery processing program (203). Incidentally, the “context” includes information indicating the state of the process (for example, how many lines the program is running). Most modern operating systems (117) execute one program for a few milliseconds, interrupt the execution of the program, and execute another program. From the human point of view, this operation looks as if multiple programs are being executed in parallel. This is called “multitasking”. Therefore, the OS (117) executes one program for several milliseconds, and when executing another program, information necessary to resume execution of the former program (how many lines the program has run to) , Data to be calculated) is stored in the nonvolatile main memory (102). This is called context. When the OS (117) interrupts execution of one program and starts to execute another program, it is called “context switch”.
 ステップ(1805):OS(117)がCPU(101)のキャッシュをフラッシュする。本実施例では、CPU(101)は揮発である。そのため、計算機システム(100)の状態を保存するには、CPU(101)のキャッシュをフラッシュし、不揮発主記憶(102)に保存することが必要である。 Step (1805): The OS (117) flushes the CPU (101) cache. In this embodiment, the CPU (101) is volatile. Therefore, in order to save the state of the computer system (100), it is necessary to flush the cache of the CPU (101) and save it in the nonvolatile main memory (102).
 ステップ(1806):OS(117)は、I/Oコントローラ(103)の安定領域レジスタ(404)に”1”を設定する。これは領域1に「安定領域」が保存されていることを示す。 Step (1806): The OS (117) sets “1” to the stable region register (404) of the I / O controller (103). This indicates that “stable region” is stored in region 1.
 ステップ(1807):OS(117)は、ファームウェア格納メモリ(104)内のOS障害回復プログラムベクタ(503)に、OS障害回復プログラム(203)の命令アドレスを書き込む。 Step (1807): The OS (117) writes the instruction address of the OS failure recovery program (203) into the OS failure recovery program vector (503) in the firmware storage memory (104).
 ステップ(1808):OS(117)は、動作モードレジスタに”0”を設定する。これにより、I/Oコントローラ(103)は、「安定状態」が保存されている領域1(110)を書き換えなくなる。 Step (1808): The OS (117) sets “0” in the operation mode register. This prevents the I / O controller (103) from rewriting the area 1 (110) in which the “stable state” is stored.
 ステップ(1809):OS(117)は、アクティブ領域レジスタに”2”を設定する。これにより、OS(117)は領域2(111)のみを使う。 Step (1809): The OS (117) sets “2” in the active area register. As a result, the OS (117) uses only the area 2 (111).
 ステップ(1810):OS(117)は、安定領域番号フラグ(502)を”1”を設定する。 Step (1810): The OS (117) sets the stable region number flag (502) to “1”.
 ステップ(1811):OS(117)は、シャットダウン完了フラグ(501)に0xEEを設定する。 Step (1811): The OS (117) sets 0xEE to the shutdown completion flag (501).
 ステップ(1812):OS(117)が二次記憶(106)に送信したコマンドに対して、二次記憶(106)の応答が規定時間内に送信されることを、OS(117)が判断する。規定時間内に二次記憶(106)の応答が来なかった場合、OS(117)は障害処理を実行する。たとえば、同一コマンドを再度送信するなどである。上記規定時間に達していない場合には、OS(117)は二次記憶(106)の応答を待つ。 Step (1812): The OS (117) determines that the response of the secondary storage (106) is transmitted within a specified time in response to the command transmitted by the OS (117) to the secondary storage (106). . When the response of the secondary storage (106) does not come within the specified time, the OS (117) executes failure processing. For example, the same command is transmitted again. If the specified time has not been reached, the OS (117) waits for a response from the secondary storage (106).
 ステップ(1814):処理が終了する。 Step (1814): The process ends.
 初めての「安定状態」保存処理の開始前までは、領域1及び領域2の両方が「アクティブ領域」として使用されてきたが、この処理の終了後は、領域1が「安定領域」となり、領域2が「アクティブ領域」とされる。つまり、領域1には、最新のコンテキスト等のデータが格納されなくなる。 Until the start of the first "stable state" saving process, both area 1 and area 2 have been used as "active areas", but after this process ends, area 1 becomes a "stable area" 2 is an “active area”. That is, data such as the latest context is not stored in the area 1.
 図19は、すでに「安定状態」が保存されている場合に再度「安定状態」を保存する処理のフローチャートである。なお、以下の説明では、ステップ(x)がステップ(y)の処理と同じである場合には、「ステップ(x)=ステップ(y)」と略記することにする。 FIG. 19 is a flowchart of processing for storing the “stable state” again when the “stable state” has already been stored. In the following description, when step (x) is the same as step (y), it is abbreviated as “step (x) = step (y)”.
 ステップ(1901)=ステップ(1801)、ステップ(1902)=ステップ(1802)、ステップ(1903)=ステップ(1803)、ステップ(1904)=ステップ(1804)、及び、ステップ(1905)=ステップ(1805)である。 Step (1901) = Step (1801), Step (1902) = Step (1802), Step (1903) = Step (1803), Step (1904) = Step (1804), and Step (1905) = Step (1805) ).
 ステップ(1906):OS(117)が、現時点のアクティブ領域の内容(例えば領域2に記憶されている全てのデータ)を安定領域(例えば領域1)にコピーする。このコピーは、CPU(101)が行っても良いが、I/Oコントローラ(103)に内蔵されたデータ転送エンジン部(307)が行うことが好ましい。データ転送エンジン部(307)は、いわゆるDMA(Direct Memory Access)エンジンである。OS(117)は、転送元のアドレスと転送先のアドレスと転送サイズとをデータ転送エンジン部(307)に指示する(図示せず)。データ転送エンジン部(307)が、指示された転送元アドレスから指示された転送先アドレスへ、指示された転送サイズ分のデータをコピーする。これにより、ソフトウェアがコピーを行うことに比べて、高速に不揮発主記憶(102)内のデータコピーが可能となる。 Step (1906): The OS (117) copies the contents of the current active area (for example, all data stored in the area 2) to the stable area (for example, the area 1). This copying may be performed by the CPU (101), but is preferably performed by the data transfer engine unit (307) built in the I / O controller (103). The data transfer engine unit (307) is a so-called DMA (Direct Memory Access) engine. The OS (117) instructs the data transfer engine unit (307) about the transfer source address, the transfer destination address, and the transfer size (not shown). The data transfer engine unit (307) copies data for the designated transfer size from the designated transfer source address to the designated transfer destination address. As a result, the data in the nonvolatile main memory (102) can be copied at a higher speed than when the software performs copying.
 ステップ(1907):OS(117)は、安定領域の番号を安定領域レジスタ(404)に設定する。安定領域が不変であれば、本処理は必要ない。 Step (1907): The OS (117) sets the stable area number in the stable area register (404). If the stable region is unchanged, this processing is not necessary.
 ステップ(1908)=ステップ(1807)、及び、ステップ(1909)=ステップ(1808)である。 Step (1908) = Step (1807) and Step (1909) = Step (1808).
 ステップ(1910): OS(117)は、アクティブ領域の番号をアクティブ領域レジスタ(402)に設定する。アクティブ領域が不変であれば、本処理は必要ない。 Step (1910): The OS (117) sets the active area number in the active area register (402). If the active area is unchanged, this process is not necessary.
 ステップ(1912)=ステップ(1811)、ステップ(1913)=ステップ(1812)、及び、ステップ(1914)=ステップ(1813)である。そして、ステップ(1915)で処理が終了する。 Step (1912) = Step (1811), Step (1913) = Step (1812), and Step (1914) = Step (1813). Then, the process ends at step (1915).
 次に、図12及び図13に対応する「安定状態」の保存処理のフローチャートを、図20に示す。図20は、計算機システム(100)が起動してから初めて「安定状態」を保存する処理を示す。 Next, FIG. 20 shows a flowchart of the “stable state” saving process corresponding to FIG. 12 and FIG. FIG. 20 shows a process of storing the “stable state” for the first time after the computer system (100) is activated.
 ステップ(2001)=ステップ(1801)である。 Step (2001) = Step (1801).
 ステップ(2002):OS(117)は、コマンド送信待ちキュー(804)にあるコマンドをデバイスドライバ送信待ちキュー(803)に移動させる。 Step (2002): The OS (117) moves the command in the command transmission waiting queue (804) to the device driver transmission waiting queue (803).
 この後は、図18のステップ(1803)以降と同様の処理が行われる。すなわち、ステップ(2003)=ステップ(1803)、ステップ(2004)=ステップ(1804)、ステップ(2005)=ステップ(1805)、ステップ(2006)=ステップ(1806)、ステップ(2007)=ステップ(1807)、ステップ(2008) =ステップ(1808)、ステップ(2009) =ステップ(1809)、ステップ(2010) =ステップ(1810)、ステップ(2011) =ステップ(1811)、ステップ(2012) =ステップ(1812)、及び、ステップ(2013) =ステップ(1813)である。そして、ステップ(2014)で処理が終了する。 Thereafter, the same processing as that after step (1803) in FIG. 18 is performed. Step (2003) = Step (1803), Step (2004) = Step (1804), Step (2005) = Step (1805), Step (2006) = Step (1806), Step (2007) = Step (1807) ), Step (2008) = Step (1808), Step (2009) = Step (1809), Step (2010) = Step (1810), Step (2011) = Step (1811), Step (2012) = Step (1812) ) And step (2013) = step (1813). Then, the process ends at step (2014).
 図21は、すでに「安定状態」が保存されている場合に再度「安定状態」を保存する処理のフローチャートである。 FIG. 21 is a flowchart of processing for storing the “stable state” again when the “stable state” has already been stored.
 ステップ(2101)=ステップ(1901)、ステップ(2102) =ステップ(2002)、ステップ(2103) =ステップ(1903)、ステップ(2104) =ステップ(1904)、ステップ(2105) =ステップ(1905)、ステップ(2106) =ステップ(1906)、ステップ(2107) =ステップ(1907)、ステップ(2108) =ステップ(1908)、ステップ(2109) =ステップ(1909)、ステップ(2110) =ステップ(1910)、ステップ(2111) =ステップ(1911)、ステップ(2112) =ステップ(1912)、ステップ(2113) =ステップ(1913)、及び、ステップ(2114) =ステップ(1914)である。そして、ステップ(2115)で 処理が終了する。 Step (2101) = Step (1901), Step (2102) = Step (2002), Step (2103) = Step (1903), Step (2104) = Step (1904), Step (2105) = Step (1905), Step (2106) = Step (1906), Step (2107) = Step (1907), Step (2108) = Step (1908), Step (2109) = Step (1909), Step (2110) = Step (1910), Step (2111) = Step (1911), Step (2112) = Step (1912), Step (2113) = Step (1913), and Step (2114) = Step (1914). Then, the wrinkle process ends at step (2115).
 次に、停電が発生した後に、「安定状態」から再起動する処理を説明する。 Next, the process of restarting from the “stable state” after a power failure occurs will be described.
 図22は、図12の「安定状態」保存処理が実行された後の再起動処理の概略を示す。 FIG. 22 shows an outline of the restart process after the “stable state” storage process of FIG. 12 is executed.
 OS(117)は、「安定状態」を生成するため、デバイスドライバ層(802)のコマンド送信待ちキュー(804)に登録されているコマンドcmd2(808)及びcmd3(809)を、ファイルシステム層(801)のデバイスドライバ送信待ちキュー(803)に登録している。そのため、デバイスドライバ層(802)は初期状態にあるため、再起動処理は初期化処理を再度実行するだけでよい。 The OS (117) generates commands cmd2 (808) and cmd3 (809) registered in the command transmission waiting queue (804) of the device driver layer (802) in order to generate a `` stable state ''. 801) is registered in the device driver transmission waiting queue (803). Therefore, since the device driver layer (802) is in the initial state, the restart process only needs to execute the initialization process again.
 一方、図23は、図14及び図15の「安定状態」保存処理が実行された後の再起動処理の概略を示す。 On the other hand, FIG. 23 shows an outline of the restart process after the “stable state” storage process of FIGS. 14 and 15 is executed.
 OS(117)は、コマンド退避キュー(808)に退避したcmd2(808)及びcmd3(809)をコマンド送信待ちキュー(804)に戻す。HBA(107)がコマンド送信待ちキュー(804)からコマンドを取得する仕様である場合には、さらにコマンド送信待ちキュー(804)の先頭ポインタをHBA(107)のレジスタ(図示せず)に書き込むことが必要である。なぜなら、未送信のコマンド群の先頭アドレスがコマンド送信待ちキュー(804)のどのアドレスかHBA(107)はわからないからである。 The OS (117) returns the cmd2 (808) and cmd3 (809) saved in the command save queue (808) to the command transmission queue (804). If the HBA (107) is a specification for acquiring a command from the command transmission queue (804), further write the head pointer of the command transmission queue (804) to the register (not shown) of the HBA (107). is required. This is because the HBA (107) does not know which address of the command transmission queue (804) is the head address of the command group not yet transmitted.
 図11を用いて説明した「安定状態」保存処理では、デバイスドライバの初期化は、HBA(107)の初期設定のみでよい。HBA(107)がコマンド送信待ちキュー(804)からコマンドを取得する仕様である場合には、さらにコマンド送信待ちキュー(804)の先頭ポインタをHBA(107)のレジスタ(図示せず)に書き込むことが必要である。 In the “stable state” saving process described with reference to FIG. 11, the initialization of the device driver may be only the initial setting of the HBA (107). If the HBA (107) is a specification for acquiring a command from the command transmission queue (804), further write the head pointer of the command transmission queue (804) to the register (not shown) of the HBA (107). is required.
 図24に「安定状態」からの再起動処理を示す。 Fig. 24 shows the restart process from the "stable state".
 ステップ(2401):処理が開始する。 Step (2401): Processing starts.
 ステップ(2402):OS障害回復プログラム(203)は、デバイスドライバリスト(204)を参照する。 Step (2402): The OS failure recovery program (203) refers to the device driver list (204).
 ステップ(2403): OS障害回復プログラム(203)は、デバイスドライバリスト(204)からデバイスごとのデバイス回復プログラム(205)の命令アドレスを知ることができる。そこで、OS障害回復プログラム(203)はHBA(107)、NIC(109)をはじめとするデバイスごとにデバイス回復プログラム(205)を実行する。 Step (2403): The OS failure recovery program (203) can know the instruction address of the device recovery program (205) for each device from the device driver list (204). Therefore, the OS failure recovery program (203) executes the device recovery program (205) for each device including the HBA (107) and the NIC (109).
 ステップ(2404):各デバイスの回復処理が終了すると、OS障害回復プログラム(203)は、「安定状態」に戻るため、OSスタックポインタ(206)へジャンプする。 Step (2404): When the recovery process of each device is completed, the OS failure recovery program (203) jumps to the OS stack pointer (206) to return to the “stable state”.
 ステップ(2405):OS(117)は、「安定状態」から運転を再開する。 Step (2405): The OS (117) restarts the operation from the “stable state”.
 次に、図25に、図14及び図15の「安定状態」保存処理を実行した場合のHBA(107)デバイス回復プログラムのフローチャートを示す。 Next, FIG. 25 shows a flowchart of the HBA (107) device recovery program when the “stable state” saving process of FIGS. 14 and 15 is executed.
 ステップ(2501): HBAデバイス回復プログラムが、OS障害回復プログラム(203)から呼び出される。 Step (2501): The HBA device recovery program is called from the OS failure recovery program (203).
 ステップ(2502):HBAデバイス回復プログラムは、コマンド送信待ちキュー(804)を復元する。すなわち、図15においてコマンド退避キュー(1401)に退避されたコマンド(図14及び図15に示したcmd2(808)及びcmd3(809))を、コマンド送信待ちキュー(804)に移動させる。 Step (2502): The HBA device recovery program restores the command transmission queue (804). That is, the commands (cmd2 (808) and cmd3 (809) shown in FIGS. 14 and 15) saved in the command save queue (1401) in FIG. 15 are moved to the command transmission queue (804).
 ステップ(2503):HBA障害回復プログラムは、HBA(107)のレジスタに初期値を設定する。 Step (2503): The HBA failure recovery program sets an initial value in the register of HBA (107).
 ステップ(2504):HBA(107)がコマンド送信待ちキュー(804)からコマンドを取り出し二次記憶(106)に送信する仕様の場合は、HBA回復プログラムは、コマンド送信待ちキュー(804)の未実行コマンドの先頭アドレスをHBAのレジスタ(図示せず)に設定する。 Step (2504): If the specification is that the HBA (107) retrieves the command from the command transmission queue (804) and sends it to the secondary storage (106), the HBA recovery program will not execute the command transmission queue (804). Set the start address of the command in the HBA register (not shown).
 ステップ(2505):HBA(107)の障害回復処理は終了し、CPU(101)の制御は、HBA障害回復プログラムからOS障害回復プログラム(203)に移る。 Step (2505): The failure recovery process of the HBA (107) is completed, and the control of the CPU (101) is transferred from the HBA failure recovery program to the OS failure recovery program (203).
 次に、図11及び図12を用いて説明した「安定状態」を保存した場合のHBA障害回復プログラムの動作を図26に示す。 Next, FIG. 26 shows the operation of the HBA failure recovery program when the “stable state” described with reference to FIGS. 11 and 12 is stored.
 ステップ(2601):OS障害回復プログラム(203)がHBA障害回復プログラムを呼び出す。 Step (2601): The OS failure recovery program (203) calls the HBA failure recovery program.
 ステップ(2602):HBA障害回復プログラムは、通常起動時と同じHBA初期化処理を実行する。図12を参照して説明した処理では、OS(117)は、コマンドをデバイスドライバ層(802)からファイルシステム層(801)に戻している。したがって、HBAデバイスドライバが使っている不揮発主記憶(102)は初期状態に戻っている。さらに、OS(117)のスケジュールに従って、ファイルシステム層(801)のデバイスドライバ送信待ちキュー(803)に登録されているコマンドは、デバイスドライバ層(802)に移される。そのため、HBA障害回復プログラムはHBA(107)の初期化のみを行えばよい。また、図11を参照して説明した処理では、OS(117)がコマンド送信待ちキュー(804)にあるコマンドをHBA(107)を経由して二次記憶(106)に送信する仕様であるため、HBA(107)の初期化が行われればよい。HBA(107)がコマンド送信待ちキュー(804)に登録されているコマンドを読み取り二次記憶(106)に送信する仕様であると、図11を用いて説明した「安定状態」保存処理を適用することができない。従って、この場合のHBA障害回復プログラムは存在しないことに注意すべきである。 Step (2602): The HBA failure recovery program executes the same HBA initialization process as during normal startup. In the processing described with reference to FIG. 12, the OS (117) returns the command from the device driver layer (802) to the file system layer (801). Therefore, the nonvolatile main memory (102) used by the HBA device driver is returned to the initial state. Furthermore, according to the schedule of the OS (117), the command registered in the device driver transmission waiting queue (803) of the file system layer (801) is moved to the device driver layer (802). Therefore, the HBA failure recovery program only needs to initialize the HBA (107). In addition, the processing described with reference to FIG. 11 is a specification in which the OS (117) transmits a command in the command transmission queue (804) to the secondary storage (106) via the HBA (107). The HBA (107) may be initialized. If the HBA (107) reads the command registered in the command transmission queue (804) and sends it to the secondary storage (106), the "stable state" saving process described with reference to FIG. 11 is applied. I can't. Therefore, it should be noted that there is no HBA failure recovery program in this case.
 ステップ(2603): HBA(107)の障害回復処理は終了し、CPU(101)の制御は、HBA障害回復プログラムからOS障害回復プログラム(203)に移る。 Step (2603): The failure recovery process of the HBA (107) is finished, and the control of the CPU (101) is transferred from the HBA failure recovery program to the OS failure recovery program (203).
 これまで障害回復プログラム(203)の動作を説明してきたが、トランザクション処理の用語でいう「ジャーナリング」が自然に実現されていることに注意すべきである。図23の例でいうと、「安定状態」からOS(117)が運転を再開すると、OS(117)はコマンドcmd1(807)を二次記憶(106)に送信する。その後、停電が発生すると、計算機システム(100)は「安定状態」に復帰する。そのとき、OS(117)が二次記憶(106)に送信したコマンドcmd1(807)は、コマンド送信待ちキュー(807)に登録された状態に戻されている。そして、OS(117)は再度、コマンドcmd1(807)を二次記憶(106)に送信を再開する。このように、従来のジャーナリング方法と違って、余計なリソースが不要である点が本実施例の一つの特長である。さらに、従来のトランザクション処理技術では、二次記憶(106)へのコマンド送信の履歴であるジャーナルファイルをOS(117)が二次記憶(106)に保存する。しかし、本実施例では、OS(117)はジャーナルファイルの対応物を不揮発主記憶(102)に保存する。したがって、ジャーナリングによるオーバーヘッドが小さいことも本実施例の一つの特長である。 So far, the operation of the fault recovery program (203) has been described, but it should be noted that the “journaling” in terms of transaction processing is naturally realized. In the example of FIG. 23, when the OS (117) resumes operation from the “stable state”, the OS (117) transmits a command cmd1 (807) to the secondary storage (106). Thereafter, when a power failure occurs, the computer system (100) returns to the “stable state”. At this time, the command cmd1 (807) transmitted from the OS (117) to the secondary storage (106) is returned to the state registered in the command transmission queue (807). Then, the OS (117) resumes transmission of the command cmd1 (807) to the secondary storage (106). Thus, unlike the conventional journaling method, one of the features of this embodiment is that no extra resources are required. Further, in the conventional transaction processing technique, the OS (117) stores a journal file, which is a history of command transmission to the secondary storage (106), in the secondary storage (106). However, in this embodiment, the OS (117) stores the corresponding journal file in the nonvolatile main memory (102). Therefore, a small overhead due to journaling is also a feature of this embodiment.
 これまで、計算機システム(100)の「安定状態」の保存処理及び回復処理を二次記憶(106)と不揮発主記憶(102)との関係という観点から説明してきた。さらに、NIC(109)あるいはLAN(108)の観点からも説明が必要である。一般にLAN(108)の通信がいつとぎれても、計算機システム(100)(すなわちOS(117))は運転継続可能である。これは、LAN(108)の通信が状態を持たない性質による(TCPプロトコル層では状態を持っているが、さらに上位層からみれば状態がないようにみえる)。したがって「安定状態」を保存する必要はない。そして、NIC(109)回復処理は、NIC(109)の初期化やOS(117)のTCP/IPスタックを初期化するだけでよい。 So far, the “stable state” storage processing and recovery processing of the computer system (100) has been described from the viewpoint of the relationship between the secondary memory (106) and the nonvolatile main memory (102). Further, it is necessary to explain from the viewpoint of NIC (109) or LAN (108). In general, the computer system (100) (that is, the OS (117)) can continue operation even when the communication of the LAN (108) is interrupted. This is because the communication of the LAN (108) has no state (it has a state in the TCP protocol layer but does not seem to have a state from the upper layer). Therefore, it is not necessary to save the “stable state”. The NIC (109) recovery process only needs to initialize the NIC (109) or the TCP / IP stack of the OS (117).
 しかし、計算機システム(100)がファイルサーバとして機能している場合には、若干の注意が必要である。そこで、図27に計算機システム(100)がファイルサーバとなっているときのLAN(109)通信の模式図を示す。不揮発主記憶
(102)には、NFS(Network File System)層(2701)とTCP/IP層(2702)がある。計算機システムの外部には、LAN(108)で接続されたクライアント(2703)がある。TCP/IP層(2702)には、TCP/IP層受信キュー(2704)がある。図27では、TCP/IP層送受信キュー(2704)にはクライアント(2703)が送信したコマンドcmd4(2705)とデータ”dat4”(2706)が登録されている。また、TCP/IP層(2702)には、TCP/IP送信キュー(2711)がある。図27ではコマンド完了報告メッセージcmp2(2712)が登録されている。TCP/IP層(2702)の上位層であるNFS層(2701)にはNFS層受信キュー(2707)がある。図27では、コマンドcmd3(2708)が登録されている。さらに、NFS層(2701)には、NFS受信完了キュー(2709)がある。これはNFS層(2701)において、処理が完了したコマンドを登録するためのキューである。たとえば、クライアント(2703)が計算機システム(100)にライトコマンドを送信した場合、計算機システム(100)は不揮発主記憶(102)を持っているので、NFS層(2701)の受信が完了した時点でクライアント(2703)に書き込み完了報告を行うことができる。このようなNFS層(2701)の受信処理が完了したコマンドは、OS(117)によってNFS層受信完了キュー(2709)に登録される。図27では、コマンドcmd1(2714)とデータ(2715)が登録されている。また、計算機システム(100)は、クライアント(2703)に完了メッセージなどを送信するためのNFS層送信キュー(2710)を持つ。 最後に、図27は、OS(117)がコマンドcmd1(2714)の処理完了を示す完了メッセージcmp1(2713)がクライアント(2703)に到達した状態を示している。図27の状態で停電が発生した後、OS障害回復プログラム(203)はNFS層受信完了キュー(2709)を除く図27のすべてのキューを初期化する。一方、OS(117)は受信データdat1(2715)を必ず二次記憶(106)に書き込まねばならない。なぜなら、計算機システム(100)はすでにコマンドcmd1(2714)の正常終了をクライアント(2703)に報告しているからである。
However, when the computer system (100) functions as a file server, some care is required. FIG. 27 shows a schematic diagram of LAN (109) communication when the computer system (100) is a file server. Nonvolatile main memory
(102) includes an NFS (Network File System) layer (2701) and a TCP / IP layer (2702). Outside the computer system is a client (2703) connected via a LAN (108). The TCP / IP layer (2702) has a TCP / IP layer reception queue (2704). In FIG. 27, the command cmd4 (2705) and data “dat4” (2706) transmitted by the client (2703) are registered in the TCP / IP layer transmission / reception queue (2704). The TCP / IP layer (2702) has a TCP / IP transmission queue (2711). In FIG. 27, a command completion report message cmp2 (2712) is registered. The NFS layer (2701), which is an upper layer of the TCP / IP layer (2702), has an NFS layer reception queue (2707). In FIG. 27, the command cmd3 (2708) is registered. Further, the NFS layer (2701) has an NFS reception completion queue (2709). This is a queue for registering a command that has been processed in the NFS layer (2701). For example, when the client (2703) sends a write command to the computer system (100), the computer system (100) has a nonvolatile main memory (102), so when the reception of the NFS layer (2701) is completed. A write completion report can be sent to the client (2703). The command for which the reception process of the NFS layer (2701) is completed is registered in the NFS layer reception completion queue (2709) by the OS (117). In FIG. 27, command cmd1 (2714) and data (2715) are registered. The computer system (100) has an NFS layer transmission queue (2710) for transmitting a completion message and the like to the client (2703). Finally, FIG. 27 shows a state in which the completion message cmp1 (2713) indicating that the OS (117) has completed processing of the command cmd1 (2714) has reached the client (2703). After a power failure occurs in the state of FIG. 27, the OS failure recovery program (203) initializes all the queues of FIG. 27 except the NFS layer reception completion queue (2709). On the other hand, the OS (117) must always write the received data dat1 (2715) to the secondary storage (106). This is because the computer system (100) has already reported the normal end of the command cmd1 (2714) to the client (2703).
 以上の点を踏まえて、NFS層(2701)に関するOS障害回復プログラム(203)の処理を図28に示す。 Based on the above points, the processing of the OS failure recovery program (203) related to the NFS layer (2701) is shown in FIG.
 ステップ(2801):処理が開始する。 Step (2801): Processing starts.
 ステップ(2802):OS障害回復プログラム(203)は、NFS層受信完了キュー(2709)にコマンド、またはデータがないかチェックする。 Step (2802): The OS failure recovery program (203) checks whether there is a command or data in the NFS layer reception completion queue (2709).
 ステップ(2803): NFS層受信完了キュー(2709)にコマンド、またはデータが存在する場合には、OS障害回復プログラム(203)が、二次記憶(106)に当該データを書き込む。OS障害回復プログラム(203)が直接二次記憶(106)に書き込む必要はなく、ファイルシステム層(801)に当該データを二次記憶(106)へ書き込むように指示するだけでよい。ここでOS障害回復処理プログラム(203)の処理は終了し、次からはOS(117)が通常のNFS処理を実行する。 Step (2803): If a command or data exists in the NFS layer reception completion queue (2709), the OS failure recovery program (203) writes the data in the secondary storage (106). The OS failure recovery program (203) does not need to write directly to the secondary storage (106), but only instructs the file system layer (801) to write the data to the secondary storage (106). Here, the processing of the OS failure recovery processing program (203) is finished, and the OS (117) executes normal NFS processing from the next time.
 ステップ(2804):OS(117)がNFSコマンドを受信したかチェックする。NFSコマンドを受信していない場合には、そのまま監視を続ける。 Step (2804): Check whether the OS (117) has received the NFS command. If no NFS command is received, monitoring continues.
 ステップ(2805):OS(117)がNFSコマンドを受信した場合には、当該コマンドを実行しステップ(2804)に戻る。 Step (2805): When the OS (117) receives the NFS command, it executes the command and returns to step (2804).
 以上、図面に従って説明した通り、不揮発主記憶(102)に計算機システム(100)の「安定状態」を保存することによって、停電時の計算機システム(100)の一貫性を持った再起動が可能となる。二次記憶(106)にシステムの状態を保存する従来技術と比較して、本実施例の状態保存のオーバーヘッドは短く、通常運転時の性能劣化が小さい。さらに状態保存のオーバーヘッドが短いことで、本実施例を適用した計算機システムは短い間隔で状態を保存することができる。したがって、停電発生後に計算機システム(100)が再起動したときに、従来技術と比較して短い過去の計算機システム(100)の状態が保存されることが可能となる。言い換えると、トランザクション処理の用語でいう、ロールバック、ロールフォーワードに要する時間が短くなることを意味する。また、トランザクション処理におけるジャーナリング処理に必要な二次記憶(106)の領域およびCPUサイクルが実施例1では不要でありながら、ジャーナリングと等価な効果を持つことができる。 As described above according to the drawings, storing the `` stable state '' of the computer system (100) in the nonvolatile main memory (102) enables the computer system (100) to be restarted consistently during a power failure. Become. Compared with the conventional technique for storing the system state in the secondary storage (106), the state storage overhead of this embodiment is short and the performance degradation during normal operation is small. Furthermore, since the overhead of state storage is short, the computer system to which this embodiment is applied can store the state at short intervals. Therefore, when the computer system (100) is restarted after the occurrence of a power failure, it becomes possible to save the state of the computer system (100) in the past that is shorter than that of the prior art. In other words, it means that the time required for rollback and rollforward in terms of transaction processing is shortened. Further, the secondary storage (106) area and CPU cycle necessary for the journaling processing in the transaction processing are unnecessary in the first embodiment, but can have an effect equivalent to that of journaling.
 また、既に述べたが、実施例1では、不揮発主記憶(102)を2分割して、一方に「安定状態」を保存する方式を説明した。しかし、本発明の効果は2以上のすべての整数で不揮発主記憶(102)を分割した場合でもなんら影響を受けない。この場合、次のような動作が可能である。例えば、図45Aに示すように、不揮発主記憶(102)が3分割されている場合、OS(117)は、まず、領域1~3の全てに、データを格納する(つまり、領域1~3が全てアクティブ領域である)。次に、「安定状態」を保存する場合、図45Bに示すように、OS(117)は、アクティブ領域1~3のうちのいずれか1つの領域(例えば領域1)に「安定状態」を保存する(つまり、アクティブ領域1~3のうちの1つが安定領域となる)。その後、更に「安定状態」を保存する場合、図45Cに示すように、OS(117)は、アクティブ領域2~3のうちのいずれか1つの領域(例えば領域2)に「安定状態」を保存する(つまりアクティブ領域2~3のうちの1つが安定領域となる)。その後、また更に「安定状態」を保存する場合、図45Dに示すように、OS(117)は、I/Oコントローラ103に、現在のアクティブ領域の内容を他の2つの安定領域のいずれか1つにコピーさせる。 In addition, as described above, in the first embodiment, the method of dividing the nonvolatile main memory (102) into two and storing the “stable state” on one side has been described. However, the effect of the present invention is not affected even when the nonvolatile main memory (102) is divided by all integers of 2 or more. In this case, the following operation is possible. For example, as shown in FIG. 45A, when the nonvolatile main memory (102) is divided into three, the OS (117) first stores data in all the areas 1 to 3 (that is, the areas 1 to 3). Are all active areas). Next, when saving the “stable state”, as shown in FIG. 45B, the OS (117) saves the “stable state” in any one of the active areas 1 to 3 (for example, the area 1). (That is, one of the active areas 1 to 3 becomes a stable area). Thereafter, when further saving the “stable state”, as shown in FIG. 45C, the OS (117) saves the “stable state” in any one of the active areas 2 to 3 (for example, the area 2). (That is, one of the active areas 2 to 3 becomes a stable area). Thereafter, when the “stable state” is further stored, as shown in FIG. 45D, the OS (117) sends the contents of the current active area to one of the other two stable areas as shown in FIG. 45D. To copy.
 また、不揮発主記憶(102)のm分割された場合、m個の領域の全てが同じ容量であることが好ましいが、少なくとも1つの領域の容量は他の領域の容量と異なっていても良い。 Also, when the nonvolatile main memory (102) is divided into m, it is preferable that all m areas have the same capacity, but the capacity of at least one area may be different from the capacity of other areas.
 また、実施例1にて複数の「安定状態」保存処理を述べたが、それらのうちの二以上が組み合わされても良い。 In the first embodiment, a plurality of “stable state” storage processes are described, but two or more of them may be combined.
 また、OS(117)は、「不安定状態」を検出したときに「安定状態」を保存するか、「安定状態」を検出したときに「安定状態」を保存するかを選択的に採用することができる(つまり、図16を用いて説明した方法と図17を用いて説明した方法とのどちらを採用するかを動的に変更することができる)。たとえば、特定のファイルシステム、一例として、Linux(登録商標)の/procファイルシステムは、OS(117)内部の変数の値をユーザに読み書きさせるためのファイルシステムであり、/procファイルシステムに存在するOS(117)内部の変数の値を変更することによって、OS(117)の挙動を変えることができる。これを利用すれば、前記「安定状態」保存の契機を動作中に変更することができる。具体的な動作は以下の通りである。OS(117)に、「安定状態」を保存するタイミングを示す変数が組みこまれる。これを「タイミング変数」と呼ぶことにする。そして、「タイミング変数」が第1の値(例えば「0」)の場合は「安定状態」から「不安定状態」に遷移するときに、OS(117)は「安定状態」を保存する動作を行うことを意味するものとする。逆に、「タイミング変数」が第2の値(例えば「1」)の場合は、「安定状態」に遷移したときにOS(117)は「安定状態」を保存するものとする。そして、OS(117)は以下に述べる動作をするように設計されている。OS(117)は、コマンドを二次記憶(106)に送信するときに、「タイミング変数」を参照する。「タイミング変数」が第1の値(例えば「0」)ならば、OS(117)はコマンド完了待ちキュー(805)をチェックする。そして、コマンド完了待ちキュー(805)が空ならば、「安定状態」保存処理を開始する。コマンド完了待ちキュー(805)が空でないならば、OS(117)は何もしない。その後、OS(117)は前記コマンドを二次記憶(106)に送信する。一方、「タイミング変数」が第2の値(例えば「1」)ならば、何もせず次の処理を実行する。またOS(117)は,二次記憶(106)からのコマンド完了報告を受信した後、「タイミング変数」を参照する。「タイミング変数」が第2の値(例えば「1」)ならば、OS(117)はコマンド完了待ちキュー(805)をチェックする。前記受信したコマンド完了報告によって、コマンド完了待ちキュー(805)が空になっているならば、OS(117)は「安定状態」を保存する。コマンド完了待ちキュー(805)が空でないならば、何もせず次の処理に移る。一方、「タイミング変数」が第1の値(例えば「0」)ならば、OS(117)が二次記憶(106)からのコマンド完了報告を受信し、何もせず次の処理に移る。 In addition, OS (117) selectively adopts whether to save "stable state" when "unstable state" is detected or to save "stable state" when "stable state" is detected. (That is, the method described with reference to FIG. 16 or the method described with reference to FIG. 17 can be dynamically changed). For example, a specific file system, for example, the Linux (registered trademark) / proc file system is a file system that allows a user to read and write the values of variables in the OS (117), and exists in the / proc file system. The behavior of the OS (117) can be changed by changing the value of the variable inside the OS (117). If this is used, the trigger for storing the “stable state” can be changed during operation. The specific operation is as follows. The OS (117) incorporates a variable indicating the timing for saving the “stable state”. This is called a “timing variable”. When the “timing variable” is a first value (eg, “0”), the OS (117) saves the “stable state” when transitioning from the “stable state” to the “unstable state”. It means to do. Conversely, when the “timing variable” is the second value (for example, “1”), the OS (117) stores the “stable state” when transitioning to the “stable state”. The OS (117) is designed to operate as described below. The OS (117) refers to the “timing variable” when transmitting the command to the secondary storage (106). If the “timing variable” is the first value (eg, “0”), the OS (117) checks the command completion waiting queue (805). If the command completion waiting queue (805) is empty, the “stable state” saving process is started. If the command completion queue (805) is not empty, the OS (117) does nothing. Thereafter, the OS (117) transmits the command to the secondary storage (106). On the other hand, if the “timing variable” is the second value (eg, “1”), the next process is executed without doing anything. The OS (117) refers to the “timing variable” after receiving the command completion report from the secondary storage (106). If the “timing variable” is the second value (for example, “1”), the OS (117) checks the command completion waiting queue (805). If the command completion waiting queue (805) is empty according to the received command completion report, the OS (117) stores the “stable state”. If the command completion queue (805) is not empty, nothing is done and the process proceeds to the next process. On the other hand, if the “timing variable” is the first value (eg, “0”), the OS (117) receives the command completion report from the secondary storage (106), and proceeds to the next processing without doing anything.
 実施例1では、不揮発主記憶(102)を分割し、その1つの領域にOSが「安定状態」を保存する方式を説明した。実施例2では、不揮発主記憶(102)を分割しない実現例を説明する。その際、実施例1との相違点を主に説明し、実施例1との共通点については説明を省略或いは簡略する。 In the first embodiment, the method in which the nonvolatile main memory (102) is divided and the OS stores the “stable state” in the one area has been described. In the second embodiment, an implementation example in which the nonvolatile main memory (102) is not divided will be described. At this time, differences from the first embodiment will be mainly described, and description of common points with the first embodiment will be omitted or simplified.
 図29に、本発明の実施例2に係る計算機システム(2900)を示す。 FIG. 29 shows a computer system (2900) according to the second embodiment of the present invention.
 実施例1と異なる点は、I/Oコントローラ(2901)、ファームウェア格納用メモリ(104)内のフラグ領域(2902)、OS(2903)である。 The differences from the first embodiment are the I / O controller (2901), the flag area (2902) in the firmware storage memory (104), and the OS (2903).
 図30に、ファームウェア格納用メモリ(104)内のフラグ領域(2902)を示す。 Fig. 30 shows the flag area (2902) in the firmware storage memory (104).
 フラグ領域(2902)は、シャットダウン完了フラグ(501)、ページテーブルポインタ(3001)、OS障害回復プログラムベクタ(503)を持つ。ページテーブルポインタ(3001)とは、不揮発主記憶(102)の管理情報であるページテーブル(説明は後述)へのポインタである。シャットダウン完了フラグ(501)及びOS障害回復プログラムベクタ(503)は、実施例1と同様である。 The flag area (2902) has a shutdown completion flag (501), a page table pointer (3001), and an OS failure recovery program vector (503). The page table pointer (3001) is a pointer to a page table (explained later) which is management information of the nonvolatile main memory (102). The shutdown completion flag (501) and the OS failure recovery program vector (503) are the same as in the first embodiment.
 次に、図31にOS(2903)の構造を示す。 Next, Fig. 31 shows the structure of OS (2903).
 OS(2903)は、カーネル(3101)、デバイスドライバ(202)、OS障害回復プログラム(203)、回復スタックポインタ(3107)、(3108)、システム状態変数(207)を持つ。カーネル(3101)は、実施例1と同じくデバイスドライバリスト(204)を持つ。 The OS (2903) has a kernel (3101), a device driver (202), an OS failure recovery program (203), recovery stack pointers (3107) and (3108), and a system state variable (207). The kernel (3101) has a device driver list (204) as in the first embodiment.
 実施例2で特徴的な点は、カーネル(3101)の持つメモリ管理情報の構造である。計算機システムは、主記憶をページという固定サイズの単位で管理する。このサイズはCPU(101)の仕様に依存する。ページのサイズは4KiBであることが多い。ここで「KiB」とは1024Byteを示す。実施例2において、ページ(3102)毎に、ページ管理情報(3103)がある。カーネル(3101)は、ページテーブル(3104)、ページテーブルポインタ(3001)、チェックコード(3105)ページ管理情報リスト(3109)及び空きページリスト(3110)を管理する。 The characteristic point of the second embodiment is the structure of the memory management information held by the kernel (3101). The computer system manages the main memory in units of fixed sizes called pages. This size depends on the specifications of the CPU (101). The page size is often 4KiB. Here, “KiB” indicates 1024 bytes. In the second embodiment, there is page management information (3103) for each page (3102). The kernel (3101) manages the page table (3104), the page table pointer (3001), the check code (3105), the page management information list (3109), and the free page list (3110).
 ページテーブル(3104)は、仮想アドレスに対応する物理ページの番号を示すリストである。一見、ページテーブル(3104)は1つでよいと思われるが、カーネル(3101)がページテーブル(3104)を複数持つ点が本実施例の1つの特長である。 The page table (3104) is a list indicating physical page numbers corresponding to virtual addresses. At first glance, it seems that only one page table (3104) is required, but one feature of the present embodiment is that the kernel (3101) has a plurality of page tables (3104).
 ページテーブルポインタ(3001)は、それぞれのページテーブル(3104)へのポインタのリストである。 The page table pointer (3001) is a list of pointers to each page table (3104).
 チェックコード(3105)は、ページテーブル(主記憶管理情報)を更新するときに、正しく更新されたかをチェックするための誤り検出/訂正符号である。 The check code (3105) is an error detection / correction code for checking whether the page table (main memory management information) is updated correctly when it is updated.
 ページ管理情報リスト(3109)は、使用されているページ管理情報(3103)のリストである。 The page management information list (3109) is a list of used page management information (3103).
 空きページリスト(3110)は、未使用のページのページ管理情報(3103)のリストである。 The free page list (3110) is a list of page management information (3103) of unused pages.
 OS(2903)が、安定状態保存時刻テーブル(3111)を管理する。安定状態保存時刻テーブル(3111)は、各世代の「安定状態」が保存された時刻(3113)を格納する。 OS (2903) manages the stable state storage time table (3111). The stable state storage time table (3111) stores the time (3113) when the “stable state” of each generation is stored.
 図32に、ページ管理情報(3103)とページテーブル(3104)とを示す。 FIG. 32 shows page management information (3103) and a page table (3104).
 ページ管理情報(3103)は、ページ番号(3201)、ページ属性(3202)、ページの物理アドレス(3203)、及び参照カウント(3204)を持つ。 The page management information (3103) has a page number (3201), a page attribute (3202), a page physical address (3203), and a reference count (3204).
 ページ番号(3201)とは、ページ(3102)を一意に特定するための識別番号である。 The page number (3201) is an identification number for uniquely identifying the page (3102).
 ページ属性(3202)とは、READ可能、WRITE可能などの当該ページに対する可能なアクセスの種類を示す情報である。 The page attribute (3202) is information indicating the type of access to which the corresponding page that can be read or written.
 ページの物理アドレス(3203)は、ページの物理アドレスを示す。 Page physical address (3203) indicates the physical address of the page.
 参照カウント(3204)は、当該ページを指しているページテーブル(3104)の数を示す。 Reference count (3204) indicates the number of page tables (3104) pointing to the page.
 次に、ページテーブル(3104)を説明する。ページテーブル(3104)は、世代数(3205)、仮想アドレス(3206)、ページ番号(3207)及びページ属性(3208)を持つ。 Next, the page table (3104) will be described. The page table (3104) has a generation number (3205), a virtual address (3206), a page number (3207), and a page attribute (3208).
 世代数(3205)とは、不揮発主記憶(102)の「安定状態」の世代を示す数値である。詳細は後述するが、ページテーブル(3104)は、OS(2903)が「安定状態」を保存するたびに、新しく生成される。したがって、不揮発主記憶(102)内には、複数の「安定状態」が存在し得る。世代数(3205)は、複数の「安定状態」の各々に付けられた番号である。 The number of generations (3205) is a numerical value indicating the “stable state” generation of the nonvolatile main memory (102). Although details will be described later, the page table (3104) is newly generated every time the OS (2903) stores the “stable state”. Therefore, a plurality of “stable states” may exist in the nonvolatile main memory (102). The number of generations (3205) is a number assigned to each of a plurality of “stable states”.
 仮想アドレス(3206)は、OS(2903)上で稼動するプログラム(アプリケーション)が送信したプロセス空間内のアドレスである。 The virtual address (3206) is an address in the process space sent by a program (application) running on the OS (2903).
 ページ番号(3207)は、仮想アドレス(3206)に対応するページ(3102)の番号を示す。 The page number (3207) indicates the number of the page (3102) corresponding to the virtual address (3206).
 ページ属性(3208)は、当該ページに対して許可された操作の種類を示す。たとえば、READ ONLY、READ可能、或いはWRITE可能などである。 The page attribute (3208) indicates the type of operation permitted for the page. For example, READ ONLY, READ enabled, or WRITE enabled.
 以上の仮想アドレス(3206)、ページ番号(3207)及びページ属性(3208)を、まとめてページテーブルエントリ(3209)と呼ぶ。ページテーブル(3104)は、ページテーブルエントリ(3209)のリストである。ページテーブル(3104)を用いて仮想アドレスと物理アドレスの変換を行う処理は、CPU(101)が有するTLB(Translate Look-aside Buffer)というアドレス変換機能によって実行される。アドレス変換処理は、OS(2903)が行っても良い。また、ページテーブルエントリ(3209)の仮想アドレス(3206)に物理アドレスを設定してもよい。仮想記憶の対象になっていない不揮発主記憶(102)の領域もページテーブルの管理下におき,「安定状態」保存の対象とすることができる。また、実施例2の説明では、上記のデータ構造を例にとるが、そのデータ構造に限定することなく、他のデータ構造でも本発明を適用することができる。 The above virtual address (3206), page number (3207), and page attribute (3208) are collectively referred to as a page table entry (3209). The page table (3104) is a list of page table entries (3209). The process of converting a virtual address and a physical address using the page table (3104) is executed by an address translation function called TLB (Translate Look-aside Buffer) of the CPU (101). The address conversion process may be performed by the OS (2903). Further, a physical address may be set in the virtual address (3206) of the page table entry (3209). An area of the nonvolatile main memory (102) that is not the target of virtual storage can also be placed under the management of the page table and can be a target of “stable state” storage. In the description of the second embodiment, the above data structure is taken as an example, but the present invention can be applied to other data structures without being limited to the data structure.
 図33に、ページテーブルポインタ(3001)の内容を示す。 Figure 33 shows the contents of the page table pointer (3001).
 第0世代ページテーブルポインタ(3301)、第(G-1)世代ページテーブルポインタ(3302)及び第G世代ページテーブルポインタ(3303)が、二重連結リストの構成をとっている。それぞれのページテーブルポインタは、対応する世代のページテーブル(3104)を指している。チェックコード(3105)も、各世代のチェックコード(3304)~(3306)の二重連結リストの構造を持っている。 The 0th generation page table pointer (3301), the (G-1) generation page table pointer (3302), and the G generation page table pointer (3303) have a double linked list configuration. Each page table pointer points to the corresponding generation page table (3104). The check code (3105) also has a double linked list structure of check codes (3304) to (3306) of each generation.
 図34に、OS(2903)が「安定状態」を保存するときの前記のデータ構造の変化を示す。 FIG. 34 shows the change in the data structure when the OS (2903) stores the “stable state”.
 OS(2903)は、「安定状態」を保存するとき、まず、ページテーブル(3104)をコピーして新ページテーブル(3401)を生成する。そして、OS(2903)は、ページテーブルポインタ(3001)に、新ページテーブルポインタ(3402)を追加する。そして、OS(2903)は、新ページテーブル(3401)の世代数(3201)をインクリメントする。そして、OS(2903)は、新ページテーブル(3401)を使い始める。このとき、新旧ページテーブルが同じページ管理情報(3103)を指している。そのため、OS(2903)は、各ページ管理情報(3103)の参照カウント(3207)をインクリメントする。実施例1では、「安定状態」の領域の内容をすべて別の領域にコピーする作業が必要であるが、実施例2の方式ではOS(2903)が管理情報のみを変更する。 When saving the “stable state”, the OS (2903) first creates a new page table (3401) by copying the page table (3104). Then, the OS (2903) adds a new page table pointer (3402) to the page table pointer (3001). Then, the OS (2903) increments the generation number (3201) of the new page table (3401). Then, the OS (2903) starts using the new page table (3401). At this time, the old and new page tables point to the same page management information (3103). Therefore, the OS (2903) increments the reference count (3207) of each page management information (3103). In the first embodiment, it is necessary to copy all the contents of the “stable state” area to another area, but in the method of the second embodiment, the OS (2903) changes only the management information.
 図35に、OS(2903)の「安定状態」保存のフローチャートを示す。 Fig. 35 shows the flowchart for saving the "stable state" of the OS (2903).
 ステップ(3501):処理が開始する。処理開始の契機は、実施例1で説明した複数種類の契機のうちのどれでもよい。 Step (3501): Processing starts. The trigger for starting the process may be any of the multiple types of triggers described in the first embodiment.
 ステップ(3502):OS(2903)が、二次記憶(106)への新たなコマンド送信を抑止する。このステップも、実施例1で説明した幾つかの方法のうちのどれが選択されてもよい。 Step (3502): The OS (2903) suppresses transmission of a new command to the secondary storage (106). For this step, any of the several methods described in the first embodiment may be selected.
 ステップ(3503):OS(2903)は、二次記憶(106)に送信したコマンドの中で未完了なコマンドがないかチェックする。未完了コマンドがなくなったことを契機に「安定状態」を保存する方法をOS(2903)が選択した場合、このステップは不要である。 Step (3503): The OS (2903) checks whether there is an incomplete command among the commands transmitted to the secondary storage (106). This step is not necessary when the OS (2903) selects a method of saving the “stable state” when there is no unfinished command.
 ステップ(3504):OS(2903)は、回復スタックポインタ(3107)~(3108)を保存する。回復スタックポインタ(3107)~(3108)は、二重連結リストの形態をとっている。このため、OS(2903)は、新たな回復スタックポインタを回復スタックポインタ(3107)~(3108)の二重連結リストに追加する。 Step (3504): The OS (2903) stores the recovery stack pointers (3107) to (3108). The recovery stack pointers (3107) to (3108) are in the form of a doubly linked list. Therefore, the OS (2903) adds a new recovery stack pointer to the double linked list of the recovery stack pointers (3107) to (3108).
 ステップ(3505):OS(2903)は、キャッシュをフラッシュする。このステップは実施例1と同じである。 Step (3505): OS (2903) flushes the cache. This step is the same as in Example 1.
 ステップ(3506):OS(2903)は、ページテーブル(3104)をコピーする。 Step (3506): The OS (2903) copies the page table (3104).
 ステップ(3507):OS(2903)は、新しいページテーブル(3104)の世代数(コピーされたページテーブルについての世代数)をインクリメントする。例えば、世代数がP(Pは整数)であれば、このステップにより、世代数が(P+1)とされる。 Step (3507): The OS (2903) increments the number of generations of the new page table (3104) (the number of generations for the copied page table). For example, if the number of generations is P (P is an integer), the number of generations is set to (P + 1) by this step.
 ステップ(3508):OS(2903)は、使用中のページのページ管理情報(3103)の参照カウント(3204)をインクリメントする。 Step (3508): The OS (2903) increments the reference count (3204) of the page management information (3103) of the page in use.
 ステップ(3509):OS(2903)は、使用中のページのページ属性(3205)をREAD ONLYに設定する。 Step (3509): The OS (2903) sets the page attribute (3205) of the page in use to READ ONLY.
 ステップ(3510):OS(2903)は、OS障害回復プログラムベクタ(503)をファームウェア格納メモリ(104)に保存する。 Step (3510): The OS (2903) saves the OS failure recovery program vector (503) in the firmware storage memory (104).
 ステップ(3511):OS(2903)は、ページテーブルポインタ(3001)に、最新世代のページテーブル(つまり新しく生成したページテーブル)へのポインタを追加する。 Step (3511): The OS (2903) adds a pointer to the latest generation page table (that is, a newly generated page table) to the page table pointer (3001).
 ステップ(3512):OS(2903)は、ファームウェア格納メモリ(104)内のシャットダウン完了フラグ(501)に0xEEを設定する。 Step (3512): The OS (2903) sets 0xEE to the shutdown completion flag (501) in the firmware storage memory (104).
 ステップ(3513):OS(2903)は、新しく生成したページテーブル(3104)、新しく生成したページテーブルポインタ(3001)及びページ管理情報(3103)を基に、チェックコード(3105)を生成し、そのチェックコード(3105)を保存する。OS(2903)が本処理実行中に停電した場合、これらの情報の変更が中途半端に終了し、これら情報間の一貫性が保てなくなるが、チェックコード(3105)があれば、それを用いて、これら情報間の一貫性を検査することができる。つまり、チェックコード(3105)は、それら情報間の一貫性を検査することに用いられる符号である。チェックコード(3105)が存在することによる効果は、チェックサム、CRC(Cyclic Redundancy Check)などの誤り訂正符号の種類に依存しない。 Step (3513): The OS (2903) generates a check code (3105) based on the newly generated page table (3104), the newly generated page table pointer (3001) and the page management information (3103). Save the check code (3105). If a power failure occurs during execution of this processing by OS (2903), the change of these information ends halfway, and consistency between these information cannot be maintained, but if there is a check code (3105), use it. Thus, consistency between these pieces of information can be checked. That is, the check code (3105) is a code used to check the consistency between these pieces of information. The effect of the presence of the check code (3105) does not depend on the type of error correction code such as a checksum or CRC (Cyclic Redundancy Check).
 ステップ(3514)=ステップ(1813)、及び、ステップ(3515)=ステップ(1814)である。 Step (3514) = Step (1813) and Step (3515) = Step (1814).
 ステップ(3516):処理が終了する。 Step (3516): Processing ends.
 図36を用いて、計算機システム(2900)の起動時のファームウェアの動作を説明する。 36, the operation of the firmware when the computer system (2900) is started will be described.
 ステップ(3601) =ステップ(701)、ステップ(3602) =ステップ(702)、ステップ(3603) =ステップ(703)、ステップ(3604) =ステップ(704)、ステップ(3605) =ステップ(705)、ステップ(3606) =ステップ(706)、ステップ(3607) =ステップ(707)、ステップ(3608) =ステップ(709)、ステップ(3609) =ステップ(710)、ステップ(3610) =ステップ(711)、ステップ(3611)=ステップ(712)、ステップ(3612) =ステップ(713)、ステップ(3613) =ステップ(714)、ステップ(3614) =ステップ(715)、ステップ(3615) =ステップ(719)、ステップ(3616) =ステップ(720)、ステップ(3617) =ステップ(721)、ステップ(3618) =ステップ(722)、ステップ(3619) =ステップ(723)、ステップ(3620) =ステップ(724)、及び、ステップ(3621) =ステップ(725)である。 Step (3601) = Step (701), Step (3602) = Step (702), Step (3603) = Step (703), Step (3604) = Step (704), Step (3605) = Step (705), Step (3606) = Step (706), Step (3607) = Step (707), Step (3608) = Step (709), Step (3609) = Step (710), Step (3610) = Step (711), Step (3611) = Step (712), Step (3612) = Step (713), Step (3613) = Step (714), Step (3614) = Step (715), Step (3615) = Step (719), Step (3616) = Step (720), Step (3617) = Step (721), Step (3618) = Step (722), Step (3619) = Step (723), Step (3620) = Step (724), And step (3621) = step (725).
 図37に、OS障害回復プログラム(3106)のフローチャートを示す。 FIG. 37 shows a flowchart of the OS failure recovery program (3106).
 ステップ(3701):本ステップはファームウェア処理が完了して、OS障害回復プログラム(3106)にジャンプした直後のステップである。 Step (3701): This step is the step immediately after the firmware processing is completed and jumps to the OS failure recovery program (3106).
 ステップ(3702):実施例2では、不揮発主記憶(102)の複数の「安定状態」を保持することができる。そのため、ユーザが不揮発主記憶(102)の世代を指定することができる。たとえば、OS障害回復プログラム(3106)が、不揮発主記憶(102)の世代の指定を受け付けるための画面をコンソール(図示せず)に表示することも可能である。そのため、本ステップではOS障害回復プログラム(3106)が、ユーザから不揮発主記憶(102)の世代の指定があったかなかったかを判定する。 Step (3702): In the second embodiment, a plurality of “stable states” of the nonvolatile main memory (102) can be maintained. Therefore, the user can specify the generation of the nonvolatile main memory (102). For example, the OS failure recovery program (3106) can display a screen for accepting designation of the generation of the nonvolatile main memory (102) on a console (not shown). Therefore, in this step, the OS failure recovery program (3106) determines whether or not the user has specified the generation of the nonvolatile main memory (102).
 ステップ(3702):ユーザから不揮発主記憶(102)の世代の指定がなかった場合、OS障害回復プログラム(3106)は、最新の不揮発主記憶(102)の世代(実施例2では、第G世代とする)のページテーブルポインタ(3301)を選択し、参照する。 Step (3702): When the generation of the nonvolatile main memory (102) is not designated by the user, the OS failure recovery program (3106) executes the latest generation of the nonvolatile main memory (102) (the G generation in the second embodiment). Page table pointer (3301) is selected and referred to.
 ステップ(3703):OS障害回復プログラム(3106)はチェックコード(3105)を読み取る。 Step (3703): The OS failure recovery program (3106) reads the check code (3105).
 ステップ(3704):OS障害回復プログラム(3106)は、ページテーブル(3104)、ページテーブルポインタ(3001)、ページ管理情報(3103)からチェックコードを再度生成し、ステップ(3803)で参照したチェックコード(3105)と比較する。2つのチェックコード間の不一致は、前記不揮発主記憶管理情報を変更したときに停電が発生したことを意味する。 Step (3704): The OS failure recovery program (3106) generates the check code again from the page table (3104), page table pointer (3001), and page management information (3103), and the check code referenced in step (3803) Compare with (3105). A mismatch between the two check codes means that a power failure has occurred when the nonvolatile main memory management information is changed.
 ステップ(3705):2つのチェックコードが一致したならば、OS(2903)は、第G世代のページテーブルポインタ(3301)を使う。 Step (3705): If the two check codes match, the OS (2903) uses the G-th generation page table pointer (3301).
 ステップ(3706):2つのチェックコードが不一致であった場合、OS(2903)は、第(G-1)世代のページテーブルポインタ(3302)を使う。 Step (3706): If the two check codes do not match, the OS (2903) uses the (G-1) generation page table pointer (3302).
 ステップ(3707):OS障害回復プログラム(3106)は、ユーザが指定した世代(本実施例では第X世代とする)のページテーブルポインタ(3001)を参照する。 Step (3707): The OS failure recovery program (3106) refers to the page table pointer (3001) of the generation designated by the user (X generation in this embodiment).
 ステップ(3708): OS(2903)は第X世代のページテーブルポインタ(3301)を選択し、参照する。 Step (3708): The OS (2903) selects and references the Xth generation page table pointer (3301).
 ステップ(3709): OS障害回復プログラム(3106)は、ページテーブル(3104)、ページテーブルポインタ(3001)、ページ管理情報(3103)からチェックコードを再度生成し、ステップ(3803)で参照したチェックコード(3105)と比較する。 Step (3709): The OS failure recovery program (3106) regenerates a check code from the page table (3104), page table pointer (3001), and page management information (3103), and the check code referenced in step (3803) Compare with (3105).
 ステップ(3710):本ステップは、ステップ(3805)と同じである。ただし、第X世代のページテーブル(3104)に対して判定する。 Step (3710): This step is the same as Step (3805). However, the determination is made with respect to the Xth generation page table (3104).
 ステップ(3711):本ステップは、ステップ(3805)と同じである。ただし、第X世代のページテーブル(3104)を使う。 Step (3711): This step is the same as Step (3805). However, the Xth generation page table (3104) is used.
 ステップ(3712): 本ステップは、ステップ(3805)と同じである。ただし、第(X-1)世代のページテーブルポインタ(3001)を使う。 Step (3712): This step is the same as Step (3805). However, the (X-1) th generation page table pointer (3001) is used.
 ステップ(3813):これ以降の処理は図24~図26と同じである。 Step (3813): Subsequent processes are the same as those in FIGS.
 次に、図38を用いて、アプリケーション、OS(2903)がページ(3102)を変更するときの処理を説明する。 Next, the processing when the application, OS (2903) changes the page (3102) will be described using FIG.
 図38の初期状態では、ページテーブル(3104)と新ページテーブル(3401)が同じページを指している。アプリケーション及び/又はOS(2903)が、ページ(3801)を変更しようとすると、OS(2903)は、未使用のページを取り出して、変更されようとするページ(3801)の内容を取り出したページにコピーし、そのコピー先のページを新ページ(3802)とする。そして、OS(2903)は、新ページテーブル内のページ(3801)へのポインタを新ページ(3802)へのポインタに変更する。 In the initial state of FIG. 38, the page table (3104) and the new page table (3401) point to the same page. When the application and / or the OS (2903) tries to change the page (3801), the OS (2903) takes out an unused page and changes the content of the page (3801) to be changed to the page that has been taken out. Copying is performed, and the copy destination page is set as a new page (3802). Then, the OS (2903) changes the pointer to the page (3801) in the new page table to the pointer to the new page (3802).
 図39に、ページ書き換え処理のラダーチャートを示す。 Fig. 39 shows a ladder chart of the page rewriting process.
 ステップ(3901):アプリケーションあるいはOS(2903)がページ(3801)を更新しようとする。このとき、CPU(101)のTLBが、ページ(3801)のページテーブルエントリ(3209)を参照して、ページ書き換え可否を判定する。このとき、図35で説明したように、ページの属性はREAD ONLYである。このため、CPU(101)は、ページフォルト例外(3902)を発生させる。 Step (3901): Application or OS (2903) tries to update page (3801). At this time, the TLB of the CPU (101) refers to the page table entry (3209) of the page (3801) and determines whether or not the page can be rewritten. At this time, as described in FIG. 35, the page attribute is READ ONLY. Therefore, the CPU (101) generates a page fault exception (3902).
 ステップ(3903):CPU(101)は、OS内のページフォルトハンドラを呼び出す。 Step (3903): The CPU (101) calls a page fault handler in the OS.
 ステップ(3904):ページフォルトハンドラが呼び出される。 Step (3904): The page fault handler is called.
 ステップ(3905):ページフォルトハンドラは、未使用ページから1ページを取り出し、ページ(3801)の内容をコピーする。そしてページフォルトハンドラは、前記ページの属性をREAD WRITE可能とする。 Step (3905): The page fault handler takes out one page from the unused pages and copies the contents of page (3801). Then, the page fault handler makes the page attribute READ READ.
 ステップ(3906):ページフォルトハンドラは、新ページテーブルのページ(3801)へのポインタを新ページ(3802)へのポインタに変更する。 Step (3906): The page fault handler changes the pointer to the page (3801) of the new page table to the pointer to the new page (3802).
 ステップ(3907):ページフォルトハンドラの処理は終了し、アプリケーションあるいはOS(2903)が動作を再開する。 Step (3907): Processing of the page fault handler ends, and the application or OS (2903) resumes operation.
 ステップ(3908):アプリケーションは、新ページ(3802)を更新する。アプリケーションあるいはOS(2903)は、別のページ(3802)を更新したことに気づかない。 Step (3908): The application updates the new page (3802). The application or OS (2903) does not notice that another page (3802) has been updated.
 OS(2903)が複数のページテーブルを持つことができると、不揮発主記憶(102)の容量が足りなくなる。なぜなら、OS(2903)は不揮発主記憶(102)上のデータを更新せずに、追記しているからである。そこで、世代数が小さい(=古い)ページテーブル(3104)とそれが指しているページ(3102)を未使用に戻して、不揮発主記憶(102)の容量を確保する動作が必要とされる。図40を用いてその動作を説明する。 If the OS (2903) can have multiple page tables, the capacity of the nonvolatile main memory (102) will be insufficient. This is because the OS (2903) adds data without updating the data on the nonvolatile main memory (102). Therefore, it is necessary to return the page table (3104) with a small number of generations (= old) and the page (3102) pointed to to unused to ensure the capacity of the nonvolatile main memory (102). The operation will be described with reference to FIG.
 ステップ(4001):本ステップはOS(2903)の処理の開始である。ユーザからの指示、不揮発主記憶(102)の空き容量が一定値を下回った、一定の時間間隔、世代数が一定値より増えるといった様々な契機のうちの少なくとも1つの契機で本処理が開始される。 Step (4001): This step is the start of OS (2903) processing. This process is started by at least one of various triggers such as an instruction from the user, the free capacity of the nonvolatile main memory (102) being less than a certain value, a certain time interval, and the number of generations exceeding a certain value. The
 ステップ(4002):OS(2903)は、最も古い世代のページテーブル(3104)を参照する。 Step (4002): The OS (2903) refers to the page table (3104) of the oldest generation.
 ステップ(4003):OS(2903)は、最も古い世代のページテーブル(3104)が指している各ページ(3102)のページ管理情報(3103)を参照し、その参照カウント(3204)を読み取る。 Step (4003): The OS (2903) refers to the page management information (3103) of each page (3102) pointed to by the oldest generation page table (3104), and reads the reference count (3204).
 ステップ(4004):OS(2903)は、参照カウント(3204)が1に等しいかチェックする。 Step (4004): The OS (2903) checks whether the reference count (3204) is equal to 1.
 ステップ(4005):参照カウント(3204)が1ならば、他のページテーブル(3104)は使用していないので、当該ページ(3102)を解放してよい。OS(2903)は、当該ページ(3102)の参照カウント(3204)を0にして、空きページリスト(3110)に登録する。 Step (4005): If the reference count (3204) is 1, the page (3102) may be released because the other page table (3104) is not used. The OS (2903) sets the reference count (3204) of the page (3102) to 0 and registers it in the free page list (3110).
 ステップ(4006):OS(2903)は当該ページテーブル(3104)に登録されたすべてのページを確認したかを判定する。すべてのページについて確認が終了したら、ステップ(4007)に進む。すべてのページについて確認が終了していないのであれば、ステップ(4003)に進む。 Step (4006): The OS (2903) determines whether all pages registered in the page table (3104) have been confirmed. When confirmation for all pages is completed, the process proceeds to step (4007). If confirmation has not been completed for all pages, the process proceeds to step (4003).
 ステップ(4007):処理が終了する。 Step (4007): Processing ends.
 この図40の処理は、所定の条件が満たされるまで繰り返されることがある。例えば、不揮発主記憶(102)の空き容量が一定値を下回ったことを契機として図40の処理が開始された場合、図40の処理が終了しても、不揮発主記憶(102)の空き容量が一定値を未だ下回っていれば、図40の処理が再び実行される。 40 may be repeated until a predetermined condition is satisfied. For example, if the process of FIG. 40 is started when the free capacity of the nonvolatile main memory (102) has fallen below a certain value, the free capacity of the nonvolatile main memory (102) even after the process of FIG. If the value is still below a certain value, the process of FIG. 40 is executed again.
 図40では、OS(2903)は古い世代のページを「未使用」の状態にするという、事実上のデータ消去が行われる。それに対し、古い世代のページ(3102)の内容を二次記憶(106)に書き出すという処理も考えられる。図41は、その処理のフローチャートである。 In FIG. 40, the OS (2903) virtually erases the data by setting the old generation page to the “unused” state. On the other hand, a process of writing the contents of the old generation page (3102) to the secondary storage (106) is also conceivable. FIG. 41 is a flowchart of the processing.
 ステップ(4101)=ステップ(4001)である。 Step (4101) = Step (4001).
 ステップ(4102):OS(2903)は、最も世代の古いページテーブル(3104)を選択する。 Step (4102): The OS (2903) selects the oldest page table (3104).
 ステップ(4103):OS(2903)は、選択されたページテーブル(3104)とそれが指しているページ(3102)を二次記憶(106)に書き込む。 Step (4103): The OS (2903) writes the selected page table (3104) and the page (3102) pointed to to the secondary storage (106).
 ステップ(4104)=ステップ(4003)、ステップ(4105)=ステップ(4004)、ステップ(4106)=ステップ(4005)、ステップ(4107)=ステップ(4006)である。そして、ステップ(4108)で処理が終了する。 Step (4104) = Step (4003), Step (4105) = Step (4004), Step (4106) = Step (4005), Step (4107) = Step (4006). Then, the process ends at step (4108).
 以上、説明したとおり、実施例2では、OS(2903)が、「安定状態」にある不揮発主記憶(102)からの更新ページ(3102)を新たに追記する。不揮発主記憶(102)全体が一度に変更されることはありえないので、OS(2903)が更新ページ(3102)を追記してしても、不揮発主記憶(102)全体からみれば、更新された範囲は小さいといえる。従って、OS(2903)は、不揮発主記憶(102)の容量を効率的に使用しているといえる。実施例1の方式では、不揮発主記憶(102)に必要な容量は、不揮発主記憶をm分割する場合には、1つのアクティブ領域に必要な容量のm倍以上であるのに対して、実施例2の方式では、不揮発主記憶(102)に必要な容量は、1つのアクティブ領域に必要な容量とほぼ同程度でよい。また、実施例1の方式では、アクティブ領域の全ての内容を他の領域にコピーする必要があるが、実施例2の方式では、不揮発主記憶(102)の管理情報の更新だけでよい。そのため、「安定状態」の保存動作が計算機システム(2900)の性能に影響を与えにくい。 As described above, in the second embodiment, the OS (2903) newly adds an update page (3102) from the nonvolatile main memory (102) in the “stable state”. Since the entire nonvolatile main memory (102) cannot be changed at once, even if the OS (2903) adds an update page (3102), it is updated when viewed from the entire nonvolatile main memory (102) The range is small. Therefore, it can be said that the OS (2903) efficiently uses the capacity of the nonvolatile main memory (102). In the method of the first embodiment, the capacity required for the nonvolatile main memory (102) is more than m times the capacity required for one active area when the nonvolatile main memory is divided into m. In the method of Example 2, the capacity required for the nonvolatile main memory (102) may be approximately the same as the capacity required for one active area. Further, in the method of the first embodiment, it is necessary to copy the entire contents of the active area to another region, but in the method of the second embodiment, only the management information in the nonvolatile main memory (102) needs to be updated. For this reason, the “stable state” storage operation hardly affects the performance of the computer system (2900).
 実施例1及び2では、不揮発主記憶(102)の「安定状態」を保存し、障害発生時に一貫性を保証しつつ、計算機システム(2900)が運転を再開する。実施例3では、二次記憶(106)内に格納されているファイルについても、過去の状態が取り出される。 In Embodiments 1 and 2, the “stable state” of the nonvolatile main memory (102) is saved, and the computer system (2900) resumes operation while ensuring consistency when a failure occurs. In the third embodiment, the past state of the file stored in the secondary storage (106) is also extracted.
 ファイルの変更履歴を保存するファイルシステムは、いくつか知られている。たとえば、Apple(登録商標)社のHFS+は、ファイルの変更履歴を保存する。そして、ユーザが過去の任意の時点の所望のファイルを読みだすことができる。このようないわゆる追記型ファイルシステムと本技術を組み合わせると、計算機システム(2900)は過去のある時点の状態から運転を再開できる。 Some file systems that store file change history are known. For example, Apple (registered trademark) HFS + stores a file change history. Then, the user can read out a desired file at an arbitrary point in the past. Combining this technology with such a so-called write-once file system allows the computer system (2900) to resume operation from a certain state in the past.
 図42に、実施例3で前提とする追記型ファイルシステムの管理情報を示す。 FIG. 42 shows the management information of the write-once file system assumed in the third embodiment.
 OS(2903)は、これら管理情報を二次記憶(106)に格納する。inodeマップ(4201)は、inodeへのポインタ(4202)の集合である。ここで「inode」とは、ファイルに関する情報(作成日時、更新時刻、アクセス許可情報など)を格納した管理情報である。inode0(4203)は、二次記憶(106)内の0番目のinodeである。inode0(4203)は、inode番号(4205)、sub-inodeポインタ(4206)から構成される。inode番号(4205)とはinode(4203)に一意的に割り当てられた番号である。sub-inode(4208)は、過去のある時点のファイル管理情報である。実施例3では、追記型ファイルシステムを想定しているため、1つのファイルに複数のinode(4203)が存在し得る。しかし、inode(4203)は基本的には二次記憶(106)内の特定の領域に特定のサイズで格納されるように設計されるのが通例である。しかし、OS(2903)が変更履歴を保存すると、可変サイズにならざるを得ない。そこで、inode(4203)は、固定サイズで実際の管理情報へのポインタしか持たず、sub-inode(4206)という不定アドレス、不定サイズのデータ構造に実際のファイルの情報を保存することとする。sub-inode(4206)は、inode番号、更新時刻とバージョン番号とファイルの内容であるファイルブロック(4207)へのポインタを持つ。さらに、sub-inode(4208)は、二重連結リストで互いに結合している。 OS (2903) stores these management information in the secondary storage (106). The inode map (4201) is a set of pointers (4202) to the inode. Here, “inode” is management information in which information related to a file (creation date, update time, access permission information, etc.) is stored. inode0 (4203) is the 0th inode in the secondary storage (106). The inode0 (4203) includes an inode number (4205) and a sub-inode pointer (4206). The inode number (4205) is a number uniquely assigned to the inode (4203). The sub-inode (4208) is file management information at a certain point in the past. Since the write-once file system is assumed in the third embodiment, a plurality of inodes (4203) may exist in one file. However, the inode (4203) is typically designed to be basically stored in a specific area in the secondary storage (106) with a specific size. However, when the OS (2903) saves the change history, it must be variable. Therefore, the inode (4203) has a fixed size and has only a pointer to actual management information, and saves the actual file information in an undefined address and indefinite size data structure called sub-inode (4206). The sub-inode (4206) has an inode number, an update time, a version number, and a pointer to a file block (4207) that is the contents of the file. Furthermore, sub-inode (4208) is connected to each other in a doubly linked list.
 図43にsub-inode(4206)を示す。 Figure 43 shows the sub-inode (4206).
 sub-inode(4206)は、inode番号(4301)、更新時刻(4302)、バージョン(4303)、ファイルブロックへのポインタ(4304)を持つ(前方ポインタと後方ポインタは省略)。 Sub-inode (4206) has inode number (4301), update time (4302), version (4303), and pointer to file block (4304) (the forward pointer and backward pointer are omitted).
 inode番号(4301)とは、inode(4203)に一意的につけられた番号である。sub-inode(4206)も同じ番号を持つ。 The inode number (4301) is a number uniquely assigned to the inode (4203). sub-inode (4206) has the same number.
 更新時刻(4302)とは、当該ファイルの当該バージョンが更新された時刻を示す。 The update time (4302) indicates the time when the version of the file was updated.
 バージョン(4303)は、sub-inode(4208)に一意的につけられた番号であり、ファイルが更新されたときに、数値が1つ増える。ファイルの更新と不揮発主記憶(102)の「安定状態」保存のタイミングは一致してもよいし、一致しなくてもよい。実施例3では、ファイルが更新されたときに、OS(2903)が最新のsub-inode(4206)を複製する。そして、OS(2903)は、複製されたsub-inode(4206)のファイルブロック(4207)へのポインタを変更し、バージョン番号を1つ増やし、sub-inode(4206)の二重連結リストの最後尾に追加する。inode(4203)のsub-inodeポインタ(4206)は、sub-inode(4206)の二重連結リストの先頭(もっとも古いsub-inode(4206))と最後尾(もっとも新しいsub-inode(4206))を指している。 * Version (4303) is a number uniquely assigned to sub-inode (4208). When the file is updated, the number increases by one. The update timing of the file and the “stable state” storage timing of the nonvolatile main memory (102) may or may not match. In the third embodiment, when the file is updated, the OS (2903) duplicates the latest sub-inode (4206). The OS (2903) then changes the pointer to the file block (4207) of the duplicated sub-inode (4206), increments the version number, and ends the double-linked list of sub-inode (4206). Add to the tail. The inode (4203) sub-inode pointer (4206) is the head of the doubly linked list of sub-inode (4206) (oldest sub-inode (4206)) and tail (newest sub-inode (4206)) Pointing.
 次に、図44に、ユーザがある過去のある時点tの計算機システム(2900)の「安定状態」において或るファイルを開くようにOS(2903)に指示を出したときに行われる処理のフローチャートを示す。 Next, FIG. 44 is a flowchart of processing performed when the user issues an instruction to the OS (2903) to open a certain file in the “stable state” of the computer system (2900) at a certain time t in the past. Indicates.
 ステップ4401:ユーザがファイルを開くようにOS(2903)に命令する。 Step 4401: The user instructs the OS (2903) to open the file.
 ステップ4402:OS(2903)は、運転している「安定状態」の保存時刻(3113)を採取する。さらに「安定状態」から運転を再開してからの経過時間を前記保存時刻(3113)に加える。これを変数tとする。 Step 4402: The OS (2903) collects the storage time (3113) of the operating “stable state”. Furthermore, the elapsed time after restarting the operation from the “stable state” is added to the storage time (3113). This is a variable t.
 ステップ(4403):OS(2903)は、最新のsub-inode(4206)を取り出す。実施例3では、バージョンVとする。 Step (4403): The OS (2903) takes out the latest sub-inode (4206). In the third embodiment, the version is V.
 ステップ(4404):OS(2903)は、バージョンを示す変数vにVを代入する。 Step (4404): The OS (2903) substitutes V for the variable v indicating the version.
 ステップ(4405):OS(2903)は、当該バージョンの更新時刻T(v)をsub-inode(4206)から取り出す。 Step (4405): The OS (2903) extracts the update time T (v) of the version from the sub-inode (4206).
 ステップ(4406):OS(2903)は、t>=T(v)であるかを判定する(すなわち、ユーザ指定の時点tが更新時刻T(v)と同じか或いはそれより現在に近いかを判定する)。
ステップ(4407): t>=T(v)であれば、OS(2903)は、運転中の時点における最新バージョンであるバージョンvのファイルを開く。
Step (4406): The OS (2903) determines whether t> = T (v) (that is, whether the user-specified time t is the same as or closer to the current time than the update time T (v)). judge).
Step (4407): If t> = T (v), the OS (2903) opens the file of version v, which is the latest version at the time of operation.
 ステップ(4408):逆に t< T(v)であれば、バージョンvのファイルは運転中の時点で存在しなかったことを意味する。そして、OS(2903)はvが0であるか判定する。 Step (4408): Conversely, if t <T (v), it means that the file of version v did not exist at the time of operation. Then, the OS (2903) determines whether v is 0.
 ステップ(4409): vが0である場合、当該ファイルは運転中に存在しなかったことを意味する。そこで、OS(2903)は「File not Found」とユーザに報告する。 Step (4409): If v is 0, it means that the file did not exist during operation. Therefore, the OS (2903) reports to the user “File not Found”.
 ステップ(4410): vが0でない場合、vをデクリメントしてステップ(4405)に戻る。 Step (4410): If v is not 0, v is decremented and the process returns to step (4405).
 ステップ(4411):処理が終了する。 Step (4411): The process ends.
 本フローチャートは、不揮発主記憶(102)の「安定状態」保存時刻とファイルの更新の時刻が一致しないことに対応したフローチャートとなっていることに注意すべきである。 Note that this flowchart corresponds to the fact that the “stable state” storage time of the nonvolatile main memory (102) does not match the file update time.
 以上、説明したように「安定状態」保存の方法と追記型ファイルシステムを組み合わせることによって、ユーザは計算機システム(2900)の過去の状態(不揮発主記憶(102)とファイル)から運転再開が可能である。このように、論理分割技術を用いなくても、計算機システム(主記憶、ファイルシステムを含む)全体の状態を保存し、そこから運転を再開することができる。本実施例での性能は、一般的な論理分割技術での性能に比べて良い。ここでいう性能とは、通常運転性能と状態保存処理の性能の2つを指している。なお、図42と異なるデータ構造を持つ追記型ファイルシステムでも本発明を適用することができる。 As described above, by combining the `` stable state '' storage method and the write-once file system, the user can resume operation from the past state (nonvolatile main memory (102) and file) of the computer system (2900). is there. As described above, the entire computer system (including the main memory and the file system) can be saved and the operation can be resumed without using the logical partitioning technique. The performance in this embodiment may be compared with the performance of a general logical partitioning technique. The performance here refers to two performances of normal operation performance and state preservation processing. Note that the present invention can also be applied to a write-once file system having a data structure different from that shown in FIG.

Claims (15)

  1.  周辺機器に接続された計算機システムであって、
     前記周辺装置にコマンドを送信するオペレーティングシステム(OS)を実行するプロセッサと、
     前記プロセッサに接続された不揮発性の主記憶と
    を備え、
     前記OSが、以下の(A)及び(B)の処理:
    (A)前記周辺装置に送信したいずれのコマンドも仕掛り中に無い状態である安定状態への遷移を検出する;
    (B)前記安定状態での主記憶に記憶されているデータと前記安定状態に遷移したときの命令アドレスとを含む情報である安定状態情報を前記主記憶に保存する、
    を実行する、
    計算機システム。
    A computer system connected to a peripheral device,
    A processor that executes an operating system (OS) that sends commands to the peripheral device;
    A nonvolatile main memory connected to the processor,
    The OS performs the following processes (A) and (B):
    (A) detecting a transition to a stable state in which none of the commands transmitted to the peripheral device is in progress;
    (B) storing stable state information, which is information including data stored in the main memory in the stable state and an instruction address when transitioning to the stable state, in the main memory;
    Run the
    Computer system.
  2.  前記プロセッサと前記主記憶に接続され前記主記憶の制御と前記プロセッサと前記主記憶間の通信の制御と前記周辺機器と前記主記憶間の通信の制御を担当するI/Oコントローラを備え、
     前記周辺機器は、二次記憶であり、
     前記コマンドは、前記二次記憶へのI/Oのコマンドであり、
     前記主記憶が、容量の等しい複数の領域を持ち、
     前記複数の領域のいずれかが、前記OSが現在使用する情報である最新OS情報を保存し、
     前記OSが、ファイルの変更履歴を保存する追記型ファイルシステムを持ち、
     前記OSが、前記(B)の処理として、前記最新OS情報が記憶されている領域から前記複数の領域の他のいずれかに前記最新OS情報を前記I/Oコントローラにコピーさせ、
     障害発生後、前記OSが、ユーザ所望の安定状態情報が保存されている領域からその安定状態情報を使用して起動し、
     ユーザ所望のファイルを開くときに、前記OSは、前記安定状態情報をコピーした時刻であるコピー時刻と前記ファイルの変更履歴とを比較し、比較の結果に基づいてファイル出力を制御する、
    請求項1記載の計算機システム。
    An I / O controller connected to the processor and the main memory and responsible for controlling the main memory, controlling communication between the processor and the main memory, and controlling communication between the peripheral device and the main memory;
    The peripheral device is a secondary storage;
    The command is an I / O command to the secondary storage,
    The main memory has a plurality of areas of equal capacity;
    One of the plurality of areas stores the latest OS information that is information currently used by the OS,
    The OS has a write-once file system that saves file change history,
    The OS causes the I / O controller to copy the latest OS information from the area where the latest OS information is stored to any other of the plurality of areas as the process of (B),
    After the failure occurs, the OS starts up using the stable state information from the area where the stable state information desired by the user is stored,
    When opening a user-desired file, the OS compares the copy time, which is the time when the stable state information was copied, with the change history of the file, and controls file output based on the comparison result.
    The computer system according to claim 1.
  3.  前記プロセッサと前記主記憶に接続され前記主記憶の制御と前記プロセッサと前記主記憶間の通信の制御と前記周辺機器と前記主記憶間の通信の制御を担当するI/Oコントローラを備え、
     前記周辺機器は、二次記憶であり、
     前記コマンドは、前記二次記憶へのI/Oのコマンドであり、
     ページ毎の属性を含んだ情報であるページテーブルがあり、
     前記OS上で、前記ページ情報に登録されているページを更新するアプリケーションが動作し、
     前記OSが、前記(A)の処理を行ったときに、前記(B)の処理において、前記ページテーブルをコピーし、コピー元のページテーブルに登録されたページの属性をREAD ONLYに更新し、
     前記アプリケーションあるいは前記OSが前記ページ情報に登録されたページを更新しようとした場合、前記プロセッサが、ページフォルトを生成してページフォルトハンドラを呼び出し、
     呼び出された前記OSが、以下の(C)乃至(I)の処理:
    (C)未使用のページを確保する;
    (D)前記アプリケーションあるいは前記OSが更新しようとしたページに記憶されているデータを、前記確保したページにコピーする;
    (E)前記ページテーブルに前記確保したページを登録する;
    (F)前記主記憶に記憶されているページテーブルの中で最も古いページテーブルを参照する;
    (G)前記最も古いページテーブルに登録された各ページについて、他のページテーブルに登録されたか否かを判定する;
    (H)他のページテーブルに登録されていないページを未使用とする;
    (I)前記参照したページテーブルに登録されているページ内のデータを前記二次記憶に書き込む、
    を行い、
     前記アプリケーションあるいは前記OSは、前記確保したページを更新し、
     障害発生後、前記OSが、前記安定状態情報に含まれている前記コピー元のページテーブルを使用する、
    請求項1記載の計算機システム。
    An I / O controller connected to the processor and the main memory and responsible for controlling the main memory, controlling communication between the processor and the main memory, and controlling communication between the peripheral device and the main memory;
    The peripheral device is a secondary storage;
    The command is an I / O command to the secondary storage,
    There is a page table which is information including attributes for each page,
    On the OS, an application that updates the page registered in the page information operates,
    When the OS performs the process (A), in the process (B), the page table is copied, and the attribute of the page registered in the copy source page table is updated to READ ONLY,
    When the application or the OS tries to update a page registered in the page information, the processor generates a page fault and calls a page fault handler.
    The called OS performs the following processing (C) to (I):
    (C) secure unused pages;
    (D) Copy the data stored in the page to be updated by the application or the OS to the reserved page;
    (E) register the reserved page in the page table;
    (F) referencing the oldest page table among the page tables stored in the main memory;
    (G) For each page registered in the oldest page table, it is determined whether or not it has been registered in another page table;
    (H) Unused pages not registered in other page tables;
    (I) Write the data in the page registered in the referenced page table to the secondary storage.
    And
    The application or the OS updates the secured page,
    After a failure occurs, the OS uses the copy source page table included in the stable state information.
    The computer system according to claim 1.
  4.  前記プロセッサと前記主記憶に接続され前記主記憶を制御するI/Oコントローラを備え、
     前記主記憶が、容量の等しい複数の領域を持ち、
     前記OSが起動してから前記(A)の処理が行われるまでの間、前記I/Oコントローラは、前記OSから前記主記憶への書込み対象のデータを受けた場合、前記複数の領域の全てにそのデータを書き込み、この場合、全ての領域が、OSが現在使用する情報である最新OS情報を保存する領域であり、
     前記(A)及び(B)の処理が行われた場合、前記OSは、前記I/Oコントローラに対して、前記複数の領域のうちの特定の領域にデータを書き込むように指示し、この場合、そのデータの書込み先の領域が、前記最新OS情報を保存する領域であり、いずれかの他の領域が、前記安定状態情報を保存する領域である、
    請求項1記載の計算機システム。
    An I / O controller connected to the processor and the main memory for controlling the main memory;
    The main memory has a plurality of areas of equal capacity;
    When the I / O controller receives data to be written to the main memory from the OS until the process of (A) is performed after the OS is started, all of the plurality of areas are In this case, all the areas are areas for storing the latest OS information, which is the information currently used by the OS,
    When the processes (A) and (B) are performed, the OS instructs the I / O controller to write data to a specific area of the plurality of areas. The area where the data is written is an area for storing the latest OS information, and any other area is an area for storing the stable state information.
    The computer system according to claim 1.
  5.  前記OSが、前記(B)の処理として、前記I/Oコントローラに対して、前記最新OS情報が保存されている領域から他の領域へ前記最新OS情報をコピーすること指示する、
    請求項4記載の計算機システム。
    The OS instructs the I / O controller to copy the latest OS information from the area where the latest OS information is stored to another area as the process of (B).
    The computer system according to claim 4.
  6.  ページ毎の属性を含んだ情報であるページテーブルがあり、
     前記OS上で、前記ページ情報に登録されているページを更新するアプリケーションが動作し、
     前記OSが、前記(A)の処理を行ったときに、前記(B)の処理において、前記ページテーブルをコピーし、コピー元のページテーブルに登録されたページの属性をREAD ONLYに更新し、
     前記アプリケーションあるいは前記OSが前記ページ情報に登録されたページを更新しようとした場合、前記プロセッサが、ページフォルトを生成してページフォルトハンドラを呼び出し、
     呼び出された前記OSが、以下の(C)乃至(E)の処理:
    (C)未使用のページを確保する;
    (D)前記アプリケーションあるいは前記OSが更新しようとしたページに記憶されているデータを、前記確保したページにコピーする;
    (E)前記ページテーブルに前記確保したページを登録する、
    を行い、
     前記アプリケーションあるいは前記OSは、前記確保したページを更新し、
     障害発生後、前記OSが、前記安定状態情報に含まれている前記コピー元のページテーブルを使用する、
    請求項1、4又は5記載の計算機システム。
    There is a page table which is information including attributes for each page,
    On the OS, an application that updates the page registered in the page information operates,
    When the OS performs the process (A), in the process (B), the page table is copied, and the attribute of the page registered in the copy source page table is updated to READ ONLY,
    When the application or the OS tries to update a page registered in the page information, the processor generates a page fault and calls a page fault handler.
    The called OS performs the following processing (C) to (E):
    (C) secure unused pages;
    (D) Copy the data stored in the page to be updated by the application or the OS to the reserved page;
    (E) register the reserved page in the page table;
    And
    The application or the OS updates the secured page,
    After a failure occurs, the OS uses the copy source page table included in the stable state information.
    The computer system according to claim 1, 4 or 5.
  7.  前記OSは、以下の(F)乃至(H)の処理:
    (F)前記主記憶に記憶されているページテーブルの中で最も古いページテーブルを参照する;
    (G)前記最も古いページテーブルに登録された各ページについて、他のページテーブルに登録されたか否かを判定する;
    (H)他のページテーブルに登録されていないページを未使用とする、
    を実行する、
    請求項6記載の計算機システム。
    The OS performs the following processes (F) to (H):
    (F) referencing the oldest page table among the page tables stored in the main memory;
    (G) For each page registered in the oldest page table, it is determined whether or not it has been registered in another page table;
    (H) Unused pages not registered in other page tables
    Run the
    The computer system according to claim 6.
  8.  前記周辺機器は、二次記憶であり、
     前記OSは、更に、以下の(I)の処理:
    (I)前記参照したページテーブルに登録されているページ内のデータを前記二次記憶に書き込む、
    を実行する、
    請求項7記載の計算機システム。
    The peripheral device is a secondary storage;
    The OS further performs the following processing (I):
    (I) Write the data in the page registered in the referenced page table to the secondary storage.
    Run the
    The computer system according to claim 7.
  9.  前記OSが、前記主記憶の空き容量が所定の数値を下回ったことを契機に、前記(F)乃至(H)の処理、及び/又は、前記(I)の処理を実行する、
    請求項7又は8記載の計算機システム。
    The OS executes the processes (F) to (H) and / or the process (I) when the free space in the main memory falls below a predetermined value.
    The computer system according to claim 7 or 8.
  10.  前記OSが、ファイルの変更履歴を保存する追記型ファイルシステムを持ち、
     前記OSが、ユーザ所望の安定状態の情報を用いて再起動し、ファイルを開くときに、前記安定状態情報の保存時刻と前記ファイルの変更履歴とを比較し、比較の結果に基づいてファイル出力を制御する、
    請求項1、4乃至10のうちのいずれかに記載の計算機システム。
    The OS has a write-once file system that saves file change history,
    When the OS is restarted using information on the stable state desired by the user and the file is opened, the storage time of the stable state information is compared with the change history of the file, and the file output is based on the comparison result To control the
    The computer system according to claim 1.
  11.  前記ファイル出力の制御では、前記OSは、前記安定状態情報の保存時刻に運転を再開してからの経過時間を加えた時刻より古いファイルバージョンの中で最も新しいファイルバージョンを選択し、選択したファイルバージョンのファイルを開く、
    請求項10記載の計算機システム。
    In the file output control, the OS selects the newest file version among the file versions older than the time obtained by adding the elapsed time since restarting the operation at the storage time of the stable state information, and selects the selected file. Open version file,
    The computer system according to claim 10.
  12.  前記OSが、前記安定状態情報の保存時刻に運転を再開してからの経過時間を加えた時刻より古いファイルバージョンが存在しなかった場合、ファイルが存在しないことを回答する、
    請求項10記載の計算機システム。
    If there is no file version that is older than the time when the OS is added to the elapsed time since restarting the operation at the storage time of the stable state information, it is answered that the file does not exist.
    The computer system according to claim 10.
  13.  前記OSが、ユーザからの安定状態保存命令に従って、前記周辺装置への新たなコマンド送信を抑止し、前記周辺装置に対するコマンドがすべて完了することを監視し、前記(A)の処理を行ったときに、直ちに、前記(B)の処理を行う、
    請求項1乃至12のうちのいずれかに記載の計算機システム。
    When the OS performs the processing of (A) by monitoring the completion of all commands to the peripheral device by suppressing the transmission of new commands to the peripheral device in accordance with the stable state saving command from the user Immediately, the process (B) is performed.
    The computer system according to claim 1.
  14.  前記OSは、安定状態にあるか否かを示す状態変数を持ち、安定状態から不安定状態に遷移することを検出したときに、前記(B)の処理を行う、
    請求項1乃至12のうちのいずれかに記載の計算機システム。
    The OS has a state variable indicating whether or not it is in a stable state, and performs the process of (B) when it is detected that a transition from a stable state to an unstable state is performed.
    The computer system according to claim 1.
  15.  周辺機器に接続され不揮発性の主記憶を有する計算機システムで実行されるコンピュータプログラムであって、
     前記周辺装置にコマンドを送信し、
     前記周辺装置に送信したいずれのコマンドも仕掛り中に無い状態である安定状態への遷移を検出し、
     前記安定状態での主記憶に記憶されているデータと前記安定状態に遷移したときの命令アドレスとを含む情報である安定状態情報を前記主記憶に保存する、
    ことを前記計算機システムに実行させるコンピュータプログラム。
    A computer program connected to a peripheral device and executed by a computer system having a nonvolatile main memory,
    Send a command to the peripheral device;
    Detecting a transition to a stable state in which none of the commands sent to the peripheral device is in progress,
    Storing stable state information, which is information including data stored in the main memory in the stable state and an instruction address when transitioning to the stable state, in the main memory;
    A computer program that causes the computer system to execute the above.
PCT/JP2009/001589 2009-04-06 2009-04-06 Calculation system provided with nonvolatile main memory WO2010116405A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2009/001589 WO2010116405A1 (en) 2009-04-06 2009-04-06 Calculation system provided with nonvolatile main memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2009/001589 WO2010116405A1 (en) 2009-04-06 2009-04-06 Calculation system provided with nonvolatile main memory

Publications (1)

Publication Number Publication Date
WO2010116405A1 true WO2010116405A1 (en) 2010-10-14

Family

ID=42935720

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2009/001589 WO2010116405A1 (en) 2009-04-06 2009-04-06 Calculation system provided with nonvolatile main memory

Country Status (1)

Country Link
WO (1) WO2010116405A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013065115A1 (en) * 2011-10-31 2013-05-10 富士通株式会社 Information processing device, method for controlling information processing device, virtual machine control program, and information processing system
WO2014064547A1 (en) * 2012-10-24 2014-05-01 International Business Machines Corporation In-memory continuous data protection
JP2014153793A (en) * 2013-02-06 2014-08-25 Nec Corp Server and output backup method of firmware installed in the same

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005107573A (en) * 2003-09-26 2005-04-21 Keio Gijuku Computer system which can restore execution state
JP2007531156A (en) * 2004-03-29 2007-11-01 マイクロソフト コーポレーション System and method for snapshot queries during database recovery
JP2008287398A (en) * 2007-05-16 2008-11-27 Toshiba Corp Main storage unit, control method therefor, and information processor using the main storage unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005107573A (en) * 2003-09-26 2005-04-21 Keio Gijuku Computer system which can restore execution state
JP2007531156A (en) * 2004-03-29 2007-11-01 マイクロソフト コーポレーション System and method for snapshot queries during database recovery
JP2008287398A (en) * 2007-05-16 2008-11-27 Toshiba Corp Main storage unit, control method therefor, and information processor using the main storage unit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013065115A1 (en) * 2011-10-31 2013-05-10 富士通株式会社 Information processing device, method for controlling information processing device, virtual machine control program, and information processing system
JPWO2013065115A1 (en) * 2011-10-31 2015-04-02 富士通株式会社 Information processing apparatus, information processing apparatus control method, virtual machine control program, and information processing system
US9619348B2 (en) 2011-10-31 2017-04-11 Fujitsu Limited Method, medium, system, and apparatus for supplying power at the time of power outage
WO2014064547A1 (en) * 2012-10-24 2014-05-01 International Business Machines Corporation In-memory continuous data protection
US10055304B2 (en) 2012-10-24 2018-08-21 International Business Machines Corporation In-memory continuous data protection
JP2014153793A (en) * 2013-02-06 2014-08-25 Nec Corp Server and output backup method of firmware installed in the same

Similar Documents

Publication Publication Date Title
US10859289B2 (en) Generating and using checkpoints in a virtual computer system
US10191761B2 (en) Adaptive dynamic selection and application of multiple virtualization techniques
US9189248B2 (en) Specialized boot path for speeding up resume from sleep state
KR102084816B1 (en) Layout and execution of software applications using bpram
TWI436199B (en) Method and controller for power management
US20120072658A1 (en) Program, control method, and control device
US20100031084A1 (en) Checkpointing in a processor that supports simultaneous speculative threading
JP2006004407A (en) Non-volatile memory/cache performance improvement
US20110202919A1 (en) Hypervisor and server apparatus
CN111708714B (en) Delayed destruction for efficient resource reclamation
TW201525869A (en) System and method for dual OS memory switching
US11256533B1 (en) Transparent disk caching for virtual machines and applications
WO2014035710A1 (en) Layout and execution of operating systems using bpram
US20230016888A1 (en) Memory mapping for hibernation
WO2010116405A1 (en) Calculation system provided with nonvolatile main memory
JP5035227B2 (en) Information processing apparatus, program start control method, and start control program
CN113127263B (en) Kernel crash recovery method, device, equipment and storage medium
US20220318053A1 (en) Method of supporting persistence and computing device
US7913057B2 (en) Translation lookaside buffer checkpoint system
Egger et al. Efficiently restoring virtual machines
JP3702233B2 (en) Information processing system and program execution mode control method
JP5577518B2 (en) Memory management method, computer and memory management program
JP2014085909A (en) Information processor, starting method, and program
KR20100018017A (en) Computer system based on non-volatile memory
KR20090120298A (en) Computer system based on non-volatile memory

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09842917

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09842917

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP