Memory management program, memory management method, and memory managing device
The memory management system addresses involuntary program termination in supercomputers by allowing user-specific swap area registration and program migration, ensuring critical applications continue running even during memory shortages.
Patent Information
- Application Number
- JP2023111283
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2025-01-20
AI Technical Summary
Conventional memory management in supercomputers often leads to unexpected program termination due to memory shortages, as existing techniques lack user-specific memory allocation and sharing, resulting in involuntary program stops.
A memory management system that allows users to register their own swap areas and programs, associating them with user IDs, enabling selective program migration to these user-specific swap areas and excluding critical programs from forced termination during memory shortages.
Prevents involuntary program termination by allowing user-specific memory expansion and prioritizing important applications, reducing the frequency of unexpected stops and protecting critical processes from OOM killers.
Smart Images

Figure 2025008791000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a memory management program, a memory management method, and a memory management device. [Background technology]
[0002] Traditionally, parallel processing has been effective in executing large-scale programs, and execution environments such as supercomputers are often required. In addition, services that make advanced computing technologies such as supercomputers easily available to everyone have led to the execution of various users' applications on supercomputers.
[0003] Prior art techniques include selecting a pool that can be used from the divided pools based on the priority of the task itself, and if memory cannot be secured from the memory pool corresponding to the priority, searching for a memory pool with free space on the lower priority side than the memory pool corresponding to the priority of the task from which memory is secured, and securing memory from that pool. There is also a computer equipped with an auxiliary storage device that saves data when the main storage device runs out of memory, and a dedicated memory for data saving that compresses and stores the saved data.
[0004] In addition, there is a technology that, when an attempt is made to use the storage capacity of the main storage area of a memory and the storage capacity is insufficient, determines whether to swap the data to be swapped itself, or the difference between the data to be swapped and the original data expanded from the program storage medium to the main storage area of the memory, based on previously stored determination information.
[0005] There is also a technique for reallocating memory capacity allocated to a second program to a first program, and notifying the first program of a memory allocation request at the timing when the memory capacity is allocated back from the first program to the second program before the memory capacity used by the second program becomes insufficient. There is also a technique for executing a plurality of operations using a first memory, and when it is determined during execution that one of the operations cannot be executed due to a shortage of available first memory, allocating a pre-allocated emergency memory separate from the first memory to the operation.
[0006] There is also a technique for monitoring each computing system for memory usage and allocating memory to the computing system from a free memory pool when the amount of free memory of the computing system falls below a free memory threshold of the computing system. There is also a technique for a component for memory management in a device, the component for regulating memory shortages. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Japanese Patent Application Publication No. 4-314147 [Patent Document 2] Japanese Patent Application Publication No. 8-328945 [Patent Document 3] JP 2009-217394 A [Patent Document 4] JP 2012-33041 A [Patent Document 5] US Patent Application Publication No. 2014 / 0149697 [Patent Document 6] US Patent Application Publication No. 2014 / 0372723 [Patent Document 7] US Patent Application Publication No. 2017 / 0286171 Summary of the Invention [Problem to be solved by the invention]
[0008] However, in the conventional technology, when a large-scale program is executed on a supercomputer, a memory shortage may occur, causing the program to suddenly stop being executed.
[0009] In one aspect, the present invention aims to prevent a program from being inadvertently stopped when a memory shortage occurs. [Means for solving the problem]
[0010] In one embodiment, a memory management program is provided that, when a registration request including specification of a first swap area and a first program in the storage used by a first user of a computer system including a memory and a storage is received, a combination of the first swap area and the first program specified in the registration request is registered in a memory unit in association with the first user, and when a shortage of the memory being used by one or more programs occurs and the first program is selected from the one or more programs as a target for movement from the memory, the program moves the first program to the first swap area by referring to the combination registered in the memory unit in association with the first user, and when forcibly terminating any of the programs using the memory in response to the shortage of memory, excludes the first program registered in the memory unit in association with the first user from the target for the forcible termination. Effect of the Invention
[0011] Advantageous Effects of Invention According to one aspect of the present invention, it is possible to prevent a program from being inadvertently stopped when a memory shortage occurs. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a diagram illustrating an example of a memory management method according to an embodiment. [Diagram 2]FIG. 2 is an explanatory diagram showing an example of the system configuration of a computer system 200. As shown in FIG. [Diagram 3] FIG. 3 is a block diagram showing an example of the hardware configuration of the information processing device 201. As shown in FIG. [Figure 4] FIG. 4 is an explanatory diagram showing an example of the contents of the swap priority table 220. As shown in FIG. [Diagram 5] FIG. 5 is a block diagram showing an example of the functional configuration of the information processing device 201. As shown in FIG. [Figure 6] FIG. 6 is an explanatory diagram showing a first information registration example. [Figure 7] FIG. 7 is an explanatory diagram showing a second information registration example. [Figure 8] FIG. 8 is an explanatory diagram showing a third information registration example. [Figure 9A] FIG. 9A is an explanatory diagram (part 1) showing an operation example of the information processing device 201. [Figure 9B] FIG. 9B is an explanatory diagram (part 2) showing an operation example of the information processing device 201. [Figure 10] FIG. 10 is an explanatory diagram showing a first example of deregistration. [Figure 11] FIG. 11 is an explanatory diagram showing a second example of deregistration. [Figure 12] FIG. 12 is a flowchart (part 1) showing an example of the information registration processing procedure of the information processing device 201. [Figure 13] FIG. 13 is a flowchart (part 2) illustrating an example of the information registration processing procedure of the information processing device 201. [Figure 14] FIG. 14 is a flowchart showing an example of a deregistration process procedure of the information processing device 201. [Figure 15] FIG. 15 is a flowchart (part 1) illustrating an example of a memory management process procedure of the information processing device 201. [Figure 16] FIG. 16 is a flowchart (part 2) illustrating an example of the memory management processing procedure of the information processing device 201. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of a memory management program, a memory management method, and a memory management device according to the present invention will be described in detail with reference to the accompanying drawings.
[0014] (Embodiment) 1 is an explanatory diagram showing an example of a memory management method according to an embodiment. In FIG. 1, a memory management device 101 is a computer that manages a memory 102 of a computer system 100. The computer system 100 is a computer system including the memory 102 and a storage 103.
[0015] The computer system 100 is realized by one or more computers (for example, a memory management device 101). The computer system 100 is, for example, a supercomputer or a High Performance Computer (HPC). The memory 102 is, for example, a Random Access Memory (RAM) used as a main storage device.
[0016] The storage 103 is, for example, an auxiliary storage device such as a hard disk drive (HDD) or a solid state drive (SSD). The memory 102 has a faster access speed (read / write speed) than the storage 103. In the computer system 100, for example, various applications are executed by multiple users.
[0017] When executing a large-scale application on a supercomputer or the like, memory (RAM) may become insufficient. When memory shortage occurs, it is possible to use a swap file (virtualized memory) provided in the storage. The memory area in the storage used as a swap file is sometimes called a swap area.
[0018] Swapping is an operation to secure usable storage space in physical memory by moving data in the physical memory to a storage area that is treated as a virtual memory. The data to be swapped is recorded in an area called a swap file in the storage, for example, and is read into memory as needed.
[0019] However, in conventional technology, root privileges are required to secure swap space (swap file), so users cannot freely expand memory. In addition, swap space is shared by all users, so there is a possibility that it may be allocated to other users. In addition, there are cases where swap space is not prepared on the system in the first place.
[0020] Furthermore, if a program requests more memory, including swap space, than is available to that program, in Linux (registered trademark) and other systems, the OOM killer (Out of Memory Killer) may be executed, causing programs other than the requesting program to suddenly stop.
[0021] In this embodiment, therefore, a memory management method for preventing a program from being stopped inadvertently when a memory shortage occurs will be described. Here, a processing example of the memory management device 101 (corresponding to the following processing (1) to (3)) will be described.
[0022] (1) The memory management device 101 accepts a registration request 120 from a first user 104 of the computer system 100. Here, the registration request 120 is a request for registering information in the memory unit 110, and includes a specification of a first swap area 121 and a first program 122 in the storage 103 used by the first user 104.
[0023] When the memory management device 101 receives the registration request 120, the memory management device 101 registers in the storage unit 110 a combination of a first swap area 121 and a first program 122 specified in the registration request 120 in association with the first user 104. The first swap area 121 is, for example, a swap file prepared by the first user 104. The registration of information in the storage unit 110 in response to the registration request 120 corresponds to a procedure for expanding the memory area available to the first user 104.
[0024] (2) When a shortage occurs in the memory 102 being used by one or more programs, and a first program 122 is selected from the one or more programs to be moved from the memory 102, the memory management device 101 moves the first program 122 to the first swap area 121 by referring to the combination registered in the memory unit 110 in association with the first user 104.
[0025] Moving a program means changing the storage area allocated to the program (for example, from physical memory to virtualized memory) and migrating the program information (for example, program code and data) to the new storage area.
[0026] 1, the memory 102 is being used by the first program 122 and other programs 131, 132. The program to be moved from the memory 102 is selected, for example, by an OS (Operating System). For example, when the first program 122 using the memory 102 is selected, the first program 122 is moved from the memory 102 to the first swap area 121 in the storage 103, and free area is secured in the memory 102.
[0027] (3) When the memory management device 101 forcibly terminates any of the programs using the memory 102 due to a shortage of the memory 102, the memory management device 101 excludes the first program 122 registered in the memory unit 110 in correspondence with the first user 104 from the forcible termination.
[0028] For example, if a program requests more memory space than is available to it, the OOM killer may be executed. The OOM killer is a function that forcibly terminates a process (program) when the system runs out of physical memory and swap space (virtualized memory) and cannot secure new memory space as required.
[0029] Here, for example, when the memory management device 101 executes the OOM killer in response to a shortage of memory 102, it excludes the first program 122 registered in the storage unit 110 in association with the first user 104. This prevents the first program 122 from being selected and forcibly terminated even if the OOM killer is executed in a situation where the first program 122 is not selected as a target for movement from memory 102 and the first program 122 is on memory 102.
[0030] In this way, the memory management device 101 can prevent a program from being inadvertently stopped when a memory shortage occurs.
[0031] 1, the first user 104 can register the first swap area 121 to be used by the first user 104 and expand the memory area even if the first user 104 does not have management authority (root authority). The first swap area 121 is managed in association with the first user 104, and therefore cannot be used by other users.
[0032] As a result, when the memory management device 101 moves the first program 122 from the memory 102 when a shortage of the memory 102 occurs, the memory management device 101 can move the first program 122 to the first swap area 121 prepared by the first user 104 and continue the execution of the first program 122. For example, the memory management device 101 can reduce the frequency of occurrence of the OOM killer compared to a case where only a swap area shared by all users is provided.
[0033] Furthermore, the memory management device 101 can exclude the first program 122 from the target of the OOM killer when the OOM killer is executed in response to a shortage in the memory 102. For example, even if the first program 122 is not selected as a target to be moved from the memory 102 and remains in the memory 102, the first program 122 will be excluded from the target of the OOM killer.
[0034] This allows the memory management device 101 to prevent the first program 122 from being stopped inadvertently, and to avoid, for example, a situation in which an important application is suddenly stopped and damage occurs. In the example of Fig. 1, when the OOM killer is executed, at least one of the other programs 131 and 132 is forcibly terminated, and free space is secured in the memory 102.
[0035] (System Configuration Example of Computer System 200) Next, a system configuration example of a computer system 200 including the memory management device 101 shown in Fig. 1 will be described. Here, a case where the memory management device 101 shown in Fig. 1 is applied to an information processing device 201 in the computer system 200 will be described as an example. The computer system 100 shown in Fig. 1 corresponds to the computer system 200, for example.
[0036] Fig. 2 is an explanatory diagram showing an example of a system configuration of a computer system 200. In Fig. 2, the computer system 200 includes an information processing device 201 and a plurality of client devices 202. In the computer system 200, the information processing device 201 and the client devices 202 are connected via a wired or wireless network 210. The network 210 is, for example, the Internet, a LAN (Local Area Network), or a WAN (Wide Area Network).
[0037] Here, the information processing device 201 is a computer that has a swap priority table 220, and manages processes and memory (for example, memory 302 shown in FIG. 3 described later). A process is a unit of processing executed by a CPU (CPU 301 shown in FIG. 3 described later), and corresponds to an application, for example. The information processing device 201 is, for example, a server that realizes a supercomputer.
[0038] The contents of the swap priority table 220 will be described later with reference to FIG.
[0039] The client device 202 is a computer used by a user of the computer system 200. The user is, for example, a person who executes various applications using the computer system 200. The user may also be a privileged user such as an administrator of the computer system 200. The client device 202 is, for example, a PC (Personal Computer), a tablet PC, or the like.
[0040] Although the information processing device 201 and the client device 202 are provided separately here, the present invention is not limited to this. For example, the information processing device 201 may be realized by the client device 202.
[0041] (Example of hardware configuration of information processing device 201) Next, an example of the hardware configuration of the information processing device 201 will be described.
[0042] Fig. 3 is a block diagram showing an example of a hardware configuration of an information processing device 201. In Fig. 3, the information processing device 201 includes a CPU (Central Processing Unit) 301, a memory 302, an MMU (Memory Management Unit) 303, a storage 304, and a communication I / F (Interface) 305. In addition, each component is connected to each other via a bus 300.
[0043] Here, the CPU 301 controls the entire information processing device 201. The CPU 301 may have multiple cores. The memory 302 includes, for example, a read only memory (ROM), a RAM, and a flash ROM. Specifically, for example, the flash ROM stores an OS program, the ROM stores an application program, and the RAM is used as a work area for the CPU 301. The program stored in the memory 302 is loaded into the CPU 301 to cause the CPU 301 to execute the coded process. The memory 102 shown in FIG. 1 corresponds to, for example, the memory 302.
[0044] The MMU 303 manages the memory 302 (physical memory). For example, the MMU 303 processes access to the memory 302 requested by the CPU 301. For example, exchange of address information between the CPU 301 and the memory 302 is performed via the MMU 303. In addition, exchange of data is performed directly between them.
[0045] The storage 304 is an auxiliary storage device that stores data. The storage 304 is, for example, an HDD or an SSD. The storage 304 may also include a plurality of HDDs or SSDs. The storage 304 is provided, for example, to supplement the storage capacity of the memory 302 (main storage device). The storage 103 shown in FIG. 1 corresponds to, for example, the storage 304.
[0046] The communication I / F 305 is connected to the network 210 through a communication line, and is connected to an external computer (e.g., the client device 202 shown in FIG. 2) via the network 210. The communication I / F 305 manages the interface between the network 210 and the inside of the device, and controls input and output of data from the external computer. The communication I / F 305 is, for example, a modem or a LAN adapter.
[0047] In addition to the above-mentioned components, the information processing device 201 may have, for example, an input device, a display, a portable recording medium, etc. Also, the client device 202 shown in Fig. 2 can be realized by the same hardware configuration as the information processing device 201. However, in addition to the above-mentioned components, the client device 202 has, for example, an input device, a display, etc.
[0048] (Storage contents of swap priority table 220) 4, the contents of the swap priority table 220 of the information processing device 201 will be described. The swap priority table 220 is realized by a storage device such as the memory 302 and the storage 304, for example.
[0049] Fig. 4 is an explanatory diagram showing an example of the storage contents of the swap preferential use table 220. In Fig. 4, the swap preferential use table 220 has fields for a user ID, an application name, and a swap file name, and stores swap preferential use information (for example, swap preferential use information 400-1 to 400-3) as records by setting information in each field.
[0050] Here, the user ID is identification information that uniquely identifies a user of the computer system 200. The app name is the name of an application. As the app name, for example, a process ID corresponding to the application can be used. The swap file name is the name of the swap file. The swap file is provided, for example, in the storage 304 shown in FIG. 3.
[0051] For example, swap priority information 400-1 includes only the user ID "root". Swap priority information 400-2 indicates a combination of the application name "xxxx" associated with the user ID "user#1" and the swap file name "file1.swp". Swap priority information 400-3 indicates a combination of the application name "xxxx" associated with the user ID "user#2" and the swap file name "file3.swp".
[0052] (Example of functional configuration of information processing device 201) Next, an example of the functional configuration of the information processing device 201 will be described.
[0053] FIG. 5 is a block diagram showing an example of a functional configuration of the information processing device 201. In FIG. 5, the information processing device 201 includes a reception unit 501, a registration unit 502, a movement management unit 503, a stop control unit 504, and a storage unit 510. The reception unit 501 to the stop control unit 504 are functions that constitute the control unit 500, and specifically, the functions are realized by, for example, having the CPU 301 execute a program stored in a storage device such as the memory 302 or storage 304 shown in FIG. 3, or by the communication I / F 305. To explain in more detail, for example, the control unit 500 is realized by the kernel of the OS. The processing results of each functional unit are stored in a storage device such as the memory 302 or storage 304. In addition, the storage unit 510 is realized by, for example, a storage device such as the memory 302 or storage 304. Specifically, for example, the storage unit 510 stores the swap priority use table 220 as shown in FIG. 4.
[0054] The reception unit 501 receives a registration request. Here, the registration request is a request to register information in the storage unit 510 (for example, the swap priority table 220). For example, the registration request may include a designation of a first swap area and a first program for a first user (first registration request).
[0055] The first user is a user of the computer system 200. The first swap area is a swap area (e.g., a swap file) used by the first user, and is provided, for example, in the storage 304. The first program is a program (e.g., an application) executed by the first user.
[0056] Furthermore, the registration request may, for example, include a request for specifying only a second swap area for a second user (a second registration request). The second user is a user of the computer system 200. The second swap area is a swap area used by the second user, and is provided, for example, in the storage 304.
[0057] The second user may be the same user as the first user, or may be a different user from the first user. The swap areas (first swap area, second swap area) used by the users may be provided to the users by the operator of the computer system 200, for example, by the users paying a usage fee to the operator of the computer system 200.
[0058] Also, the registration request may include, for example, a request that includes the designation of only the third user (third registration request). The third user is, for example, a privileged user of the computer system 200. Note that information for identifying the privileged user of the computer system 200 (such as a privileged user ID) is stored in a storage device such as the memory 302 or the storage 304.
[0059] Specifically, for example, the reception unit 501 receives a registration request from the client device 202 illustrated in Fig. 2. The reception unit 501 may also receive a registration request by a user's operation input using an input device (not illustrated).
[0060] More specifically, for example, the registration request is made by executing a memctl command in the client device 202. The memctl command is, for example, a command for requesting registration of information in the swap preemption table 220 or for requesting deregistration from the swap preemption table 220.
[0061] Here, an example of executing the memctl command when registering information will be described.
[0062] First, when only a user (third user) is specified, for example, the memctl command (i) below is executed. For example, a user ID is specified in (###). However, a registration request that specifies only a user is permitted only for example, a privileged user of the computer system 200.
[0063] (i) memctl -user (###)
[0064] When the memctl command “memctl” that does not specify anything is executed, the reception unit 501 may determine that the user who executed the memctl command is the specified user.
[0065] Furthermore, when a certain user (second user) specifies only the swap area (second swap area), for example, the memctl command (ii) below is executed. For example, the swap file name is specified in ($$$). The requesting (specifying) user is, for example, the user who executed the memctl command.
[0066] (ii) memctl -swap ($$$)
[0067] Furthermore, when a swap area (first swap area) and a program (first program) are specified by a certain user (first user), for example, the memctl command (iii) below is executed. For example, a swap file name is specified in ($$$). For example, an application name is specified in (%%%). A process ID may be used as the application name. The requesting (specifying) user is, for example, the user who executed the memctl command.
[0068] (iii) memctl -swap ($$$) (%%%)
[0069] When the registration unit 502 accepts the first registration request, the registration unit 502 registers the combination of the first swap area and the first program specified in the first registration request in association with the first user in the storage unit 510. Specifically, for example, when the memctl command in (iii) above is executed, the registration unit 502 registers the combination of the swap file name and the application name specified in the memctl command in the swap priority use table 220 in association with the user ID of the requesting (specifying) user.
[0070] Furthermore, when the registration unit 502 receives a second registration request, it registers the second swap area specified in the second registration request in the storage unit 510 in association with the second user. Specifically, for example, when the memctl command in (ii) above is executed, the registration unit 502 registers the swap file name specified in the memctl command in the swap priority use table 220 in association with the user ID of the requesting (specifying) user.
[0071] Furthermore, when the registration unit 502 receives a third registration request, the registration unit 502 judges whether or not the third user designated in the third registration request is a privileged user. The judgment of whether or not the third user is a privileged user is made, for example, by judging whether or not the user ID of the third user matches a privileged user ID stored in advance.
[0072] Here, if the third user is a privileged user, the registration unit 502 registers the third user specified in the third registration request in the storage unit 510. On the other hand, if the third user is not a privileged user, the registration unit 502 does not register the third user specified in the third registration request in the storage unit 510.
[0073] Specifically, for example, when the memctl command (i) above is executed, the registration unit 502 determines whether the user ID specified in the memctl command matches the privileged user ID. If the user ID matches the privileged user ID, the registration unit 502 registers only the user ID specified in the memctl command in the swap priority table 220.
[0074] On the other hand, if there is no match with the privileged user ID, the registration unit 502 may output an error response to the requesting (specified) user. The error response is, for example, a response indicating that registration cannot be performed by specifying only the user ID because the user is not a privileged user.
[0075] An example of information registration in the swap priority table 220 will be described later with reference to FIGS.
[0076] When the memory 302 (physical memory) being used by one or more programs becomes insufficient, the migration management unit 503 selects, from among the one or more programs, a program to be migrated from the memory 302. Here, the insufficiency of the memory 302 refers to, for example, a state in which the memory 302 does not have enough free space to allocate a memory area requested by a new program or a program currently being executed.
[0077] The program to be moved is selected in order to secure free space for allocating the requested memory area. Which program to select as the movement target among one or more programs using memory 302 is determined, for example, by an existing function of the OS. For example, the program to be moved is selected in consideration of the priority of each program, memory usage, etc.
[0078] When a first program is selected as a target for migration from memory 302, the migration management unit 503 references the combination of the first swap area and the first program registered in the storage unit 510 in association with the first user, and migrates the first program to the first swap area.
[0079] Here, moving a program means changing the storage area allocated to the program (e.g., from physical memory to virtualized memory) and migrating the program information (e.g., program code and data) to the new storage area. The program may be moved, for example, in page units. A page is the smallest unit for managing memory 302.
[0080] Specifically, for example, when migrating the first program to the first swap area, the migration management unit 503 determines whether the first program can be accommodated in the first swap area. For example, assume that the program is migrated in units of pages. In this case, the migration management unit 503 may determine that the first program can be accommodated in the first swap area if there is a free area of one page in the first swap area. One page is, for example, 4K bytes.
[0081] Also, assume that the migration of a program is performed on a process basis (all pages basis). In this case, the migration management unit 503 may determine that the first program can be accommodated in the first swap area if the first swap area has free space for all pages used by the process (first program).
[0082] Then, the migration management unit 503 migrates the first program to the first swap area if the first swap area can accommodate the first program. On the other hand, if the first swap area cannot accommodate the first program, the migration management unit 503 may migrate the first program to a shared swap area provided in the storage 304.
[0083] Here, the shared swap area is a swap area shared by all users of the computer system 200. For this reason, as a result of the shared swap area being used by another user, there may be a case where there is no free area to move the first program and the shared swap area is unavailable.
[0084] In this case, the migration management unit 503 does not migrate the first program. Also, there are cases where a shared swap area is not provided in the storage 304. In this case, too, the migration management unit 503 does not migrate the first program.
[0085] For example, assume that an application (process) with the application name "xxxx" registered in the swap priority table 220 in association with the user ID "user#1" is selected as a target for migration from the memory 302. In this case, the migration management unit 503, for example, refers to the swap priority information 400-2 (see FIG. 4) in the swap priority table 220 and migrates the selected application "xxxx" to the swap file "file1.swp."
[0086] The swap file "file1.swp" is a swap file with the swap file name "file1.swp". The application "xxxx" is an application with the app name "xxxx".
[0087] In addition, when a program corresponding to a second user is selected as a target for migration from memory 302, the migration management unit 503 migrates the program corresponding to the second user to a second swap area registered in the memory unit 510 in association with the second user.
[0088] Whether the selected program corresponds to the second user is determined, for example, from the user who has requested the execution of the selected program. Information identifying the user who has requested the execution of the program being executed may be included in metadata of the program, for example, or may be managed in the information processing device 201.
[0089] For example, assume that an application (process) corresponding to the user ID "user#2" registered in the swap priority table 220 in association with the swap file name "file3.swp" is selected as a target for migration from the memory 302. In this case, the migration management unit 503, for example, refers to the swap priority information 400-3 (see FIG. 4) in the swap priority table 220 and migrates the application corresponding to the selected user ID "user#2" to the swap file "file3.swp."
[0090] When the stop control unit 504 forcibly terminates any of the programs using the memory 302 in response to a shortage of the memory 302, the stop control unit 504 excludes the first program registered in the storage unit 510 in association with the first user from the list of programs to be forcibly terminated. The forcible termination of the programs is performed, for example, by a function of an OOM killer.
[0091] Specifically, for example, when the shared swap area is unavailable when moving a program (for example, the first program) from the memory 302, the stop control unit 504 activates a function to forcefully terminate any of the programs using the memory 302. The function to forcefully terminate the programs is, for example, an OOM killer.
[0092] At this time, the stop control unit 504, for example, refers to the swap priority table 220 and excludes all applications (processes) registered in association with the user ID from the OOM killer. As a result, the OOM killer selects one of the remaining applications excluding the non-target applications among the applications using memory 302, and stops (forces termination) the selected application. The application is selected, for example, by the function of the OOM killer, taking into consideration the priority of each application, memory usage, etc.
[0093] The reception unit 501 also receives a deregistration request. Here, the deregistration request is a request for deregistration from the storage unit 510 (for example, the swap priority table 220). For example, the deregistration request may include a designation of any program of the computer system 200 (first deregistration request).
[0094] Moreover, the deregistration request may, for example, include a specification of any swap area of the computer system 200 (second deregistration request). Also, the deregistration request may, for example, include a specification of any user of the computer system 200 (third deregistration request). The user specified in the third deregistration request is, for example, a user other than a privileged user.
[0095] Specifically, for example, the reception unit 501 receives a deregistration request from the client device 202. The reception unit 501 may also receive the deregistration request by a user's operation input using an input device (not shown). To explain in more detail, for example, the deregistration request is made by executing a memctl command in the client device 202.
[0096] Here, an example of executing the memctl command when canceling registration will be explained.
[0097] First, when specifying a user, for example, the memctl command (iv) below is executed. For example, a user ID is specified in (###).
[0098] (iv) memctl -del -user (###)
[0099] When the memctl command "memctl-del" that does not specify anything is executed, the reception unit 501 may determine that the user who executed the memctl command is the specified user.
[0100] Also, when specifying a swap area, for example, the memctl command (v) below is executed. For example, the swap file name is specified in ($$$).
[0101] (v) memctl -del -swap ($$$)
[0102] Also, when specifying a program, for example, the memctl command (vi) below is executed. For example, the application name is specified in (%%%).
[0103] (vi) memctl -del (%%%)
[0104] Also, it may be possible to specify a swap area and a program. In this case, for example, the memctl command (vii) below is executed. For example, a swap file name is specified in ($$$). For example, an application name is specified in (%%%).
[0105] (vii) memctl -del -swap ($$$)(%%%)
[0106] When the registration unit 502 receives the first deregistration request, it deletes the registration related to the program specified in the first deregistration request from the storage unit 510. Specifically, for example, when the memctl command in (vi) above is executed, the registration unit 502 deletes from the swap priority table 220 the application name specified in the memctl command that has been registered in association with the user ID of the requesting user.
[0107] Furthermore, when the registration unit 502 receives a second deregistration request, it deletes the swap area specified in the second deregistration request and the registration related to the program corresponding to the swap area from the storage unit 510. Specifically, for example, when the memctl command in (v) above is executed, the registration unit 502 deletes from the swap priority table 220 the swap priority information including the swap file name specified in the memctl command that was registered in association with the user ID of the requesting user.
[0108] Furthermore, when the registration unit 502 receives a third deregistration request, it deletes the registration related to the user specified in the third deregistration request from the storage unit 510. Specifically, for example, when the memctl command in (iv) above is executed, the registration unit 502 deletes the swap preferential use information including the user ID specified in the memctl command from the swap preferential use table 220.
[0109] An example of deregistration from the swap priority table 220 will be described later with reference to FIG. 10 and FIG.
[0110] In the above description, the first program registered in the storage unit 510 in association with the first user is excluded from the target of forced termination (for example, OOM killer), but this is not limited to the above. For example, when the stop control unit 504 forcibly terminates any of the programs using the memory 302 in response to a shortage of the memory 302, the stop control unit 504 may exclude a program corresponding to a second user registered in the storage unit 510 in association with a second swap area from the target of forced termination. The program corresponding to the second user is a program being executed by the second user.
[0111] To explain in more detail, for example, the stop control unit 504 refers to the swap priority information 400-3 (see FIG. 4) in the swap priority table 220 and excludes the program corresponding to the user with the user ID "user#2" registered in association with the swap file name "file3.swp" from being targeted by the OOM killer.
[0112] As a result, for a user who has registered the swap area that the stop control unit 504 uses, all applications running by that user can be excluded from the OOM killer without the user having to specify the applications individually.
[0113] Furthermore, when the stop control unit 504 forcibly terminates any of the programs using the memory 302 in response to a shortage of the memory 302, the stop control unit 504 may exclude a program corresponding to a third user registered in the storage unit 510 from the target of the forcible termination. However, the third user is a privileged user.
[0114] As a result, the stop control unit 504 can exclude all applications being executed by a privileged user from the targets of the OOM killer, without the privileged user having to specify swap areas or applications individually.
[0115] (Example of information registration in swap priority table 220) Next, an example of information registration in the swap preferential use table 220 will be described with reference to FIGS.
[0116] First, a first information registration example in the swap preferential use table 220 will be described with reference to FIG.
[0117] Fig. 6 is an explanatory diagram showing a first information registration example. In Fig. 6, it is assumed that the information processing device 201 receives a memctl command 600. The memctl command 600 corresponds to a third registration request that specifies only a user (third user).
[0118] In this case, the information processing device 201 determines whether the user ID "root" specified in the memctl command 600 matches the privileged user ID. Here, it is assumed that the user ID "root" matches the privileged user ID. Therefore, the information processing device 201 registers only the user ID "root" specified in the memctl command 600 in the swap priority table 220.
[0119] As a result, the swap preemption information 400-1 is registered in the swap preemption table 220 as a new record.
[0120] Next, a second example of information registration in the swap preferential use table 220 will be described with reference to FIG.
[0121] Fig. 7 is an explanatory diagram showing a second information registration example. In Fig. 7, it is assumed that the information processing device 201 receives a memctl command 700. The memctl command 700 corresponds to a second registration request that specifies only a swap area (second swap area) for the requesting user (second user).
[0122] Here, the requesting user is assumed to be a user with the user ID “user#2.” In this case, the information processing device 201 registers the swap file name “file3.swp” specified by the memctl command 700 in the swap priority use table 220 in association with the user ID “user#2.”
[0123] As a result, the swap preemption information 400-3 is registered in the swap preemption table 220 as a new record.
[0124] Next, a third example of information registration in the swap preferential use table 220 will be described with reference to FIG.
[0125] Fig. 8 is an explanatory diagram showing a third information registration example. In Fig. 8, it is assumed that the information processing device 201 receives a memctl command 800. The memctl command 800 corresponds to a first registration request that specifies a swap area (first swap area) and a program (first program) for a requesting user (first user).
[0126] In this example, the requesting user is assumed to be a user with a user ID of "user#1." In this case, the information processing device 201 registers the swap file name "file1.swp" and the application name "xxxx" specified by the memctl command 800 in the swap priority use table 220 in association with the user ID "user#1."
[0127] As a result, the swap preemption information 400-2 is registered in the swap preemption table 220 as a new record.
[0128] (Operation example of information processing device 201) Next, an example of the operation of the information processing device 201 will be described with reference to FIGS. 9A and 9B.
[0129] 9A and 9B are explanatory diagrams showing an example of the operation of the information processing device 201. In Fig. 9A, a memory 302, an MMU 303, and a storage 304 in the information processing device 201 are shown. Here, a process pr1 corresponding to a program PG1 in the storage 304 is being executed, and a process pr2 corresponding to a program PG2 in the storage 304 is being executed.
[0130] Pages 1 and 2 (virtual memory) are allocated to process pr1. Pages 3 and 4 (virtual memory) are allocated to process pr2. In FIG. 9A, pages 1 to 4 are allocated to memory 302 (physical memory). In addition, the user ID of the user who executed process pr2 is "user#1", and the application name of process pr2 is "xxxx".
[0131] Here, it is assumed that a shortage of memory 302 (physical memory) occurs.
[0132] 9B, when a shortage occurs in the memory 302 (physical memory), it is assumed that the process pr2 is selected as a program to be moved from the memory 302. In this case, the information processing device 201 refers to the swap priority use table 220 and moves each of pages 3 and 4 corresponding to the selected process pr2 to the swap area 610.
[0133] The swap area 610 corresponds to a swap file with a swap file name of “file1.swp.” However, if pages 3 and 4 corresponding to the process pr2 cannot be accommodated in the swap area 610, the information processing device 201 may move pages 3 and 4 corresponding to the process pr2 to the shared swap area 620.
[0134] Also, assume that when memory 302 (physical memory) becomes insufficient, process pr1 is selected as a program to be moved from memory 302. Here, no swap area has been prepared by the user for process pr1. In this case, the information processing device 201 moves process pr1 to the shared swap area 620. Here, page 2 corresponding to process pr1 is moved to the shared swap area 620.
[0135] Furthermore, when migrating any of the programs (for example, processes pr1 and pr2) from the memory 302, if there is no free space in the shared swap area 620 and it is unavailable, the OOM killer is started. At this time, the information processing device 201 excludes the process pr2 registered in the swap priority table 220 from the OOM killer.
[0136] Therefore, even if the process pr2 is using memory 302, it is not targeted by the OOM killer, and will not be suddenly stopped even if the OOM killer is executed.
[0137] (Example of deregistration from swap priority table 220) Next, an example of information registration in the swap priority table 220 will be described with reference to FIG. 10 and FIG.
[0138] Fig. 10 is an explanatory diagram showing a first deregistration example. In Fig. 10, swap preferential use information 400-1 to 400-4 is shown in the swap preferential use table 220. Here, it is assumed that the information processing device 201 receives the following memctl command (second deregistration request) from a requesting user with user ID "user#1".
[0139] memctl -del -swap (file1.swp)
[0140] In this case, the information processing device 201 deletes from the swap preferential use table 220 the swap preferential use information 400-2 that is registered in association with the user ID "user#1" and that includes the swap file name "file1.swp".
[0141] As a result, the swap file "file1.swp" specified by the memctl command and the application "xxxx" corresponding to the swap file "file1.swp" are unregistered.
[0142] Fig. 11 is an explanatory diagram showing a second deregistration example. Fig. 11 shows swap preferential use information 400-1 to 400-4 in the swap preferential use table 220. Here, it is assumed that the information processing device 201 receives the following memctl command (first deregistration request) from a requesting user with user ID "user#1".
[0143] memctl -del (yyyy)
[0144] In this case, the information processing apparatus 201 deletes the application name “yyyy” that was registered in association with the user ID “user#1” from the swap priority table 220.
[0145] As a result, only the registration related to the application "yyyy" specified by the memctl command in the swap preemption information 400-4 in the swap preemption table 220 is cancelled.
[0146] (Various processing procedures of the information processing device 201) Next, a description will be given of various processing procedures of the information processing device 201. First, an information registration processing procedure of the information processing device 201 will be described with reference to Figs.
[0147] 12 and 13 are flowcharts showing an example of an information registration procedure of the information processing device 201. In the flowchart of Fig. 12, first, the information processing device 201 determines whether or not a registration request has been received (step S1201). Here, the information processing device 201 waits for the reception of the registration request (step S1201: No).
[0148] When the information processing device 201 receives a registration request (step S1201: Yes), it judges whether the received registration request specifies only a user (user ID) (step S1202). If the request specifies only a user (step S1202: Yes), it judges whether the user specified in the registration request is a privileged user (step S1203).
[0149] If the user is a privileged user (step S1203: Yes), the information processing device 201 registers the user ID specified in the registration request in the swap priority table 220 (step S1204), and ends the series of processes according to this flowchart.
[0150] On the other hand, if the user is not a privileged user (step S1203: No), the information processing device 201 transmits an error response to the requesting user (step S1205) and ends the series of processes according to this flowchart. This error response includes, for example, a message indicating that registration specifying only the user (user ID) is not possible because the user is not a privileged user.
[0151] Moreover, in step S1202, if only the user is not designated (step S1202: No), the information processing device 201 proceeds to step S1301 shown in FIG.
[0152] 13, first, the information processing device 201 judges whether or not there is a swap file (swap file name) specified in the accepted registration request (step S1301). If there is a specified swap file (step S1301: Yes), the information processing device 201 registers the swap file name specified in the registration request in the swap priority use table 220 in association with the user ID of the requesting user (step S1302).
[0153] This allows the memory management device 101 to newly register swap preferential use information including the user ID of the requesting user and the swap file name specified in the registration request in the swap preferential use table 220. However, if swap preferential use information including the user ID of the requesting user and the swap file name specified in the registration request has already been registered, the information processing device 201 may skip the process of step S1302.
[0154] Then, the information processing device 201 registers the swap file specified in the registration request for use (step S1303). The registration is a process for the OS to recognize that the file specified in the registration request (memctl command) is a swap file, and corresponds to securing a swap area corresponding to the specified swap file.
[0155] Next, the information processing device 201 determines whether or not there is an application (application name) specified in the accepted registration request (step S1304). If there is a specified application (step S1304: Yes), the information processing device 201 associates the application name specified in the registration request with the user ID of the requesting user, and further registers the application name in the swap priority use table 220 (step S1305), and ends a series of processes according to this flowchart.
[0156] As a result, the memory management device 101 can further register the application name specified in the registration request to the swap preferential use information newly registered in step S1302. However, if swap preferential use information including the user ID of the requesting user and the swap file name specified in the registration request has already been registered, the information processing device 201 may register the application name specified in the registration request to the already registered swap preferential use information.
[0157] On the other hand, if there is no application specified in the registration request (step S1304: No), the information processing device 201 ends the series of processes according to this flowchart.
[0158] If the specified swap file does not exist in step S1301 (step S1301: No), the information processing device 201 transmits an error response to the requesting user (step S1306) and ends the series of processes according to this flowchart. This error response includes, for example, a message that the swap file has not been specified.
[0159] Next, the registration cancellation process of the information processing device 201 will be described with reference to FIG.
[0160] Fig. 14 is a flowchart showing an example of a deregistration processing procedure of the information processing device 201. In the flowchart of Fig. 14, first, the information processing device 201 determines whether or not a deregistration request has been received (step S1401). Here, the information processing device 201 waits for the reception of the deregistration request (step S1401: No).
[0161] Then, when the information processing device 201 receives a deregistration request (step S1401: Yes), it judges whether or not it is a user deregistration (step S1402). If it is a user deregistration (step S1402: Yes), the information processing device 201 deletes all records corresponding to the user ID specified in the deregistration request from the swap priority table 220 (step S1403), and ends the series of processes according to this flowchart.
[0162] On the other hand, if the request is not for deregistration of a user (step S1402: No), the information processing device 201 judges whether or not the request is for deregistration of a swap file (step S1404). If the request is for deregistration of a swap file (step S1404: Yes), the information processing device 201 deletes all records corresponding to the swap file name specified in the deregistration request from the swap priority table 220 (step S1405), and ends the series of processes according to this flowchart.
[0163] On the other hand, if the request is not for deregistration of a swap file (step S1404: No), the information processing device 201 determines whether the request is for deregistration of an application (step S1406). If the request is for deregistration of an application (step S1406: Yes), the information processing device 201 deletes the application name specified in the deregistration request, which is registered in association with the user ID of the requesting user, from the swap priority use table 220 (step S1407), and ends the series of processes according to this flowchart.
[0164] On the other hand, if the request is not to unregister an application (step S1406: No), the information processing device 201 transmits an error response to the requesting user (step S1408) and ends the series of processes according to this flowchart. This error response includes, for example, a message indicating that the registration target is not specified.
[0165] As a result, in response to a deregistration request from a user, the information processing apparatus 201 can deregistrate the user, swap file, and application designated in the deregistration request.
[0166] Next, a memory management process procedure of the information processing device 201 will be described with reference to FIGS.
[0167] 15 and 16 are flowcharts showing an example of a memory management processing procedure of the information processing device 201. In the flowchart of Fig. 15, first, the information processing device 201 determines whether or not the physical memory (memory 302) is insufficient (step S1501).
[0168] A shortage of physical memory is detected, for example, when a memory area requested by a newly started program or a program currently being executed cannot be secured in memory 302.
[0169] Here, the information processing device 201 waits for the physical memory (memory 302) to become insufficient (step S1501: No). If the physical memory (memory 302) becomes insufficient (step S1501: Yes), the information processing device 201 selects a process to be moved from the memory 302 from among the processes (programs) currently using the memory 302 (step S1502).
[0170] Next, the information processing device 201 refers to the swap priority table 220 and determines whether or not there is a swap file corresponding to the selected process (step S1503). The swap file corresponding to the selected process is, for example, a swap file registered in association with the selected process (application name). In addition, the swap file corresponding to the selected process is, for example, a swap file corresponding to the user (user ID) that has requested the execution of the selected process.
[0171] If there is no swap file (step S1503: No), the information processing device 201 proceeds to step S1601 shown in Fig. 16. On the other hand, if there is a swap file (step S1503: Yes), the information processing device 201 determines whether the selected process can be accommodated in the swap file (step S1504).
[0172] If the process can be accommodated in the swap file (step S1504: Yes), the information processing device 201 moves the selected process to the swap file (step S1505), and ends the series of processes according to this flowchart.
[0173] On the other hand, if the swap file cannot accommodate the process (step S1504: No), the information processing device 201 deletes the registration of the selected process from the swap priority use table 220 (step S1506) and proceeds to step S1601 shown in Fig. 16. As a result, even if there is a swap file registered (expanded) by the user, if the process cannot be accommodated and cannot be used due to insufficient capacity, etc., the information processing device 201 cancels the registration of the process.
[0174] 16, first, the information processing device 201 judges whether or not the shared swap area in the storage 304 is available (step S1601). If the shared swap area is available (step S1601: Yes), the information processing device 201 moves the selected process to the shared swap area (step S1602) and ends the series of processes according to this flowchart.
[0175] On the other hand, if the shared swap area is unavailable (step S1601: No), it is determined whether or not there is a process that is not registered in the swap priority table 220 among the processes using the memory 302 (step S1603). If there is no process that is not registered in the swap priority table 220 (step S1603: No), the information processing device 201 proceeds to step S1605.
[0176] On the other hand, if there is a process not registered in the swap preemption table 220 (step S1603: Yes), the information processing device 201 excludes the processes registered in the swap preemption table 220 from the OOM killer (step S1604). Also, in step S1604, if there is swap preemption information including only a user ID in the swap preemption table 220, the information processing device 201 may exclude the process corresponding to that user ID (privileged user ID) from the OOM killer.
[0177] Then, the information processing device 201 starts the OOM killer (step S1605) and ends the series of processes according to this flowchart.
[0178] As a result, when the information processing device 201 moves a process from the memory 302 (physical memory) when a shortage of the memory 302 occurs, if there is a swap file registered (expanded) by the user, the information processing device 201 can move the process to that swap file. Also, the information processing device 201 can exclude processes registered in the swap priority use table 220 from the targets of the OOM killer.
[0179] When free space is secured in the memory 302 (physical memory) by migration to a swap file or forced termination by the OOM killer, the memory space is allocated to the program (process) that requested it. The memory management process of the information processing device 201 shown in Fig. 15 and Fig. 16 may be repeatedly executed until the shortage of the physical memory (memory 302) is resolved, for example.
[0180] As described above, the information processing device 201 according to the embodiment can accept a registration request (first registration request) including a designation of a first swap area and a first program in the storage 304 used by a first user of the computer system 200. Then, when the information processing device 201 accepts a registration request (first registration request), it can register a combination of the first swap area and the first program designated in the registration request in the storage unit 510 (for example, the swap priority use table 220) in association with the first user.
[0181] This allows the information processing device 201 to enable even a user (general user) who does not have management authority such as a privileged user to expand the memory area used by an application. Also, the information processing device 201 can prevent the expanded memory area (swap area) from being used by other users by managing the expanded memory area (swap area) for each user.
[0182] Moreover, according to the information processing device 201, when a shortage of the memory 302 occurs and the first program is selected as a target to be moved from the memory 302, the first program can be moved to the first swap area by referring to the combination of the first swap area and the first program registered in the storage unit 510 in association with the first user. Moreover, according to the information processing device 201, when starting the OOM killer in response to a shortage of the memory 302, the first program registered in the storage unit 510 in association with the first user can be excluded from the target.
[0183] This allows the information processing device 201 to prevent a program from being stopped inadvertently when a shortage of the memory 302 occurs. For example, when a first program is selected as a migration target when a shortage of the memory 302 occurs, the information processing device 201 can migrate the first program to a first swap area prepared by the first user and continue execution of the first program. Furthermore, by excluding programs from the target of the OOM killer, the information processing device 201 can prevent programs that are important to the user from being suddenly stopped by the OOM killer.
[0184] Moreover, according to the information processing device 201, it is possible to accept a registration request (second registration request) including the specification of only the second swap area in the storage 304 used by the second user. Then, according to the information processing device 201, when a registration request (second registration request) is accepted, it is possible to register the second swap area specified in the registration request in the storage unit 510 in association with the second user.
[0185] This allows the information processing apparatus 201 to allow even a user who does not have administrative authority, such as a privileged user, to expand the memory area by specifying only the swap file.
[0186] Furthermore, according to the information processing device 201, when a shortage of memory 302 occurs and a program corresponding to a second user is selected as a target for movement from memory 302, the program corresponding to the second user can be moved to a second swap area registered in the storage unit 510 in association with the second user.
[0187] As a result, when a memory shortage occurs in the information processing device 201, if a program corresponding to a second user is selected as the target for migration, the program can be migrated to a second swap area prepared by the second user and execution of the program can be continued.
[0188] Furthermore, according to the information processing device 201, when a registration request including the designation of only the third user is received, it is determined whether the third user is a privileged user, and if the third user is a privileged user, the third user can be registered in the storage unit 510. And, according to the information processing device 201, when starting the OOM killer in response to a shortage of the memory 302, the program corresponding to the third user registered in the storage unit 510 can be excluded from the target.
[0189] As a result, the information processing device 201 allows only privileged users to register by specifying only the user (user ID), and can exclude programs corresponding to privileged users from the targets of the OOM killer. For example, the information processing device 201 can prevent programs important for the management of the computer system 200 from being suddenly stopped by the OOM killer.
[0190] Furthermore, according to the information processing device 201, when a deregistration request including the specification of any program of the computer system 200 is received, the registration related to the program specified in the deregistration request can be deleted from the storage unit 510.
[0191] This allows the information processing device 201 to improve user convenience by enabling the user to cancel the registration of an application that uses a swap file prepared by the user simply by specifying the application name, etc. If the specified program is using a swap file when a request for canceling registration is received, the information processing device 201 may continue to execute the program until the execution of the program ends or the program is moved to the memory 302 (physical memory).
[0192] In addition, according to the information processing device 201, when a deregistration request including the specification of any swap area of the computer system 200 is received, the registration related to the swap area specified in the deregistration request and the program corresponding to the swap area can be deleted from the memory unit 510.
[0193] This allows the information processing device 201 to collectively cancel the registration of swap files and related applications prepared by the user simply by specifying a swap file name, thereby improving user convenience.
[0194] Furthermore, according to the information processing device 201, when a deregistration request including the designation of any user of the computer system 200 is received, the registration relating to the user designated in the deregistration request can be deleted from the storage unit 510.
[0195] This allows the information processing device 201 to collectively cancel the registration of all swap files and related applications prepared by the user simply by specifying a user ID, thereby improving user convenience.
[0196] In addition, according to the information processing device 201, when starting the OOM killer in response to a shortage of memory 302, the program corresponding to the second user registered in the memory unit 510 in association with the second swap area can be excluded.
[0197] As a result, the information processing apparatus 201 can prevent a program corresponding to a user from being suddenly stopped by the OOM killer by simply registering the swap file name without having to specify the application name individually.
[0198] Moreover, according to the information processing device 201, when moving the first program from the memory 302, it is determined whether the first program can be accommodated in the first swap area, and if the first program can be accommodated in the first swap area, the first program can be moved to the first swap area. Moreover, according to the information processing device 201, if the first program cannot be accommodated in the first swap area, the first program can be moved to a shared swap area provided in the storage 304.
[0199] This allows the information processing device 201 to move the first program to the first swap area after determining whether the first swap area can accommodate the first program. Furthermore, if the first swap area cannot accommodate the first program, the information processing device 201 can continue the execution of the first program by using a shared swap area.
[0200] Furthermore, according to the information processing device 201, if the shared swap area is unavailable, the OOM killer can be started.
[0201] As a result, the information processing apparatus 201 can secure free space in the memory 302 by executing the OOM killer when neither the swap area prepared by the user nor the shared swap area shared by all users is available.
[0202] From these facts, the information processing device 201 according to the embodiment can prevent important processes from being inadvertently stopped by the OOM killer that is started due to a lack of physical memory. For example, when multiple users use a supercomputer, even a user who does not have administrative authority can register a swap area to be used by his / her own application and expand the memory area. In addition, by registering an application together with the swap area, the user can prevent processes that are important to him / her from being inadvertently stopped by the OOM killer.
[0203] The memory management method described in this embodiment can be realized by executing a prepared program on a computer such as a personal computer or a workstation. This memory management program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD (Compact Disc)-ROM, a DVD (Digital Versatile Disk), or a USB (Universal Serial Bus) memory, and is executed by being read from the recording medium by the computer. This memory management program may also be distributed via a network such as the Internet.
[0204] In addition, the memory management device 101 (information processing device 201) described in this embodiment can also be realized by an application-specific IC such as a standard cell or a structured ASIC (Application Specific Integrated Circuit) or a PLD (Programmable Logic Device) such as an FPGA.
[0205] The following supplementary notes are further disclosed regarding the above-described embodiment.
[0206] (Appendix 1) A computer in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, by referring to the combination registered in the storage unit in association with the first user, the first program is moved to the first swap area; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the forcible termination; A memory management program that causes a process to be executed.
[0207] (Note 2) When a registration request including a designation of only a second swap area in the storage used by a second user is received, the second swap area designated in the registration request is registered in the storage unit in association with the second user; when a shortage of the memory being used by one or more programs occurs, and a program corresponding to the second user is selected from among the one or more programs as a target for movement from the memory, moving the program corresponding to the second user to the second swap area registered in the storage unit in association with the second user; 2. The memory management program according to claim 1, which causes the computer to execute a process.
[0208] (Appendix 3) When a registration request including the specification of only a third user is received, it is determined whether the third user is a privileged user or not; If the third user is the privileged user, registering the third user in the storage unit; when forcibly terminating any of the programs using the memory in response to the memory shortage, a program corresponding to the third user registered in the storage unit is excluded from the target of the forcible termination. 3. The memory management program according to claim 1 or 2, characterized in that the program causes the computer to execute a process.
[0209] (Appendix 4) The memory management program according to Appendix 3, characterized in that when a deregistration request including the specification of any program of the computer system is received, the program is deleted from the memory unit from the registration related to the program specified in the deregistration request.
[0210] (Appendix 5) A memory management program as described in Appendix 3 or 4, characterized in that when a deregistration request including the specification of any swap area of the computer system is received, the program causes the computer to execute a process to delete from the memory unit the registration of the swap area specified in the deregistration request and the program corresponding to the swap area.
[0211] (Appendix 6) A memory management program as described in any one of Appendices 3 to 5, characterized in that when a deregistration request including the specification of any one of the users of the computer system is received, the program causes the computer to execute a process to delete from the memory unit the registration relating to any one of the users specified in the deregistration request.
[0212] (Appendix 7) The moving process is determining whether the first program can be accommodated in the first swap area; moving the first program to the first swap area if the first program can be accommodated in the first swap area; if the first swap area cannot accommodate the first program, move the first program to a shared swap area provided in the storage. 7. The memory management program according to claim 1,
[0213] (Appendix 8) If the shared swap area is unavailable, activate a function to force-terminate any program using the memory. 8. The memory management program according to claim 7, which causes the computer to execute a process.
[0214] (Appendix 9) A computer in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, by referring to the combination registered in the storage unit in association with the first user, the first program is moved to the first swap area; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the forcible termination; 23. A memory management method comprising:
[0215] (Supplementary Note 10) A memory management device in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, by referring to the combination registered in the storage unit in association with the first user, the first program is moved to the first swap area; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the forcible termination; A memory management device comprising a control unit. [Explanation of symbols]
[0216] 100,200 Computer Systems 101 Memory Management Unit 102,302 Memory 103,304 Storage 104 users 110,510 storage section 120 Registration Request 121,610 swap space 122 First Program 131,132 other programs 201 Information processing device 202 Client device 210 Network 220 Swap Priority Table 300 Bus 301 CPU 303 MMU 305 Communication I / F 500 Control section 501 Reception 502 Registration Department 503 Movement Management Department 504 Stop control section 600, 700, 800 memctl commands 620 shared swap space
Claims
1. A computer in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, moving the first program to the first swap area by referring to the combination registered in the storage unit in association with the first user; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the target of the forcible termination. A memory management program that causes a process to be executed.
2. when a registration request including a designation of only a second swap area in the storage used by a second user is received, the second swap area designated in the registration request is registered in the storage unit in association with the second user; when a shortage of the memory being used by one or more programs occurs, and a program corresponding to the second user is selected from the one or more programs as a target for movement from the memory, moving the program corresponding to the second user to the second swap area registered in the storage unit in association with the second user; 2. The memory management program according to claim 1, wherein the memory management program causes the computer to execute a process.
3. When a registration request including the designation of only a third user is received, it is determined whether the third user is a privileged user; If the third user is the privileged user, registering the third user in the storage unit; when forcibly terminating any of the programs using the memory in response to the memory shortage, a program corresponding to the third user registered in the storage unit is excluded from the target of the forcible termination.
3. The memory management program according to claim 2, which causes the computer to execute a process.
4. The memory management program according to claim 3, characterized in that when a deregistration request including the specification of any program of the computer system is received, the program is caused to execute a process of deleting the registration related to the program specified in the deregistration request from the memory unit.
5. The memory management program of claim 3, characterized in that when a deregistration request is received that includes the specification of any swap area of the computer system, the program causes the computer to execute a process to delete from the memory unit the registration of the swap area specified in the deregistration request and the program corresponding to the swap area.
6. The memory management program according to claim 3, characterized in that when a deregistration request including the specification of any user of the computer system is received, the program causes the computer to execute a process of deleting the registration related to any of the users specified in the deregistration request from the memory unit.
7. A computer in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, moving the first program to the first swap area by referring to the combination registered in the storage unit in association with the first user; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the target of the forcible termination.
23. A memory management method comprising:
8. A memory management device in a computer system including a memory and a storage, when a registration request including a designation of a first swap area and a first program in the storage used by a first user of the computer system is received, a combination of the first swap area and the first program designated in the registration request is registered in a storage unit in association with the first user; when the memory being used by one or more programs becomes insufficient, and when the first program is selected from the one or more programs as a target for movement from the memory, moving the first program to the first swap area by referring to the combination registered in the storage unit in association with the first user; when forcibly terminating any of the programs using the memory in response to the memory shortage, the first program registered in the storage unit in association with the first user is excluded from the target of the forcible termination. A memory management device comprising a control unit.
Citation Information
Patent Citations
Memory managing system
JP1992314147A
Save processing system for data on main storage device
JP1996328945A
Data swap method for information processing system, information processing system and control program therefor
JP2009217394A
Memory management method, memory management program, and computer
JP2012033041A
Memory Pre-Allocation For Cleanup and Rollback Operations
US20140149697A1