WO2012107988A1 - Memory management program, memory management method and information processing device - Google Patents

Memory management program, memory management method and information processing device Download PDF

Info

Publication number
WO2012107988A1
WO2012107988A1 PCT/JP2011/052488 JP2011052488W WO2012107988A1 WO 2012107988 A1 WO2012107988 A1 WO 2012107988A1 JP 2011052488 W JP2011052488 W JP 2011052488W WO 2012107988 A1 WO2012107988 A1 WO 2012107988A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
size
pages
free
normal
Prior art date
Application number
PCT/JP2011/052488
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/JP2011/052488 priority Critical patent/WO2012107988A1/en
Publication of WO2012107988A1 publication Critical patent/WO2012107988A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management

Definitions

  • the present technology relates to a memory management program, a memory management method, and an information processing apparatus.
  • a general operating system introduces a mechanism for delaying the allocation of memory to an application program (hereinafter abbreviated as application) until the application actually accesses the memory area.
  • This mechanism is known as a demand paging mechanism, which can reduce the overhead due to the loading process of the program into the memory and improve the response performance of the system.
  • the process of confirming whether or not memory allocation is possible that is, the process of confirming that free memory to which the requested memory can be allocated exists in the system is performed by actual memory access. Will be implemented at the time.
  • the reason why the page size for address conversion is larger than the normal page size is mainly due to the following reason.
  • a memory management hardware mechanism such as an MMU (Memory Management Unit) in the CPU described above and a virtual address in the operating system.
  • MMU Memory Management Unit
  • a mechanism for managing the correspondence relationship with the physical address is provided.
  • the number of address translation processes generated by the operating system increases, which can be an overhead when executing an application. For this reason, overhead is reduced by address conversion by collectively converting a plurality of pages.
  • a memory area used by a calculation job is reserved at system startup, and managed independently from the memory area used by an interactive process or the like.
  • a mechanism for guaranteeing that the memory resource is not consumed by an interactive process other than for a calculation job may be employed.
  • FIG. 1A immediately after the system is started, the entire memory area is allocated to the interactive process and used as the area a for the interactive process.
  • FIG. 1B when a calculation job is executed, a memory area b is also allocated to the calculation job, and the area a for the interactive process is reduced.
  • the area b is an area used as a large page
  • the area a is an area used as a normal page.
  • This HugeTLBFS is a large page memory management mechanism for allocating a data storage area to a calculation job that operates in an HPC environment and handles large-scale data, for example.
  • the memory (large page) managed by HugeTLBFS can be accessed with an overhead smaller than that of a normal memory because the granularity of address conversion is set larger than the granularity of address conversion in a normal memory (normal page). For this reason, programs that handle large-scale data, such as numerical computation jobs, allocate memory using HugeTLBFS.
  • Linux is roughly divided into two types of memory pools.
  • Normal page pool Memory area used mainly by processes that perform interactive operations
  • HugeTLBFS page pool Memory area used for numerical calculation jobs, etc.
  • the amount of memory that can be used as a data area for calculation jobs (ie, a memory area managed under the control of HugeTLBFS) is set by the system administrator at system startup.
  • Linux shifts the amount of memory set by the administrator from the memory installed in the system from the normal page pool to the HugeTLBFS page pool, and both page pools are managed independently in the subsequent processing. That is, the memory in the HugeTLBFS page pool is reserved so that an interactive process such as a shell does not use the memory in the HugeTLBFS page pool. This is to ensure that the memory can be used reliably by reserving a memory area that is used by the calculation job to perform calculation processing using large-scale data.
  • an OS used for a network server application such as FreeBSD has been equipped with a function for using a large page.
  • a system is equipped with a large page mechanism designed to allow large pages to be used while reducing the administrator's effort by allocating pages without making the user aware of the presence of large pages. .
  • a large page of the minimum size that can store the memory acquisition request amount is automatically calculated and assigned.
  • an object of the present technology is to provide a technology for efficiently using a first size page and a second size page larger than the first size.
  • the memory management method includes (A) a step of receiving a request for a first size page from the operating system, and (B) a free page in a first memory area divided into pages of the first size. If it is insufficient to meet the requirement, the empty page of the second size in the second memory area divided into the second size page larger than the first size is divided into the first size page, Allocating a first size page for the request.
  • FIG. 1 is a diagram for explaining conventional memory allocation.
  • FIG. 2 is a diagram illustrating an example of memory allocation in the embodiment.
  • FIGS. 3A to 3C are diagrams for explaining the diversion of the memory area.
  • FIG. 4 is a functional block diagram of the computer according to the first embodiment.
  • FIG. 5 is a diagram for explaining non-reserved large page management information.
  • FIG. 6 is a diagram for explaining reservation large page management information.
  • FIG. 7 is a diagram for explaining normal page management information.
  • FIG. 8 is a diagram showing a processing flow of page allocation processing according to the first embodiment.
  • FIG. 9 is a diagram illustrating a processing flow of the page allocation processing according to the first embodiment.
  • FIG. 10 is a diagram illustrating a processing flow of the page allocation processing according to the first embodiment.
  • FIG. 10 is a diagram illustrating a processing flow of the page allocation processing according to the first embodiment.
  • FIG. 11 is a diagram illustrating a processing flow of the page release processing according to the first embodiment.
  • FIG. 12 is a diagram illustrating a processing flow of the page release processing according to the first embodiment.
  • FIG. 13 is a diagram illustrating a processing flow of the page release processing according to the first embodiment.
  • FIG. 14 is a functional block diagram of a computer according to the second embodiment.
  • FIG. 15 is a diagram for explaining a buddy page pool.
  • FIG. 16 is a diagram illustrating a processing flow of the page release processing according to the second embodiment.
  • FIG. 17 is a diagram for explaining normal page management information of a buddy page pool.
  • FIG. 18 is a functional block diagram of a computer.
  • FIG. 2 shows an example of memory allocation according to an embodiment of the present technology.
  • it is used for a page having the minimum size among the page sizes supported by the operating system or the like (referred to as a normal page here, but the page having the minimum size is not necessarily set as a normal page).
  • An area A that is divided and managed, and areas B and C that are divided and managed into a page having a size larger than that of a normal page (called a large page) are included.
  • the area C divided for the large page is an area reserved for a specific application or the like using the large page, and an empty large page in the area is registered in the reserved large page pool.
  • the area B divided into large pages is an area used for applications that use large pages and applications that use normal pages, and empty large pages in the areas are unreserved large pages. Registered in the page pool. Large pages in area B are allocated as large pages to applications that use large pages, but if there are not enough normal pages in area A, the large pages in area B are divided into normal page sizes. In some cases, it is assigned to an application using a normal page.
  • the area A divided into normal pages is an area used by an application using a normal page such as an interactive process, and free normal pages in the area are registered in the normal page pool.
  • FIG. 3A in a normal state in which there is no shortage of pages, the state is the same as in FIG. 2, and page allocation is performed in each of the normal page area A and the large page areas B and C.
  • An empty large page in the reserved large page pool in area C is allocated if requested by a specific application related to the reservation.
  • An empty large page in the non-reserved large page pool in area B is allocated if requested by an application using the large page.
  • an empty normal page in the normal page pool in the area A is allocated if requested by an application using the normal page.
  • the area B is introduced and the free area allocated to the large page in the non-reserved large page pool is dynamically allocated as a large page or a normal page depending on the situation, thereby flexibly responding to the memory request. Will be able to. That is, the memory utilization efficiency is improved.
  • the following two points can be made compatible without restarting the system or resetting operating parameters. That is, (1) it is not necessary to estimate the memory consumption of an interactive job or the like in advance. (2) High-speed large-scale memory access can be performed by a calculation job using a large page under the conditions of (1).
  • a plurality of nodes perform calculation processing in cooperation, so when resetting system parameters, it is necessary to reset a plurality of nodes. Since the recent HPC environment is composed of several thousand nodes or more, the above method is useful for reducing the cost for reconfiguration.
  • the computer 100 includes a normal page management mechanism 101, a large page management mechanism 102, a page allocation mechanism 103, a page release mechanism 104, a normal page pool 106, a non-reserved large page pool 107, and a reserved large page pool 108. And have.
  • large pages 108 a to 108 c are registered in the reserved large page pool 108
  • large pages 107 a and 107 b are registered in the non-reserved large page pool 107
  • the normal page pool 106 is registered.
  • Normal pages 106a to 106h are respectively registered.
  • the number of pages to be registered is arbitrary, and the mode of page registration shown in FIG. 4 is an example.
  • the page allocation mechanism 103 is also called a page allocation handler, and is included in the kernel of the operating system of the computer 100.
  • the non-reserved large page pool 107 stores non-reserved large page management information as shown in FIG. 5, for example.
  • the non-reserved large page management information includes the total number of non-reserved large pages, the number of allocated pages, the number of free pages, the number of diverted pages, and the page list.
  • the total number of pages is a total value of the number of allocated pages, the number of empty pages, and the number of diverted pages.
  • the number of allocated pages is the number of pages allocated to an application using a large page.
  • the number of free pages is the number of unallocated pages.
  • the number of diverted pages is the number of pages that have been diverted to normal pages.
  • the page list is a list of free pages managed by the non-reserved large page pool 107, and each free page is sorted in the order of the top physical address, for example.
  • the reserved large page pool 108 stores reserved large page management information as shown in FIG. 6, for example.
  • the reserved large page management information includes the total number of reserved large pages, the number of allocated pages, the number of empty pages, and a page list.
  • the total number of pages is a total value of the number of allocated pages and the number of empty pages.
  • the number of allocated pages is the number of pages allocated only to a calculation job using a large page.
  • the number of empty pages is the number of unallocated pages.
  • the page list is a list of free pages managed in the reserved large page pool 108, and each free page is sorted in the order of the top physical address, for example. Note that a memory size corresponding to the number of pages may be used instead of the number of pages.
  • normal page management information as shown in FIG. 7 is stored in the normal page pool 106, for example.
  • the normal page management information includes the total number of normal pages, the number of allocated pages, the number of empty pages, a page list, and a diversion threshold.
  • the number of allocated pages is the number of pages allocated to an application that uses normal pages.
  • the number of empty pages is the number of unallocated pages.
  • the page list is a list of free pages managed in the normal page pool 106, and each free page is sorted in the order of the top physical address, for example.
  • the diversion threshold value is a threshold value for the number of continuous free normal pages when a continuous free normal page is converted into a large page and returned when there is a large page diverted to a normal page.
  • the diversion threshold value may be (large page size) / (normal page size) or a larger value.
  • the page allocation mechanism 103 outputs a page allocation request including the requested number of normal pages to the normal page management mechanism 101 in response to a request from an application or the like or occurrence of another normal page allocation event (FIG. 8: Step S1). Since this step is the same as the conventional one, further explanation is omitted.
  • the normal page management mechanism 101 receives a page allocation request including the number of requested pages for the normal page from the page allocation mechanism 103 (step S3), and the normal page free page included in the normal page management information of the normal page pool 106. The number is confirmed (step S5).
  • the normal page management mechanism 101 reduces the number of empty pages by the number of requested pages in the normal page management information, increases the number of allocated pages by the number of requested pages, and creates normal pages for the number of requested pages from the normal page list this time.
  • Step S9 Specifically, the top physical addresses of normal pages for the number of requested pages are read from the normal page list, and the top physical addresses of normal pages for the number of requested pages read are deleted from the normal page list.
  • the normal page management mechanism 101 outputs a page allocation result including information on the top physical address of the allocated normal page to the page allocation mechanism 103 (step S11).
  • the page allocation mechanism 103 receives the page allocation result from the normal page management mechanism 101 (step S13), and allows the requesting application to use the allocated normal page. Since this process is the same as that of the prior art, further explanation is omitted.
  • step S7 when the number of requested pages is larger than the number of free pages (step S7: No route), since the current free page cannot be allocated to the requested page, a large page is diverted. Specifically, the normal page management mechanism 101 outputs a page allocation request including the requested number of pages to the large page management mechanism 102 (step S15). In response to this, the large page management mechanism 102 receives a page allocation request including the number of requested pages from the normal page management mechanism 101 (step S17). The processing shifts to the processing in FIG.
  • the large page management mechanism 102 checks the number of large pages that are included in the large page management information of the non-reserved large page (step S19). In addition, the large page management mechanism 102 converts the number of empty large page pages into the number of normal page pages (step S21). For example, it is calculated by (number of empty pages of large pages) * (page size of large pages) / (page size of normal pages). (“*” Represents integration.) In this step, the requested number of normal pages may be converted into a large page. Specifically, (the number of requested pages of normal pages) * (page size of normal pages) / (page size of large pages) is calculated, and a value less than an integer is rounded up, for example.
  • the large page management mechanism 102 determines whether or not the number of converted pages of empty large pages is equal to or greater than the number of requested pages (step S23). When the number of requested pages is converted into the number of large pages, it is checked whether the number of free pages is equal to or greater than the number of requested pages.
  • the large page management mechanism 102 outputs an allocation failure to the normal page management mechanism 101 (step S25).
  • the normal page management mechanism 101 further outputs the allocation failure to the page allocation mechanism 103 (step S27).
  • the page allocation mechanism 103 receives a notification of allocation failure from the normal page management mechanism 101 (step S29), and notifies the requesting application or the like of the allocation failure. Since the subsequent processing is the same as the conventional one, further explanation is omitted.
  • the large page management mechanism 102 calculates the number of diverted pages of the large page to be rotated now (step S31).
  • the number of diverted pages is calculated by (number of requested normal pages) * (page size of normal pages) / (page size of large pages).
  • the large page management mechanism 102 decreases the number of empty pages in the non-reserved large page management information of the non-reserved large page pool 107 by the number of diverted pages of the large page to be rotated now, and the diverted page from the page list of the non-reserved large page.
  • a number of large pages are allocated to the current request (step S33).
  • the start physical address of each large page for the number of diverted pages is read, and the page management information of each read large page is displayed as the page list in the non-reserved large page management information Delete from.
  • the processing shifts to the processing in FIG.
  • the large page management mechanism 102 increases the number of diverted pages of the non-reserved large page management information by the number of diverted pages (step S35). Further, the large page management mechanism 102 performs a process of dividing the large page assigned in step S33 into normal pages (step S37). Specifically, the page management information of each normal page is accumulated by dividing the large pages that have been allocated in order, until the required number of pages is reached, divided by the normal page size. In some cases, normal pages can be generated beyond the number of requested pages. Similarly, in this case, page management information for each normal page is stored as page management information for surplus normal pages, separated by the normal page size. To do. This is because it is registered in the normal page pool later.
  • the large page management mechanism 102 outputs a page allocation result including the top physical addresses of normal pages for the number of allocated requested pages to the normal page management mechanism 101 (step S39).
  • the normal page management mechanism 101 receives a page allocation result including the top physical addresses of normal pages for the number of requested pages allocated from the large page management mechanism 102 (step S41), and in the normal page management information of the normal page pool 106 The total number of pages and the number of allocated pages are increased by the number of requested pages.
  • the normal page management mechanism 101 outputs a page allocation result including information on the top physical address of the normal page included in the received page allocation result to the page allocation mechanism 103 (step S43).
  • the page allocation mechanism 103 receives the page allocation result from the normal page management mechanism 101 (step S45), and allows the requesting application or the like to use the allocated normal page. Since this process is the same as that of the prior art, further explanation is omitted.
  • the large page management mechanism 102 determines whether or not normal pages exceeding the requested number of pages have been generated (step S47). If a normal page having the same number of pages as the requested number of pages is generated in step S37, no further processing is necessary, and the processing is terminated.
  • the large page management mechanism 102 outputs the above-described first physical address of the surplus normal page to the normal page management mechanism 101 (step S49).
  • the normal page management mechanism 101 receives the information of the head physical address of the surplus normal page from the large page management mechanism 102 (step S50). Then, the normal page management mechanism 101 adds page management information corresponding to the address of the received surplus normal page to the page list in the normal page management information (step S51). Further, the normal page management mechanism 101 adds the number of surplus normal pages to the total number of pages and the number of empty pages in the normal page management information (step S53).
  • the page release mechanism 104 is a release page list that is a list of the number of released pages of normal pages and the start physical address of the normal page to be released in response to the release by an application or the like or the occurrence of another normal page release event. Is output to the normal page management mechanism 101 (FIG. 11: step S61). Since this step is the same as the conventional one, further explanation is omitted.
  • the normal page management mechanism 101 receives a page release request including the number of released pages of the normal page and the release page list from the page release mechanism 104 (step S63). Then, the normal page management mechanism 101 registers the page management information of the normal pages included in the received release page list in the page list in the normal page management information of the normal page pool 106 (step S65). Further, the normal page management mechanism 101 decreases the number of allocated pages in the normal page management information by the number of released pages, and further increases the number of free pages by the number of released pages (step S67).
  • the normal page management mechanism 101 acquires the number of diverted pages in the non-reserved large page management information of the non-reserved large page pool 107 from, for example, the large page management mechanism 102, and confirms whether the acquired number of diverted pages is 0 ( Step S69).
  • the normal page management mechanism 101 may directly access the number of diverted pages in the non-reserved large page management information.
  • the normal page management mechanism 101 scans the page list in the normal page management information of the normal page pool 106, and determines whether the number of consecutive free normal pages is equal to or greater than the diversion threshold in the normal page management information of the normal page pool 106. Confirm (step S71). Instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, it may be checked whether there are continuous free normal pages for the large page size. Also, when checking whether there are continuous free normal pages for the large page size, it is checked whether there are free normal pages that are continuous for one large page, but it is continuous for two pages or more. It may be confirmed whether there is an empty normal page.
  • step S73 If there is no continuous free page or if the continuous free normal page is less than the diversion threshold in the normal page management information (step S73: Yes route), the process ends here.
  • step S71 instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, when checking whether there are continuous free normal pages for the large page size, When there are no consecutive free normal pages, the process cannot be returned to the non-reserved large page pool 107, and the process ends here.
  • step S73 No route
  • the normal page management mechanism 101 uses the normal page management information.
  • the number of empty pages and the total number of pages are reduced by the number of normal pages that are returned (step S75).
  • step S71 instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, when checking whether there are continuous free normal pages for the large page size, When there are consecutive free normal pages, the normal page management mechanism 101 reduces the number of empty pages and the total number of pages in the normal page management information by the number of normal pages for return.
  • the normal page management mechanism 101 extracts a list of empty normal pages having continuous large page sizes from the page list in the normal page management information (step S76).
  • the list of free normal pages is a list of the top physical addresses of continuous free normal pages having a large page size.
  • the normal page management mechanism 101 outputs a list of empty normal pages having continuous large page sizes to the large page management mechanism 102 (step S77).
  • the large page management mechanism 102 receives a list of continuous free normal pages having a large page size from the normal page management mechanism 101 (step S79), and converts the free normal page into a large page (step S81). That is, continuous empty normal pages are handled as continuous areas.
  • the processing shifts to the processing in FIG.
  • the large page management mechanism 102 registers the top physical address of the generated large page in the page list in the non-reserved large page management information of the non-reserved large page pool 107 (step S83). In addition, the large page management mechanism 102 reduces the number of diverted pages in the non-reserved large page management information by the number of returned pages (“1” in the above example, although it may be “2” or more). Step S85). Further, the large page management mechanism 102 increases the number of empty pages in the non-reserved large page management information by the number of returned pages (step S87). Then, the process ends.
  • the large page management mechanism 102 allocates free pages from the non-reserved large page pool 107 as usual. If the request is from a calculation job or the like, free pages are allocated from the reserved large page pool 108 as usual. Therefore, further description of the request for large pages is omitted.
  • the normal page management method includes the method described below in addition to the method described above.
  • FIG. 14 shows a computer 200 according to the present embodiment.
  • the computer 200 includes a normal page management mechanism 201, a large page management mechanism 102, a page allocation mechanism 103, a page release mechanism 104, a buddy page pool 206, a non-reserved large page pool 107, and a reserved large page pool 108. And have.
  • the same reference numerals are given to functions similar to those of the computer 100 shown in FIG. That is, the normal page management mechanism 201 and the buddy page pool 206 are different parts from the first embodiment.
  • the buddy page pool 206 is different from the normal page pool 106 in the management mode of empty pages.
  • empty pages are managed in units of powers of 2 (referred to as buddies). That is, if the power is 2 to the power of “0”, one empty page is managed, and in the buddy page pool 206, the empty pages 2061a to 2061e are managed in the order of physical addresses. If the power is 2 to the power of “1”, two consecutive empty pages are managed. In the buddy page pool 206, two consecutive empty pages 2062a to 2062d are managed in the order of physical addresses. Further, if 2 is the power of “2”, four consecutive pages are managed. In the buddy page pool 206, four consecutive empty pages 2063a to 2063c are managed in the order of the top physical address.
  • FIG. 15 shows the management state of the buddy page pool 206 in more detail.
  • the buddy page pool 206 is introduced to prevent memory fragmentation (thrashing) in units of pages based on the rule of thumb that many page allocation requests in the system are made in units of powers of 2. .
  • the start physical address of the free page of every two 0 pages are registered in the list of free_list [0]. For example, if the size of one page is 8 Kbytes, a page for every 8 Kbytes is registered.
  • top physical address of a free page of every 2 2 pages are registered in the list of free_list [2].
  • 8 Kbytes ⁇ 4 continuous 32 Kbytes of data can be stored.
  • the top physical address of a free page of every 2 3 page is registered in the list of free_list [3].
  • data of up to 8 Kbytes ⁇ 8 continuous 64 Kbytes can be stored.
  • top physical address of a free page of every 2 4 page is registered in the list of free_list [4].
  • 8 Kbytes ⁇ 16 continuous 128 Kbytes of data can be stored.
  • the head physical address of the empty page for every 25 pages is registered in a list called free_list [5].
  • the buddy page pool 206 can handle page allocation and release in consecutive page units.
  • the method of searching for continuous free pages that satisfy the requested number of pages differs depending on the management method of the buddy page pool 206. That is, a search is made for a continuous free page having the smallest power of 2 that is equal to or greater than the number of requested pages, and allocation is performed from the continuous free pages. If there is no continuous free page that is equal to or greater than the requested number of pages, as in the first embodiment, a large page is converted to a normal page and handled.
  • the page release mechanism 104 includes the number of released pages of normal pages and a released page list that is a list of the first physical addresses of normal pages to be released in response to release by an application or the like or occurrence of another normal page release event.
  • a page release request is output to the normal page management mechanism 201 (FIG. 16: step S101). Since the processing in this step is the same as the conventional one, further explanation is omitted.
  • the normal page management mechanism 201 receives a page release request including the number of released pages of the normal page and the release page list from the page release mechanism 104 (step S103). Then, the normal page management mechanism 201 performs a page return process to the buddy page pool 206 (step S105). For example, if the release page is page 2, 2 1 page page list to search for and verify contiguous pages to be linked there. If there is no page to be continuous to be consolidated, to register as it is 2 1 page of the page list. On the other hand, it will be consolidated if there is a page to be continuous to be consolidated, to search the page list of 2 page 2, to check whether the page to be continuous with the coupling exists.
  • Such processing is repeated until a continuous page is not found when connected. Also, a process for increasing the number of empty pages is performed.
  • the total number of empty pages is managed in the normal page management information. However, for example, as shown in FIG. 17, the number of empty pages is managed for each buddy. However, the number of vacancies in units of buddies may be managed.
  • step S105 the normal page management mechanism 201 confirms whether the final return destination buddy size matches the large page and the number of diverted pages is 1 or more (step S107).
  • the normal page management mechanism 201 acquires, for example, the number of diverted pages in the non-reserved large page management information of the non-reserved large page pool 107 from the large page management mechanism 102 or the non-reserved large page management information of the non-reserved large page pool 107 Get directly accessed the number of diverted pages in. If either the condition that the final return destination buddy size matches the large page or the condition that the number of diverted pages is 1 or more is not satisfied, the process ends.
  • the normal page management mechanism 201 manages the normal page management of the buddy page pool 206.
  • the number of empty pages of buddies whose size matches the large page is subtracted by the number of return pages (step S109). Also, the total number of pages in the normal page management information is subtracted by the number of return pages. Then, the process proceeds to step S77 in FIG.
  • the buddy page pool 206 is introduced in this way, the non-reserved large page pool 107 can be introduced and the memory utilization efficiency can be increased as in the first embodiment.
  • the present technology has been described above, but the present technology is not limited to this.
  • the division of roles between the normal page management mechanism and the large page management function shown in the processing flow is merely an example, and it may be possible to change the processing subject of each step.
  • the normal page management mechanism and the large page management mechanism are integrated.
  • the computers 100 and 200 described above are information processing apparatuses such as a computer as shown in FIG. 18 as a whole, and include a memory 2501, a CPU 2503 (also referred to as a processor), and a hard disk drive (HDD: Hard Disk Drive). 2505, a display control unit 2507 connected to the display device 2509, a drive device 2513 for the removable disk 2511, an input device 2515, and a communication control unit 2517 for connecting to a network are connected by a bus 2519.
  • the operating system and the application program for executing the processing in this embodiment are stored in the HDD 2505, and are read from the HDD 2505 to the memory 2501 when executed by the CPU 2503.
  • the CPU 2503 controls the display control unit 2507, the communication control unit 2517, and the drive device 2513 according to the processing content of the application program, and performs a predetermined operation. Further, data in the middle of processing is mainly stored in the memory 2501, but may be stored in the HDD 2505. In an embodiment of the present technology, an application program for performing the above-described processing is stored in a computer-readable removable disk 2511 and distributed, and installed from the drive device 2513 to the HDD 2505. In some cases, the HDD 2505 may be installed via a network such as the Internet and the communication control unit 2517.
  • Such a computer apparatus realizes various functions as described above by organically cooperating hardware such as the CPU 2503 and memory 2501 described above and programs such as an operating system and application programs. To do.
  • the normal page management mechanism and the large page management mechanism in the present embodiment are implemented as a part of the operating system, for example. That is, it is executed by the CPU 2505 to realize the functions described above.
  • the allocation step described above includes (B1) determining whether the number of first requested pages included in the request exceeds the number of free pages in the first memory area; and (B2) first requested page. If the number exceeds the number of free pages in the first memory area, the second requested page number obtained by converting the first requested page number into the second size page number is the second in the second memory area.
  • a step of securing a page having a size of 2 and a step of (B3) dividing the secured second size page into pages of the first size and allocating them to the request by the number of first request pages. May be included. In this way, the second size page can be specifically transferred.
  • the memory management method includes (C) a step of detecting the release of a first size page, and (D) a first size of free space including the released first size page.
  • the number of continuous pages is equal to or greater than a predetermined threshold and the second size page in the second memory area is diverted as the first size page, the empty continuous page of the first size To generate a second size page and register it as a free page of the second size. If it does in this way, the page of the 2nd size which was diverted can be returned, and it can use now for the utilization of the page of the 2nd size.
  • the memory management method is generated from (E) the step of detecting the release of the first size page, and (F) the released first size page and the free continuous page that already exists. If the size of the second free continuous page is the second size and the second size page in the second memory area is diverted as the first size page, the second free continuous page
  • the method may further include a step of concatenating the pages to generate a second size page and registering it as a free page of the second size. For example, even when a buddy page pool mechanism managed with a power-of-two size is adopted, it is possible to appropriately cope with it.
  • the third memory area divided into pages of the second size may be reserved as an area dedicated to a specific job using a large page.
  • the computer has (A) a first memory area divided into pages of a first size and a second page divided into pages of a second size larger than the first size. And (B) in response to a request for a page of the first size, if there are not enough free pages in the first memory area to satisfy the request, the second memory area A memory management mechanism that divides an empty page of size 2 into pages of a first size and allocates a page of the first size in response to the request.
  • a program for causing a computer to carry out the processing described above, such as a flexible disk, an optical disk such as a CD-ROM (Compact Disk-Read Only Memory), a magneto-optical disk, and the like.
  • the data is stored in a computer-readable storage medium or storage device such as a disk, a semiconductor memory (for example, ROM), and a hard disk. Note that data being processed is temporarily stored in a storage device such as a RAM.

Abstract

This memory management method includes: a step for receiving a request for a page of a first size from an operating system; and an assignment step which, if free pages in a first memory area, which has been partitioned into pages of the first size, are insufficient to accommodate the request, partitions free pages of a second size which is larger than the first size in a second memory area, which has been partitioned into pages of the second size, into pages of the first size so as to assign the pages of the first size in response to the request. Accordingly, memory can be efficiently utilized.

Description

メモリ管理プログラム、メモリ管理方法及び情報処理装置Memory management program, memory management method, and information processing apparatus
 本技術は、メモリ管理プログラム、メモリ管理方法及び情報処理装置に関する。 The present technology relates to a memory management program, a memory management method, and an information processing apparatus.
 一般的なオペレーティングシステム(OS:Operating System)では、アプリケーションプログラム(以下、アプリケーションと略記する)へのメモリの割り当てを、アプリケーションが実際にそのメモリ領域にアクセスする時点まで遅延させる仕組みが導入されている。この仕組みはデマンドページング機構として知られており、プログラムのメモリへのローディング処理によるオーバヘッドを軽減し、システムの応答性能を向上させることができる。 A general operating system (OS: Operating System) introduces a mechanism for delaying the allocation of memory to an application program (hereinafter abbreviated as application) until the application actually accesses the memory area. . This mechanism is known as a demand paging mechanism, which can reduce the overhead due to the loading process of the program into the memory and improve the response performance of the system.
 これは、UNIX(商標登録)等の汎用オペレーティングシステムでは、主にシェル等の対話型ジョブを実行させることが多いため、利用者からみた体感的な応答性が重視されるためである。 This is because, in general-purpose operating systems such as UNIX (registered trademark), interactive jobs such as shells are mainly executed, and thus, responsiveness from the user's perspective is important.
 このため、このような汎用オペレーティングシステムでは、メモリ割り当ての可否、すなわち要求されたメモリの割り当てが可能な空きメモリがシステムに存在することを確認する処理は、実際のメモリアクセスによってメモリの割り付けが行われる時点で実施される。 For this reason, in such a general-purpose operating system, the process of confirming whether or not memory allocation is possible, that is, the process of confirming that free memory to which the requested memory can be allocated exists in the system is performed by actual memory access. Will be implemented at the time.
 これに対し科学技術計算を行うようなHPC(High Performance Computing)環境では、以下のようなメモリ管理を行う。
(1)アプリケーション(計算ジョブ)実行開始前にメモリの割り当てを行った上で、アプリケーションの実行を開始する(メモリ資源の事前割当て)。
(2)アプリケーションに割り当て可能なメモリ領域を予約する(メモリ資源の事前予約)。
(3)大規模データを扱う場合におけるオペレーティングシステムによるオーバヘッドを低減するために、仮想アドレスと物理アドレス間のアドレス変換を行なう粒度(すなわちページサイズ)を通常のメモリより大きな粒度にする。オペレーティングシステムやCPU(Central Processing Unit)によって様々な呼び方があるが、ここでは、オペレーティングシステムやCPUのアドレス変換機構においてサポートする最小サイズのページをノーマルページと呼び、最小サイズ以外のサイズのページをラージページと呼ぶことにする。
On the other hand, the following memory management is performed in an HPC (High Performance Computing) environment where scientific and technical calculations are performed.
(1) Memory is allocated before execution of an application (calculation job) is started, and then execution of the application is started (pre-allocation of memory resources).
(2) Reserve a memory area that can be allocated to an application (pre-reservation of memory resources).
(3) In order to reduce the overhead caused by the operating system when handling large-scale data, the granularity for performing address translation between the virtual address and the physical address (that is, the page size) is made larger than that of a normal memory. There are various names depending on the operating system and CPU (Central Processing Unit). Here, the minimum size page supported by the address conversion mechanism of the operating system and CPU is called a normal page, and a page with a size other than the minimum size is called here. It will be called a large page.
 アドレス変換を行なうページサイズを通常のページサイズより大きなサイズにする理由は、主に以下の理由による。
(1)大規模データへの効率的なアクセスの実現
 仮想メモリを扱う近年のシステムの場合、上述したCPU内部にMMU(Memory Management Unit)等のメモリ管理ハードウエア機構及びオペレーティングシステム内部に仮想アドレスと物理アドレスとの対応関係を管理する仕組みが備えられている。大規模データを扱う場合、アドレス変換の粒度が細かいと、オペレーティングシステムによるアドレス変換処理の発生回数が増加し、アプリケーションの実行時のオーバヘッドとなり得る。このため、複数のページをまとめてアドレス変換することで、アドレス変換によるオーバヘッドの軽減を行う。
(2)計算ジョブの実行効率向上
 計算ジョブの実行中にオペレーティングシステムによる、計算ジョブのCPU時間、キャッシュ等の各種資源の横取りを抑止又は軽減することで、計算ジョブの実行効率を向上させ、メモリを事前に割り当てるようにしている。
(3)メモリ割り当て失敗によるジョブ再投入の抑止
 バッチシステム等によって投入された計算ジョブは、長時間の実行を継続することが多いため、長時間の実行によるメモリ不足が発生した場合には異常終了を引き起こし、計算処理をやり直す場合の時間的及び金銭的コストが高くつく。そのため、システムの起動時にジョブが使用する分のメモリを予め予約するようになっている。
The reason why the page size for address conversion is larger than the normal page size is mainly due to the following reason.
(1) Realization of efficient access to large-scale data In recent systems that handle virtual memory, a memory management hardware mechanism such as an MMU (Memory Management Unit) in the CPU described above and a virtual address in the operating system. A mechanism for managing the correspondence relationship with the physical address is provided. When handling large-scale data, if the granularity of address translation is fine, the number of address translation processes generated by the operating system increases, which can be an overhead when executing an application. For this reason, overhead is reduced by address conversion by collectively converting a plurality of pages.
(2) Improving the execution efficiency of a calculation job By suppressing or reducing the preemption of various resources such as the CPU time and cache of the calculation job by the operating system during the execution of the calculation job, the execution efficiency of the calculation job is improved and the memory Is assigned in advance.
(3) Suppression of job re-submission due to memory allocation failure Calculation jobs submitted by a batch system or the like often continue long-term execution, so abnormal termination occurs when memory shortage occurs due to long-term execution And the time and money costs for redoing the calculation process are high. For this reason, the memory used by the job is reserved in advance when the system is started.
 このため、例えばHPC環境では、計算ジョブが使用するメモリ領域をシステムの起動時に予約し、対話型プロセス等が使用するメモリ領域と独立して管理することで、対話型プロセスによって、計算ジョブ用のメモリ資源が計算ジョブ用以外の対話型プロセス等に消費されないことを保証する仕組みを採用している場合がある。図1(a)に示すように、システム起動直後は、メモリの全ての領域を対話型プロセスに割り当てて当該対話型プロセスのための領域aとして用いる。一方、図1(b)に示すように、計算ジョブを実行する場合には、計算ジョブにもメモリの領域bを割り当てて、対話型プロセスのための領域aは削減される。領域bは、ラージページとして使用する領域であり、領域aは、ノーマルページとして使用する領域である。 For this reason, for example, in an HPC environment, a memory area used by a calculation job is reserved at system startup, and managed independently from the memory area used by an interactive process or the like. There is a case where a mechanism for guaranteeing that the memory resource is not consumed by an interactive process other than for a calculation job may be employed. As shown in FIG. 1A, immediately after the system is started, the entire memory area is allocated to the interactive process and used as the area a for the interactive process. On the other hand, as shown in FIG. 1B, when a calculation job is executed, a memory area b is also allocated to the calculation job, and the area a for the interactive process is reduced. The area b is an area used as a large page, and the area a is an area used as a normal page.
 また、Linuxにおいても、HugeTLBFS(Huge Translation Lookaside Buffer File System)というメモリ管理機構が用いられる。 Also in Linux, a memory management mechanism called HugeTLBFS (Huge Translation Lookaside Buffer File System) is used.
 このHugeTLBFSは、例えばHPC環境で動作し且つ大規模データを扱う計算ジョブにデータ格納領域を割り当てるためのラージページメモリ管理機構である。HugeTLBFSにより管理されるメモリ(ラージページ)は、アドレス変換の粒度が通常のメモリ(ノーマルページ)におけるアドレス変換の粒度より大きく設定されるため、通常のメモリより小さいオーバヘッドでアクセスすることができる。このため、数値計算ジョブ等の、大規模データを扱うプログラムでは、HugeTLBFSを用いてメモリ割り当てを行う。 This HugeTLBFS is a large page memory management mechanism for allocating a data storage area to a calculation job that operates in an HPC environment and handles large-scale data, for example. The memory (large page) managed by HugeTLBFS can be accessed with an overhead smaller than that of a normal memory because the granularity of address conversion is set larger than the granularity of address conversion in a normal memory (normal page). For this reason, programs that handle large-scale data, such as numerical computation jobs, allocate memory using HugeTLBFS.
 HugeTLBFSを実現するために、Linuxでは、大きく分けて、2種類のメモリプールを具備している。
(1)ノーマルページプール
 主に対話動作を行うプロセスから使用されるメモリ領域
(2)HugeTLBFSページプール
 数値計算ジョブなどに使用されるメモリ領域
In order to realize HugeTLBFS, Linux is roughly divided into two types of memory pools.
(1) Normal page pool Memory area used mainly by processes that perform interactive operations (2) HugeTLBFS page pool Memory area used for numerical calculation jobs, etc.
 HugeTLBFSを使用する場合、システムの起動時にシステム管理者によって、計算ジョブ用のデータ領域(すなわちHugeTLBFSの管理下で管理されるメモリ領域)として使用可能なメモリ量を設定する。このとき、Linuxは、システムに搭載されたメモリから管理者が設定した分量のメモリをノーマルページプールからHugeTLBFSページプールに移行させ、以降の処理では、両者のページプールは独立に管理される。すなわち、シェルなどの対話プロセスが、HugeTLBFSページプール内のメモリを使用することがないように、当該HugeTLBFSページプール内のメモリが予約されることとなる。これは、計算ジョブが大規模データを使用した計算処理を行うために使用するメモリ領域を予約しておくことで、確実にメモリが使用可能であることを保証するためである。 When using HugeTLBFS, the amount of memory that can be used as a data area for calculation jobs (ie, a memory area managed under the control of HugeTLBFS) is set by the system administrator at system startup. At this time, Linux shifts the amount of memory set by the administrator from the memory installed in the system from the normal page pool to the HugeTLBFS page pool, and both page pools are managed independently in the subsequent processing. That is, the memory in the HugeTLBFS page pool is reserved so that an interactive process such as a shell does not use the memory in the HugeTLBFS page pool. This is to ensure that the memory can be used reliably by reserving a memory area that is used by the calculation job to perform calculation processing using large-scale data.
 近年、FreeBSDなどのネットワークサーバ用途で使用されるOSでもラージページを使用する機能が搭載されつつある。このようなシステムでは、ユーザにラージページの存在を意識させることなくページ割り当てを行うことで管理者の手間を軽減しつつ、ラージページを利用させることを目的としたラージページ機構を搭載している。 In recent years, an OS used for a network server application such as FreeBSD has been equipped with a function for using a large page. Such a system is equipped with a large page mechanism designed to allow large pages to be used while reducing the administrator's effort by allocating pages without making the user aware of the presence of large pages. .
 例えばFreeBSDでは、アプリケーションからのメモリ獲得要求量を基に、当該メモリ獲得要求量を格納可能な最小サイズのラージページを自動的に算出し割り当てる。 For example, in FreeBSD, based on the memory acquisition request amount from the application, a large page of the minimum size that can store the memory acquisition request amount is automatically calculated and assigned.
 しかしながら、プログラムによっては、小さい配列を複数獲得し、配列間で相互にデータをやり取りすることで動作するプログラムもある。このとき、小さいメモリを複数回獲得することによってメモリの断片化が発生し、後により大きいサイズのラージページが使用できなくなる問題がある。以上のように、既存技術を用いたシステムでは、ラージページを主に使用する大規模計算プログラムと小さいメモリを多く使用する(すなわち、ノーマルページを使用する)対話型プロセスを動かす場合とで、環境設定を変更しなければならないため、大規模クラスタでの利用の場合、運用管理に大きな手間がかかるという問題がある。 However, some programs operate by acquiring multiple small arrays and exchanging data between the arrays. At this time, memory fragmentation occurs by acquiring a small memory a plurality of times, and there is a problem that a large page having a larger size cannot be used later. As described above, in the system using the existing technology, there is a case where a large-scale calculation program mainly using large pages and an interactive process using a lot of small memory (that is, using normal pages) are run. Since the setting must be changed, there is a problem that operation management takes a lot of work when used in a large-scale cluster.
特開平1-17137号公報Japanese Patent Laid-Open No. 1-17137
 従来では、ラージページとノーマルページの配分については特別な考察はなされておらず、ラージページとノーマルページとを混在させることができたとしても、効率的なメモリ利用が可能となっていない場合もある。例えば、ノーマルページのメモリ領域が多すぎれば数値計算ジョブ用のラージページのメモリ領域が不足したり、ラージページのメモリ領域が多すぎれば対話プロセスのためのノーマルページのメモリ領域が不足したりする事態が生じうる。システム上で動作させるアプリケーションの種別や組み合わせは、システムの用途やシステム運用中の要件に応じて変化し得るため、このような事態を事前に回避して配分を一律に決定することは困難である。 Conventionally, no special consideration has been given to the distribution of large pages and normal pages, and even if large pages and normal pages can be mixed, efficient memory use may not be possible. is there. For example, if there are too many normal page memory areas, there will be insufficient large page memory areas for numerical jobs, and if there are too many large page memory areas, there will be insufficient normal page memory areas for interactive processes. Things can happen. The types and combinations of applications that run on the system can change depending on the purpose of the system and requirements during system operation, so it is difficult to avoid such a situation in advance and determine the distribution uniformly. .
 従って、本技術の目的は、第1のサイズのページと第1のサイズより大きい第2のサイズのページとを効率的に利用できるようにするための技術を提供することである。 Accordingly, an object of the present technology is to provide a technology for efficiently using a first size page and a second size page larger than the first size.
 本メモリ管理方法は、(A)第1のサイズのページの要求をオペレーティングシステムから受け取るステップと、(B)第1のサイズのページに分割されている第1のメモリ領域における空きページが上記要求に応じるには不足する場合、第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域における第2のサイズの空きページを第1のサイズのページに分割して、上記要求に対して第1のサイズのページを割り当てる割当ステップとを含む。 The memory management method includes (A) a step of receiving a request for a first size page from the operating system, and (B) a free page in a first memory area divided into pages of the first size. If it is insufficient to meet the requirement, the empty page of the second size in the second memory area divided into the second size page larger than the first size is divided into the first size page, Allocating a first size page for the request.
図1は、従来のメモリ割り当てを説明するための図である。FIG. 1 is a diagram for explaining conventional memory allocation. 図2は、実施の形態におけるメモリ配分の一例を示す図である。FIG. 2 is a diagram illustrating an example of memory allocation in the embodiment. 図3(a)乃至(c)は、メモリ領域の転用について説明するための図である。FIGS. 3A to 3C are diagrams for explaining the diversion of the memory area. 図4は、第1の実施の形態に係るコンピュータの機能ブロック図である。FIG. 4 is a functional block diagram of the computer according to the first embodiment. 図5は、非予約ラージページ管理情報を説明するための図である。FIG. 5 is a diagram for explaining non-reserved large page management information. 図6は、予約ラージページ管理情報を説明するための図である。FIG. 6 is a diagram for explaining reservation large page management information. 図7は、ノーマルページ管理情報を説明するための図である。FIG. 7 is a diagram for explaining normal page management information. 図8は、第1の実施の形態に係るページ割当処理の処理フローを示す図である。FIG. 8 is a diagram showing a processing flow of page allocation processing according to the first embodiment. 図9は、第1の実施の形態に係るページ割当処理の処理フローを示す図である。FIG. 9 is a diagram illustrating a processing flow of the page allocation processing according to the first embodiment. 図10は、第1の実施の形態に係るページ割当処理の処理フローを示す図である。FIG. 10 is a diagram illustrating a processing flow of the page allocation processing according to the first embodiment. 図11は、第1の実施の形態に係るページ解放処理の処理フローを示す図である。FIG. 11 is a diagram illustrating a processing flow of the page release processing according to the first embodiment. 図12は、第1の実施の形態に係るページ解放処理の処理フローを示す図である。FIG. 12 is a diagram illustrating a processing flow of the page release processing according to the first embodiment. 図13は、第1の実施の形態に係るページ解放処理の処理フローを示す図である。FIG. 13 is a diagram illustrating a processing flow of the page release processing according to the first embodiment. 図14は、第2の実施の形態に係るコンピュータの機能ブロック図である。FIG. 14 is a functional block diagram of a computer according to the second embodiment. 図15は、バディページプールを説明するための図である。FIG. 15 is a diagram for explaining a buddy page pool. 図16は、第2の実施の形態に係るページ解放処理の処理フローを示す図である。FIG. 16 is a diagram illustrating a processing flow of the page release processing according to the second embodiment. 図17は、バディページプールのノーマルページ管理情報を説明するための図である。FIG. 17 is a diagram for explaining normal page management information of a buddy page pool. 図18は、コンピュータの機能ブロック図である。FIG. 18 is a functional block diagram of a computer.
 図2に、本技術の一実施の形態に係るメモリの配分の一例を示す。本実施の形態では、オペレーティングシステム等がサポートするページサイズのうち最小のサイズのページ用(ここではノーマルページと呼ぶ。但し、必ずしも最小のサイズのページをノーマルページに設定しない場合もある。)に分割管理される領域Aと、ノーマルページのサイズより大きいサイズのページ(ラージページと呼ぶ)に分割管理される領域B及びCとを含む。ラージページ用に分割されている領域Cは、ラージページを用いる特定のアプリケーション等のために予約された領域であって、当該領域内の空きラージページは予約付きラージページプールに登録される。一方、原則として、ラージページに分割されている領域Bは、ラージページを用いるアプリケーション等にもノーマルページを用いるアプリケーション等にも用いられる領域であって、当該領域内の空きラージページは非予約ラージページプールに登録される。領域Bのラージページは、ラージページを用いるアプリケーション等にもラージページのまま割り当てられるが、領域Aにおけるノーマルページが不足する場合には当該領域Bにおける空きラージページをノーマルページのサイズに分割してノーマルページを用いるアプリケーション等に割り当てる場合もある。ノーマルページに分割されている領域Aは、対話型プロセスのようなノーマルページを用いるアプリケーション等によって利用される領域であり、当該領域内における空きノーマルページはノーマルページプールに登録される。 FIG. 2 shows an example of memory allocation according to an embodiment of the present technology. In the present embodiment, it is used for a page having the minimum size among the page sizes supported by the operating system or the like (referred to as a normal page here, but the page having the minimum size is not necessarily set as a normal page). An area A that is divided and managed, and areas B and C that are divided and managed into a page having a size larger than that of a normal page (called a large page) are included. The area C divided for the large page is an area reserved for a specific application or the like using the large page, and an empty large page in the area is registered in the reserved large page pool. On the other hand, as a general rule, the area B divided into large pages is an area used for applications that use large pages and applications that use normal pages, and empty large pages in the areas are unreserved large pages. Registered in the page pool. Large pages in area B are allocated as large pages to applications that use large pages, but if there are not enough normal pages in area A, the large pages in area B are divided into normal page sizes. In some cases, it is assigned to an application using a normal page. The area A divided into normal pages is an area used by an application using a normal page such as an interactive process, and free normal pages in the area are registered in the normal page pool.
 図3を用いて領域Bの用い方について簡単に説明しておく。図3(a)に示すように、ページの不足が生じていない平常時には図2と同様の状態であり、ノーマルページの領域A並びにラージページの領域B及びCそれぞれでページ割り当てを実施する。領域Cにおける予約ラージページプール内の空きラージページについては、予約に係る特定のアプリケーション等によって要求があれば、割り当てられる。領域Bにおける非予約ラージページプール内の空きラージページについては、ラージページを用いるアプリケーション等によって要求があれば、割り当てられる。また、領域Aにおけるノーマルページプール内の空きノーマルページについては、ノーマルページを用いるアプリケーション等によって要求があれば、割り当てられる。それぞれの領域についてページの解放があった場合には、それぞれの元の領域のプールに戻される。 The use of the region B will be briefly described with reference to FIG. As shown in FIG. 3A, in a normal state in which there is no shortage of pages, the state is the same as in FIG. 2, and page allocation is performed in each of the normal page area A and the large page areas B and C. An empty large page in the reserved large page pool in area C is allocated if requested by a specific application related to the reservation. An empty large page in the non-reserved large page pool in area B is allocated if requested by an application using the large page. In addition, an empty normal page in the normal page pool in the area A is allocated if requested by an application using the normal page. When a page is released for each area, it is returned to the pool of each original area.
 これに対して、例えば対話型ジョブ等によってノーマルページの領域Aの大量消費が発生すると、ノーマルページの領域Aが不足する。この場合、図3(b)に示すように、非予約ラージページプールの領域B内の空きラージページをノーマルページ用の領域として分割してノーマルページのための領域Aとして用いる。図3(b)の矢印で模式的に示すように、領域Bの一部が領域Aに転用されることになる。これによって、ノーマルページの使用量が増加した場合にも、ノーマルページの割当を行なうことができるため、シェル等の対話型ジョブ等を多数起動するようなことも可能になり、また応答性も向上する。大規模メモリを使用するような用途のために、ラージページの予約も行える。すなわち、数値計算ジョブ等には影響を与えることなく、大規模データに高速にアクセス可能な状態を維持することが可能となる。 On the other hand, for example, when a large amount of normal page area A occurs due to an interactive job, the normal page area A becomes insufficient. In this case, as shown in FIG. 3B, an empty large page in the area B of the non-reserved large page pool is divided as a normal page area and used as an area A for normal pages. A part of the region B is diverted to the region A as schematically shown by the arrow in FIG. As a result, normal pages can be allocated even when the usage of normal pages increases, so it is possible to start many interactive jobs such as shells and improve responsiveness. To do. Large pages can be reserved for applications that use large memory. That is, it is possible to maintain a state in which large-scale data can be accessed at high speed without affecting the numerical calculation job or the like.
 なお、対話型ジョブ等によるノーマルページの大量消費が終了してノーマルページの解放が発生すれば、図3(c)に示すように、解放されたノーマルページとして利用してきたラージページを復元して非予約ラージページプールの領域に戻す。すなわち、図3(c)の矢印で模式的に示すように、ノーマルページ用の領域Aへの転用を止めてラージページを復元した上で転用した分だけ領域Bに戻す。これによって、ラージページを用いるアプリケーションも、非予約ラージページプール内のラージページに割り当てられた空き領域を十分に利用することができるようになる。アプリケーションが必要とした時点で、非予約ラージページプール内のラージページを利用することができる。これは、ラージページを使用するアプリケーションの算出結果を集計するなどの処理をノーマルページを使用するアプリケーションで行うような場合に有効である。 If a normal page is released after a large amount of normal pages is consumed by an interactive job or the like, the large page used as the released normal page is restored as shown in FIG. Return to the non-reserved large page pool area. That is, as schematically shown by an arrow in FIG. 3C, the diversion to the normal page area A is stopped, the large page is restored, and the diversion is returned to the area B. As a result, an application using a large page can sufficiently use the free area allocated to the large page in the non-reserved large page pool. Large pages in the non-reserved large page pool can be used when needed by the application. This is effective when processing such as aggregating calculation results of applications that use large pages is performed by an application that uses normal pages.
 このように領域Bを導入して非予約ラージページプール内のラージページに割り当てられた空き領域を状況に応じてラージページ又はノーマルページとして動的に割り当てることによって、柔軟にメモリ要求に対して応じることができるようになる。すなわち、メモリの利用効率が向上する。 In this way, the area B is introduced and the free area allocated to the large page in the non-reserved large page pool is dynamically allocated as a large page or a normal page depending on the situation, thereby flexibly responding to the memory request. Will be able to. That is, the memory utilization efficiency is improved.
 また、以下2点をシステムの再起動や動作パラメタの再設定を行うことなく両立させることができる。すなわち、(1)対話型ジョブ等のメモリ消費量を事前に見積らなくともよい。(2)(1)の条件下でラージページを使用する計算ジョブ等による高速な大規模メモリアクセスを行うことができる。 Also, the following two points can be made compatible without restarting the system or resetting operating parameters. That is, (1) it is not necessary to estimate the memory consumption of an interactive job or the like in advance. (2) High-speed large-scale memory access can be performed by a calculation job using a large page under the conditions of (1).
 特に、並列計算環境では、複数のノードが連携して計算処理を実施するため、システムパラメタの再設定を行う場合、複数のノードを設定し直さなければならない。近年のHPC環境は数千ノード以上から構成されるため、再設定にかかるコストを軽減するうえで、上記の手法は有用である。 In particular, in a parallel computing environment, a plurality of nodes perform calculation processing in cooperation, so when resetting system parameters, it is necessary to reset a plurality of nodes. Since the recent HPC environment is composed of several thousand nodes or more, the above method is useful for reducing the cost for reconfiguration.
[実施の形態1]
 次に、上で述べたような動作を実施するための、第1の実施の形態における構成について、図4乃至図17を用いて説明する。コンピュータ100は、ノーマルページ管理機構101と、ラージページ管理機構102と、ページ割当機構103と、ページ解放機構104と、ノーマルページプール106と、非予約ラージページプール107と、予約付きラージページプール108とを有する。図4において、予約付きラージページプール108には、ラージページ108a乃至108cが登録されており、非予約ラージページプール107には、ラージページ107a及び107bが登録されており、ノーマルページプール106には、ノーマルページ106a乃至106hが登録されている様子をそれぞれ示している。登録されるページの数は任意であり、図4に示したページの登録の態様は一例である。
[Embodiment 1]
Next, a configuration in the first embodiment for performing the operation as described above will be described with reference to FIGS. The computer 100 includes a normal page management mechanism 101, a large page management mechanism 102, a page allocation mechanism 103, a page release mechanism 104, a normal page pool 106, a non-reserved large page pool 107, and a reserved large page pool 108. And have. In FIG. 4, large pages 108 a to 108 c are registered in the reserved large page pool 108, large pages 107 a and 107 b are registered in the non-reserved large page pool 107, and the normal page pool 106 is registered. , Normal pages 106a to 106h are respectively registered. The number of pages to be registered is arbitrary, and the mode of page registration shown in FIG. 4 is an example.
 ページ割当機構103は、ページ割当ハンドラとも呼ばれ、コンピュータ100のオペレーティングシステムのカーネルに含まれる。 The page allocation mechanism 103 is also called a page allocation handler, and is included in the kernel of the operating system of the computer 100.
 また、非予約ラージページプール107には、例えば図5に示すような非予約ラージページ管理情報が格納されている。非予約ラージページ管理情報は、非予約ラージページの総ページ数と、割当済みページ数と、空きページ数と、転用ページ数と、ページリストとをそれぞれ含む。総ページ数は、割当済みページ数と空きページ数と転用ページ数との合計値である。割当済みページ数は、ラージページを用いるアプリケーション等に割り当てたページのページ数である。空きページ数は、未割り当てページのページ数である。転用ページ数は、ノーマルページに転用したページのページ数である。ページリストは、非予約ラージページプール107で管理される空きページのリストであり、各空きページは例えば先頭物理アドレスの順番でソートされる。 The non-reserved large page pool 107 stores non-reserved large page management information as shown in FIG. 5, for example. The non-reserved large page management information includes the total number of non-reserved large pages, the number of allocated pages, the number of free pages, the number of diverted pages, and the page list. The total number of pages is a total value of the number of allocated pages, the number of empty pages, and the number of diverted pages. The number of allocated pages is the number of pages allocated to an application using a large page. The number of free pages is the number of unallocated pages. The number of diverted pages is the number of pages that have been diverted to normal pages. The page list is a list of free pages managed by the non-reserved large page pool 107, and each free page is sorted in the order of the top physical address, for example.
 さらに、予約付きラージページプール108には、例えば図6に示すような予約ラージページ管理情報が格納されている。予約ラージページ管理情報は、予約ラージページの総ページ数と、割当済みページ数と、空きページ数と、ページリストとをそれぞれ含む。総ページ数は、割当済みページ数と空ページ数との合計値である。割当済みページ数は、ラージページを用いる計算ジョブ等のみに割り当てられたページのページ数である。空きページ数は、未割当ページのページ数である。ページリストは、予約付きラージページプール108で管理される空きページのリストであり、各空きページは例えば先頭物理アドレスの順番でソートされる。なお、ページ数の代わりに、ページ数に対応するメモリサイズを用いても良い。 Furthermore, the reserved large page pool 108 stores reserved large page management information as shown in FIG. 6, for example. The reserved large page management information includes the total number of reserved large pages, the number of allocated pages, the number of empty pages, and a page list. The total number of pages is a total value of the number of allocated pages and the number of empty pages. The number of allocated pages is the number of pages allocated only to a calculation job using a large page. The number of empty pages is the number of unallocated pages. The page list is a list of free pages managed in the reserved large page pool 108, and each free page is sorted in the order of the top physical address, for example. Note that a memory size corresponding to the number of pages may be used instead of the number of pages.
 また、ノーマルページプール106には、例えば図7に示すようなノーマルページ管理情報が格納されている。ノーマルページ管理情報は、ノーマルページの総ページ数と、割当済みページ数と、空きページ数と、ページリストと、転用閾値とを含む。割当済みページ数は、ノーマルページを用いるアプリケーション等に割り当てられたページのページ数である。空きページ数は、未割当ページのページ数である。ページリストは、ノーマルページプール106で管理される空きページのリストであり、各空きページは例えば先頭物理アドレスの順番でソートされる。また、転用閾値は、ノーマルページに転用されたラージページがある場合に、連続する空きノーマルページをラージページに変換して返却する際の連続空きノーマルページのページ数の閾値である。転用閾値は、(ラージページのサイズ)/(ノーマルページのサイズ)であってもよいし、それより大きい値であってもよい。 In addition, normal page management information as shown in FIG. 7 is stored in the normal page pool 106, for example. The normal page management information includes the total number of normal pages, the number of allocated pages, the number of empty pages, a page list, and a diversion threshold. The number of allocated pages is the number of pages allocated to an application that uses normal pages. The number of empty pages is the number of unallocated pages. The page list is a list of free pages managed in the normal page pool 106, and each free page is sorted in the order of the top physical address, for example. The diversion threshold value is a threshold value for the number of continuous free normal pages when a continuous free normal page is converted into a large page and returned when there is a large page diverted to a normal page. The diversion threshold value may be (large page size) / (normal page size) or a larger value.
 次に、図8乃至図13を用いて図4に示したコンピュータ100の動作を説明する。まず、ページ割当機構103は、アプリケーション等からの要求や他のノーマルページ割当事象の発生に応じて、ノーマルページの要求ページ数を含むページ割当要求をノーマルページ管理機構101に出力する(図8:ステップS1)。本ステップは、従来と同様であるから、これ以上の説明は省略する。 Next, the operation of the computer 100 shown in FIG. 4 will be described with reference to FIGS. First, the page allocation mechanism 103 outputs a page allocation request including the requested number of normal pages to the normal page management mechanism 101 in response to a request from an application or the like or occurrence of another normal page allocation event (FIG. 8: Step S1). Since this step is the same as the conventional one, further explanation is omitted.
 ノーマルページ管理機構101は、ページ割当機構103から、ノーマルページの要求ページ数を含むページ割当要求を受信し(ステップS3)、ノーマルページプール106のノーマルページ管理情報に含まれる、ノーマルページの空きページ数を確認する(ステップS5)。ここで、空きページ数が要求ページ数以上であれば(ステップS7:Yesルート)、通常のページ割当と同様の処理を行なう。すなわち、ノーマルページ管理機構101は、ノーマルページ管理情報において要求ページ数だけ空きページ数を減少させ、割当済みページ数を要求ページ数だけ増加させ、ノーマルページリストから要求ページ数分のノーマルページを今回の要求に割り当てる(ステップS9)。具体的には、ノーマルページリストから、要求ページ数分のノーマルページの先頭物理アドレスを読み出し、読み出した要求ページ数分のノーマルページの先頭物理アドレスをノーマルページリストから削除する。 The normal page management mechanism 101 receives a page allocation request including the number of requested pages for the normal page from the page allocation mechanism 103 (step S3), and the normal page free page included in the normal page management information of the normal page pool 106. The number is confirmed (step S5). Here, if the number of empty pages is equal to or greater than the number of requested pages (step S7: Yes route), the same processing as normal page allocation is performed. That is, the normal page management mechanism 101 reduces the number of empty pages by the number of requested pages in the normal page management information, increases the number of allocated pages by the number of requested pages, and creates normal pages for the number of requested pages from the normal page list this time. (Step S9). Specifically, the top physical addresses of normal pages for the number of requested pages are read from the normal page list, and the top physical addresses of normal pages for the number of requested pages read are deleted from the normal page list.
 そして、ノーマルページ管理機構101は、割り当てたノーマルページの先頭物理アドレスの情報を含むページ割当結果を、ページ割当機構103に出力する(ステップS11)。ページ割当機構103は、ノーマルページ管理機構101から、ページ割当結果を受信し(ステップS13)、要求元のアプリケーション等が、割り当てを受けたノーマルページを利用できるようにする。この処理についても、従来と同様であるからこれ以上の説明は省略する。 Then, the normal page management mechanism 101 outputs a page allocation result including information on the top physical address of the allocated normal page to the page allocation mechanism 103 (step S11). The page allocation mechanism 103 receives the page allocation result from the normal page management mechanism 101 (step S13), and allows the requesting application to use the allocated normal page. Since this process is the same as that of the prior art, further explanation is omitted.
 一方、空きページ数より要求ページ数が大きい場合には(ステップS7:Noルート)、現在の空きページでは要求ページに割り当てることができないので、ラージページの転用を試みることになる。具体的には、ノーマルページ管理機構101は、要求ページ数を含むページ割当要求をラージページ管理機構102に出力する(ステップS15)。これに対して、ラージページ管理機構102は、ノーマルページ管理機構101から、要求ページ数を含むページ割当要求を受信する(ステップS17)。処理は、端子Aを介して図9の処理に移行する。 On the other hand, when the number of requested pages is larger than the number of free pages (step S7: No route), since the current free page cannot be allocated to the requested page, a large page is diverted. Specifically, the normal page management mechanism 101 outputs a page allocation request including the requested number of pages to the large page management mechanism 102 (step S15). In response to this, the large page management mechanism 102 receives a page allocation request including the number of requested pages from the normal page management mechanism 101 (step S17). The processing shifts to the processing in FIG.
 図9の処理の説明に移行して、ラージページ管理機構102は、非予約ラージページのラージページ管理情報に含まれる、ラージページの空きページ数を確認する(ステップS19)。また、ラージページ管理機構102は、ラージページの空きページ数をノーマルページのページ数に換算する(ステップS21)。例えば(ラージページの空きページ数)*(ラージページのページサイズ)/(ノーマルページのページサイズ)で算出し、整数未満は例えば切り上げる。(「*」は積算を表す。)なお、本ステップにおいて、ノーマルページの要求ページ数を、ラージページ換算するようにしても良い。具体的には、(ノーマルページの要求ページ数)*(ノーマルページのページサイズ)/(ラージページのページサイズ)を算出し、整数未満は例えば切り上げる。 9, the large page management mechanism 102 checks the number of large pages that are included in the large page management information of the non-reserved large page (step S19). In addition, the large page management mechanism 102 converts the number of empty large page pages into the number of normal page pages (step S21). For example, it is calculated by (number of empty pages of large pages) * (page size of large pages) / (page size of normal pages). (“*” Represents integration.) In this step, the requested number of normal pages may be converted into a large page. Specifically, (the number of requested pages of normal pages) * (page size of normal pages) / (page size of large pages) is calculated, and a value less than an integer is rounded up, for example.
 そして、ラージページ管理機構102は、空きラージページの換算ページ数が要求ページ数以上であるか判断する(ステップS23)。要求ページ数をラージページのページ数に換算した場合には、空きページ数が要求の換算ページ数以上であるか確認する。 Then, the large page management mechanism 102 determines whether or not the number of converted pages of empty large pages is equal to or greater than the number of requested pages (step S23). When the number of requested pages is converted into the number of large pages, it is checked whether the number of free pages is equal to or greater than the number of requested pages.
 非予約ラージページプール107にも空きラージページが少ない状態であれば、要求ページ数分のノーマルページを生成できない場合もある。このような場合には、ラージページ管理機構102は、割当失敗をノーマルページ管理機構101に出力する(ステップS25)。ノーマルページ管理機構101は、ラージページ管理機構102から、割当失敗の通知を受信すると、さらに割当失敗をページ割当機構103に出力する(ステップS27)。ページ割当機構103は、ノーマルページ管理機構101から割当失敗の通知を受信し(ステップS29)、要求元のアプリケーション等にも、割当失敗を通知する。この後の処理については、従来と同様であるから、これ以上の説明は省略する。 If the unreserved large page pool 107 also has a small number of free large pages, there may be cases where normal pages for the number of requested pages cannot be generated. In such a case, the large page management mechanism 102 outputs an allocation failure to the normal page management mechanism 101 (step S25). When receiving the notification of allocation failure from the large page management mechanism 102, the normal page management mechanism 101 further outputs the allocation failure to the page allocation mechanism 103 (step S27). The page allocation mechanism 103 receives a notification of allocation failure from the normal page management mechanism 101 (step S29), and notifies the requesting application or the like of the allocation failure. Since the subsequent processing is the same as the conventional one, further explanation is omitted.
 一方、空きラージページの換算ページ数が要求ページ数以上であれば、ラージページ管理機構102は、今回転用するラージページの転用ページ数を算出する(ステップS31)。転用ページ数は、(ノーマルページの要求ページ数)*(ノーマルページのページサイズ)/(ラージページのページサイズ)で算出し、整数未満は例えば切り上げる。その後、ラージページ管理機構102は、非予約ラージページプール107の非予約ラージページ管理情報における空きページ数を今回転用するラージページの転用ページ数だけ減少させ、非予約ラージページのページリストから転用ページ数のラージページを今回の要求に割り当てる(ステップS33)。具体的には、非予約ラージページ管理情報のページリストから、転用ページ数分の各ラージページの先頭物理アドレスを読み出し、読み出した各ラージページのページ管理情報を非予約ラージページ管理情報におけるページリストから削除する。処理は端子Bを介して図10の処理に移行する。 On the other hand, if the converted number of empty large pages is equal to or greater than the requested number of pages, the large page management mechanism 102 calculates the number of diverted pages of the large page to be rotated now (step S31). The number of diverted pages is calculated by (number of requested normal pages) * (page size of normal pages) / (page size of large pages). Thereafter, the large page management mechanism 102 decreases the number of empty pages in the non-reserved large page management information of the non-reserved large page pool 107 by the number of diverted pages of the large page to be rotated now, and the diverted page from the page list of the non-reserved large page. A number of large pages are allocated to the current request (step S33). Specifically, from the page list of the non-reserved large page management information, the start physical address of each large page for the number of diverted pages is read, and the page management information of each read large page is displayed as the page list in the non-reserved large page management information Delete from. The processing shifts to the processing in FIG.
 図10の処理の説明に移行して、ラージページ管理機構102は、非予約ラージページ管理情報の転用済みページ数を、転用ページ数だけ増加させる(ステップS35)。また、ラージページ管理機構102は、ステップS33で割り当てることにしたラージページをノーマルページに分割する処理を実施する(ステップS37)。具体的には、割り当てることにしたラージページを順番に、要求ページ数に達するまで、ノーマルページのサイズで区切って各ノーマルページのページ管理情報を蓄積する。なお、要求ページ数を超えてノーマルページを生成できる場合もあるが、その場合にも同様に、ノーマルページのサイズで区切って各ノーマルページのページ管理情報を、余剰ノーマルページのページ管理情報として蓄積する。後に、ノーマルページプールに登録するためである。 10, the large page management mechanism 102 increases the number of diverted pages of the non-reserved large page management information by the number of diverted pages (step S35). Further, the large page management mechanism 102 performs a process of dividing the large page assigned in step S33 into normal pages (step S37). Specifically, the page management information of each normal page is accumulated by dividing the large pages that have been allocated in order, until the required number of pages is reached, divided by the normal page size. In some cases, normal pages can be generated beyond the number of requested pages. Similarly, in this case, page management information for each normal page is stored as page management information for surplus normal pages, separated by the normal page size. To do. This is because it is registered in the normal page pool later.
 そして、ラージページ管理機構102は、割り当てた要求ページ数分のノーマルページの先頭物理アドレスを含むページ割当結果を、ノーマルページ管理機構101に出力する(ステップS39)。ノーマルページ管理機構101は、ラージページ管理機構102から、割り当てた要求ページ数分のノーマルページの先頭物理アドレスを含むページ割当結果を受信し(ステップS41)、ノーマルページプール106のノーマルページ管理情報における総ページ数及び割当済みページ数を、要求ページ数だけ増加させる。 Then, the large page management mechanism 102 outputs a page allocation result including the top physical addresses of normal pages for the number of allocated requested pages to the normal page management mechanism 101 (step S39). The normal page management mechanism 101 receives a page allocation result including the top physical addresses of normal pages for the number of requested pages allocated from the large page management mechanism 102 (step S41), and in the normal page management information of the normal page pool 106 The total number of pages and the number of allocated pages are increased by the number of requested pages.
 さらに、ノーマルページ管理機構101は、受信したページ割当結果に含まれる、ノーマルページの先頭物理アドレスの情報を含むページ割当結果を、ページ割当機構103に出力する(ステップS43)。ページ割当機構103は、ノーマルページ管理機構101から、ページ割当結果を受信し(ステップS45)、要求元のアプリケーション等が、割り当てを受けたノーマルページを利用できるようにする。この処理についても、従来と同様であるからこれ以上の説明は省略する。 Further, the normal page management mechanism 101 outputs a page allocation result including information on the top physical address of the normal page included in the received page allocation result to the page allocation mechanism 103 (step S43). The page allocation mechanism 103 receives the page allocation result from the normal page management mechanism 101 (step S45), and allows the requesting application or the like to use the allocated normal page. Since this process is the same as that of the prior art, further explanation is omitted.
 また、ラージページ管理機構102は、要求ページ数を超えるノーマルページが生成されたか判断する(ステップS47)。もし、ステップS37で要求ページ数と同じページ数のノーマルページが生成された場合には、これ以上の処理は不要であるから、処理を終了する。 Further, the large page management mechanism 102 determines whether or not normal pages exceeding the requested number of pages have been generated (step S47). If a normal page having the same number of pages as the requested number of pages is generated in step S37, no further processing is necessary, and the processing is terminated.
 一方、要求ページ数を超えたノーマルページが生成された場合には、ラージページ管理機構102は、上述した余剰ノーマルページの先頭物理アドレスを、ノーマルページ管理機構101に出力する(ステップS49)。これに対して、ノーマルページ管理機構101は、ラージページ管理機構102から、余剰ノーマルページの先頭物理アドレスの情報を受信する(ステップS50)。そして、ノーマルページ管理機構101は、ノーマルページ管理情報におけるページリストに、受信した余剰ノーマルページのアドレスに対応したページ管理情報をページリストに追加する(ステップS51)。さらに、ノーマルページ管理機構101は、ノーマルページ管理情報において総ページ数及び空きページ数に、余剰ノーマルページのページ数を加算する(ステップS53)。 On the other hand, when a normal page exceeding the number of requested pages is generated, the large page management mechanism 102 outputs the above-described first physical address of the surplus normal page to the normal page management mechanism 101 (step S49). On the other hand, the normal page management mechanism 101 receives the information of the head physical address of the surplus normal page from the large page management mechanism 102 (step S50). Then, the normal page management mechanism 101 adds page management information corresponding to the address of the received surplus normal page to the page list in the normal page management information (step S51). Further, the normal page management mechanism 101 adds the number of surplus normal pages to the total number of pages and the number of empty pages in the normal page management information (step S53).
 このようにすれば、余剰ノーマルページが、有効活用されるようになる。すなわち、図3(a)から図3(b)への遷移で示したように、未利用のラージページのメモリ領域をノーマルページのメモリ領域に転用することで、メモリの有効活用が図られる。また、ラージページで管理されており且つ計算ジョブ等専用として割り当てられているメモリ領域におけるラージページは転用されることはないので、計算ジョブ等の処理に対する影響を軽減できる。 In this way, surplus normal pages can be used effectively. That is, as shown in the transition from FIG. 3A to FIG. 3B, the memory area of the unused large page is diverted to the normal page memory area, so that the memory can be effectively used. In addition, since the large page in the memory area managed by the large page and allocated exclusively for the calculation job or the like is not diverted, the influence on the processing of the calculation job or the like can be reduced.
 次に、ノーマルページの解放が発生した場合の処理について図11乃至図13を用いて説明する。まず、ページ解放機構104は、アプリケーション等による解放や他のノーマルページ解放事象の発生に応じて、ノーマルページの解放ページ数及び解放の対象となるノーマルページの先頭物理アドレスのリストである解放ページリストを含むページ解放要求をノーマルページ管理機構101に出力する(図11:ステップS61)。本ステップは、従来と同様であるから、これ以上の説明は省略する。 Next, processing when normal page release occurs will be described with reference to FIGS. First, the page release mechanism 104 is a release page list that is a list of the number of released pages of normal pages and the start physical address of the normal page to be released in response to the release by an application or the like or the occurrence of another normal page release event. Is output to the normal page management mechanism 101 (FIG. 11: step S61). Since this step is the same as the conventional one, further explanation is omitted.
 これに対して、ノーマルページ管理機構101は、ページ解放機構104から、ノーマルページの解放ページ数及び解放ページリストを含むページ解放要求を受信する(ステップS63)。そうすると、ノーマルページ管理機構101は、ノーマルページプール106のノーマルページ管理情報におけるページリストに、受信した解放ページリストに含まれるノーマルページのページ管理情報を登録する(ステップS65)。さらに、ノーマルページ管理機構101は、ノーマルページ管理情報における割当済みページ数を、解放ページ数だけ減少させ、さらに空きページ数を解放ページ数だけ増加させる(ステップS67)。 In response to this, the normal page management mechanism 101 receives a page release request including the number of released pages of the normal page and the release page list from the page release mechanism 104 (step S63). Then, the normal page management mechanism 101 registers the page management information of the normal pages included in the received release page list in the page list in the normal page management information of the normal page pool 106 (step S65). Further, the normal page management mechanism 101 decreases the number of allocated pages in the normal page management information by the number of released pages, and further increases the number of free pages by the number of released pages (step S67).
 そして、ノーマルページ管理機構101は、例えばラージページ管理機構102から非予約ラージページプール107の非予約ラージページ管理情報における転用ページ数を取得し、取得した転用ページ数が0であるか確認する(ステップS69)。ノーマルページ管理機構101は、非予約ラージページ管理情報における転用ページ数に直接アクセスできる場合には、非予約ラージページ管理情報における転用ページ数に直接アクセスするようにしても良い。 Then, the normal page management mechanism 101 acquires the number of diverted pages in the non-reserved large page management information of the non-reserved large page pool 107 from, for example, the large page management mechanism 102, and confirms whether the acquired number of diverted pages is 0 ( Step S69). When the normal page management mechanism 101 can directly access the number of diverted pages in the non-reserved large page management information, the normal page management mechanism 101 may directly access the number of diverted pages in the non-reserved large page management information.
 転用ページ数が0である場合には、解放されたノーマルページを非予約ラージページプールに返却することはないので、処理を終了する。一方、転用ページ数が0でない場合には、端子Dを介して図12の処理に移行する。 If the number of diverted pages is 0, the released normal page is not returned to the non-reserved large page pool, so the process ends. On the other hand, when the number of diverted pages is not 0, the processing shifts to the processing in FIG.
 ノーマルページ管理機構101は、ノーマルページプール106のノーマルページ管理情報におけるページリストを走査して、連続する空きノーマルページのページ数がノーマルページプール106のノーマルページ管理情報における転用閾値以上であるかを確認する(ステップS71)。なお、連続する空きノーマルページのページ数が転用閾値以上であるかを確認する代わりに、ラージページサイズ分の連続する空きノーマルページが存在するか確認しても良い。また、ラージページサイズ分の連続する空きノーマルページが存在するか確認する場合には、ラージページ1ページ分だけ連続する空きノーマルページが存在するか確認するが、2ページ分又はそれ以上の連続する空きノーマルページが存在するかを確認することもある。 The normal page management mechanism 101 scans the page list in the normal page management information of the normal page pool 106, and determines whether the number of consecutive free normal pages is equal to or greater than the diversion threshold in the normal page management information of the normal page pool 106. Confirm (step S71). Instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, it may be checked whether there are continuous free normal pages for the large page size. Also, when checking whether there are continuous free normal pages for the large page size, it is checked whether there are free normal pages that are continuous for one large page, but it is continuous for two pages or more. It may be confirmed whether there is an empty normal page.
 連続した空きページがないか又は連続する空きノーマルページがノーマルページ管理情報における転用閾値未満の場合には(ステップS73:Yesルート)、ここで処理を終了する。なお、ステップS71において、連続する空きノーマルページのページ数が転用閾値以上であるかを確認する代わりに、ラージページサイズ分の連続する空きノーマルページが存在するか確認する場合において、ラージページサイズ分の連続する空きノーマルページが存在しないときには、非予約ラージページプール107に返却することはできないので、ここで処理を終了する。 If there is no continuous free page or if the continuous free normal page is less than the diversion threshold in the normal page management information (step S73: Yes route), the process ends here. In step S71, instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, when checking whether there are continuous free normal pages for the large page size, When there are no consecutive free normal pages, the process cannot be returned to the non-reserved large page pool 107, and the process ends here.
 一方、連続した空きページがあり且つ連続する空きノーマルページのページ数がノーマルページ管理情報における転用閾値未満の場合には(ステップS73:Noルート)、ノーマルページ管理機構101は、ノーマルページ管理情報における空きページ数及び総ページ数を、返却分のノーマルページ数だけ減ずる(ステップS75)。なお、ステップS71において、連続する空きノーマルページのページ数が転用閾値以上であるかを確認する代わりに、ラージページサイズ分の連続する空きノーマルページが存在するか確認する場合において、ラージページサイズ分の連続する空きノーマルページが存在するときには、ノーマルページ管理機構101は、ノーマルページ管理情報における空きページ数及び総ページ数を、返却分のノーマルページ数だけ減する。また、ノーマルページ管理機構101は、ノーマルページ管理情報におけるページリストから、ラージページサイズの連続する空きノーマルページのリストを抽出する(ステップS76)。空きノーマルページのリストは、ラージページサイズの連続する空きノーマルページの先頭物理アドレスのリストである。さらに、ノーマルページ管理機構101は、ラージページサイズの連続する空きノーマルページのリストを、ラージページ管理機構102に出力する(ステップS77)。 On the other hand, when there are continuous free pages and the number of continuous free normal pages is less than the diversion threshold value in the normal page management information (step S73: No route), the normal page management mechanism 101 uses the normal page management information. The number of empty pages and the total number of pages are reduced by the number of normal pages that are returned (step S75). In step S71, instead of checking whether the number of continuous free normal pages is equal to or greater than the diversion threshold, when checking whether there are continuous free normal pages for the large page size, When there are consecutive free normal pages, the normal page management mechanism 101 reduces the number of empty pages and the total number of pages in the normal page management information by the number of normal pages for return. Further, the normal page management mechanism 101 extracts a list of empty normal pages having continuous large page sizes from the page list in the normal page management information (step S76). The list of free normal pages is a list of the top physical addresses of continuous free normal pages having a large page size. Further, the normal page management mechanism 101 outputs a list of empty normal pages having continuous large page sizes to the large page management mechanism 102 (step S77).
 一方、ラージページ管理機構102は、ノーマルページ管理機構101から、ラージページサイズの連続する空きノーマルページのリストを受信し(ステップS79)、当該空きノーマルページをラージページに変換する(ステップS81)。すなわち、連続する空きノーマルページを連続する領域として取り扱う。処理は、端子Eを介して図13の処理に移行する。 On the other hand, the large page management mechanism 102 receives a list of continuous free normal pages having a large page size from the normal page management mechanism 101 (step S79), and converts the free normal page into a large page (step S81). That is, continuous empty normal pages are handled as continuous areas. The processing shifts to the processing in FIG.
 ラージページ管理機構102は、生成したラージページの先頭物理アドレスを、非予約ラージページプール107の非予約ラージページ管理情報におけるページリストに登録する(ステップS83)。また、ラージページ管理機構102は、非予約ラージページ管理情報における転用済みページ数を、返却分のページ数(上の例では「1」。但し「2」以上の場合もある。)だけ減ずる(ステップS85)。さらに、ラージページ管理機構102は、非予約ラージページ管理情報における空きページ数を、返却分のページ数だけ増加させる(ステップS87)。そして、処理を終了する。 The large page management mechanism 102 registers the top physical address of the generated large page in the page list in the non-reserved large page management information of the non-reserved large page pool 107 (step S83). In addition, the large page management mechanism 102 reduces the number of diverted pages in the non-reserved large page management information by the number of returned pages (“1” in the above example, although it may be “2” or more). Step S85). Further, the large page management mechanism 102 increases the number of empty pages in the non-reserved large page management information by the number of returned pages (step S87). Then, the process ends.
 以上のように処理を行うことによって、図3(b)から図3(c)への遷移で示したように、非予約ラージページの転用を行っている場合にノーマルページに余裕が発生すれば、ノーマルページをラージページのサイズに束ねて非予約ラージページプール107に返却する。これによって、ラージページの割当要求に備えることができるようになる。また、その後再度ノーマルページの要求が増加する場合にも対応できる。 By performing the processing as described above, as shown in the transition from FIG. 3 (b) to FIG. 3 (c), when a non-reserved large page is diverted, a margin is generated in the normal page. The normal pages are bundled in the large page size and returned to the non-reserved large page pool 107. This makes it possible to prepare for a large page allocation request. Further, it is possible to cope with a case where the request for normal pages increases again thereafter.
 なお、ラージページを用いるアプリケーション等からの要求については、ラージページ管理機構102は、非予約ラージページプール107から空きページを通常どおりに割り当てる。計算ジョブ等からの要求であれば、予約付きラージページプール108から空きページを通常どおりに割り当てる。従って、ラージページの要求についてはこれ以上の説明は省略する。 For requests from applications that use large pages, the large page management mechanism 102 allocates free pages from the non-reserved large page pool 107 as usual. If the request is from a calculation job or the like, free pages are allocated from the reserved large page pool 108 as usual. Therefore, further description of the request for large pages is omitted.
[実施の形態2]
 ノーマルページの管理方法は、上で述べた方法の他にも、以下で説明するような方法がある。
[Embodiment 2]
The normal page management method includes the method described below in addition to the method described above.
 本実施の形態に係るコンピュータ200を図14に示す。コンピュータ200は、ノーマルページ管理機構201と、ラージページ管理機構102と、ページ割当機構103と、ページ解放機構104と、バディページプール206と、非予約ラージページプール107と、予約付きラージページプール108とを有する。図4に示したコンピュータ100と同様の機能を有する場合には、同じ参照番号を付している。すなわち、ノーマルページ管理機構201とバディページプール206とが、第1の実施の形態とは異なる部分である。 FIG. 14 shows a computer 200 according to the present embodiment. The computer 200 includes a normal page management mechanism 201, a large page management mechanism 102, a page allocation mechanism 103, a page release mechanism 104, a buddy page pool 206, a non-reserved large page pool 107, and a reserved large page pool 108. And have. The same reference numerals are given to functions similar to those of the computer 100 shown in FIG. That is, the normal page management mechanism 201 and the buddy page pool 206 are different parts from the first embodiment.
 特に、バディページプール206は、ノーマルページプール106とは空きページの管理形態が異なっている。図14で模式的に示すように、システム動作中に発生する物理ページの断片化、すなわち、スラッシングの発生を避けるため、空きページを2のべき乗単位(バディと呼ぶ)で管理する。すなわち、2の「0」乗であれば空きページ1枚ずつの管理であり、バディページプール206では、空きページ2061a乃至2061eが物理アドレスの順番で管理される。また、2の「1」乗であれば連続空きページ2枚ずつの管理であり、バディページプール206では、2枚の連続空きページ2062a乃至2062dが物理アドレスの順番で管理される。さらに、2の「2」乗であれば連続ページ4枚ずつの管理であり、バディページプール206は、4枚の連続空きページ2063a乃至2063cが先頭物理アドレスの順番で管理される。 In particular, the buddy page pool 206 is different from the normal page pool 106 in the management mode of empty pages. As schematically shown in FIG. 14, in order to avoid fragmentation of physical pages that occurs during system operation, that is, thrashing, empty pages are managed in units of powers of 2 (referred to as buddies). That is, if the power is 2 to the power of “0”, one empty page is managed, and in the buddy page pool 206, the empty pages 2061a to 2061e are managed in the order of physical addresses. If the power is 2 to the power of “1”, two consecutive empty pages are managed. In the buddy page pool 206, two consecutive empty pages 2062a to 2062d are managed in the order of physical addresses. Further, if 2 is the power of “2”, four consecutive pages are managed. In the buddy page pool 206, four consecutive empty pages 2063a to 2063c are managed in the order of the top physical address.
 図15に、バディページプール206の管理状態をさらに詳しく示す。バディページプール206は、システム内部のページ割当要求の多くが2のべき乗単位でなされているという経験則から、ページ単位でのメモリの断片化(スラッシングの発生)を防止するために導入されている。図15に示すように、20ページ毎の空きページの先頭物理アドレスは、free_list[0]というリストに登録される。例えば、1ページのサイズが8Kバイトであれば8Kバイト毎のページが登録される。さらに、21の連続空きページの先頭物理アドレスは、free_list[1]というリストに登録される。例えば、8Kバイト×2=連続16Kバイトまでのデータを格納できる。 FIG. 15 shows the management state of the buddy page pool 206 in more detail. The buddy page pool 206 is introduced to prevent memory fragmentation (thrashing) in units of pages based on the rule of thumb that many page allocation requests in the system are made in units of powers of 2. . As shown in FIG. 15, the start physical address of the free page of every two 0 pages are registered in the list of free_list [0]. For example, if the size of one page is 8 Kbytes, a page for every 8 Kbytes is registered. In addition, 2 1 of the start physical address of contiguous free pages, are registered in the list of free_list [1]. For example, data of up to 8 Kbytes × 2 = continuous 16 Kbytes can be stored.
 また、22ページ毎の空きページの先頭物理アドレスは、free_list[2]というリストに登録される。例えば、8Kバイト×4=連続32Kバイトまでのデータを格納できる。さらに、23ページ毎の空きページの先頭物理アドレスは、free_list[3]というリストに登録される。例えば、8Kバイト×8=連続64Kバイトまでのデータを格納できる。また、24ページ毎の空きページの先頭物理アドレスは、free_list[4]というリストに登録される。例えば、8Kバイト×16=連続128Kバイトまでのデータを格納できる。さらに、25ページ毎の空きページの先頭物理アドレスは、free_list[5]というリストに登録される。例えば、8Kバイト×32=連続256Kバイトまでのデータを格納できる。このようにして、210ページ毎の空きページの先頭物理アドレスは、free_list[10]というリストに登録される。例えば、8Kバイト×210=連続8Mバイトまでのデータを格納できる。 In addition, top physical address of a free page of every 2 2 pages are registered in the list of free_list [2]. For example, 8 Kbytes × 4 = continuous 32 Kbytes of data can be stored. In addition, the top physical address of a free page of every 2 3 page is registered in the list of free_list [3]. For example, data of up to 8 Kbytes × 8 = continuous 64 Kbytes can be stored. In addition, top physical address of a free page of every 2 4 page is registered in the list of free_list [4]. For example, 8 Kbytes × 16 = continuous 128 Kbytes of data can be stored. Furthermore, the head physical address of the empty page for every 25 pages is registered in a list called free_list [5]. For example, it is possible to store data of up to 8 Kbytes × 32 = continuous 256 Kbytes. In this way, the head physical address of the empty page for every 2 10 pages is registered in a list called free_list [10]. For example, 8 Kbytes × 2 10 = continuous 8 Mbytes of data can be stored.
 バディページプール206では、ページの割り当て及び解放を連続したページ単位で扱うことができる。 The buddy page pool 206 can handle page allocation and release in consecutive page units.
 このようなバディページプール206を使用する場合においても、ノーマルページの割当要求に対しては、実質的に第1の実施の形態と同様の処理が行われる。但し、要求ページ数を満たす連続空きページの探索方法がバディページプール206の管理手法に応じて異なる。すなわち、要求ページ数以上となる、2の最小のべき乗の連続空きページを探索して、その連続空きページの中から割り当てを行う。要求ページ数以上となる連続空きページが存在しなければ、第1の実施の形態と同様に、ラージページをノーマルページに転用して対応する。 Even when such a buddy page pool 206 is used, a process similar to that of the first embodiment is performed for a normal page allocation request. However, the method of searching for continuous free pages that satisfy the requested number of pages differs depending on the management method of the buddy page pool 206. That is, a search is made for a continuous free page having the smallest power of 2 that is equal to or greater than the number of requested pages, and allocation is performed from the continuous free pages. If there is no continuous free page that is equal to or greater than the requested number of pages, as in the first embodiment, a large page is converted to a normal page and handled.
 一方、ページの解放については、以下に述べるように変更が行われる。 On the other hand, the page release is changed as described below.
 図16を用いてページ解放時の処理内容について説明する。まず、ページ解放機構104は、アプリケーション等による解放や他のノーマルページ解放事象の発生に応じて、ノーマルページの解放ページ数と解放するノーマルページの先頭物理アドレスのリストである解放ページリストとを含むページ解放要求をノーマルページ管理機構201に出力する(図16:ステップS101)。本ステップにおける処理は、従来と同様であるから、これ以上の説明は省略する。 Referring to FIG. 16, the processing content when releasing the page will be described. First, the page release mechanism 104 includes the number of released pages of normal pages and a released page list that is a list of the first physical addresses of normal pages to be released in response to release by an application or the like or occurrence of another normal page release event. A page release request is output to the normal page management mechanism 201 (FIG. 16: step S101). Since the processing in this step is the same as the conventional one, further explanation is omitted.
 これに対して、ノーマルページ管理機構201は、ページ解放機構104から、ノーマルページの解放ページ数と解放ページリストとを含むページ解放要求を受信する(ステップS103)。そうすると、ノーマルページ管理機構201は、バディページプール206へのページ返却処理を実施する(ステップS105)。例えば、解放ページが2ページである場合には、21ページのページリストを探索して、連結すると連続するページが存在するか確認する。連結すると連続するページがなければ、そのまま21ページのページリストに登録する。一方、連結すると連続するページがあれば連結してしまい、22ページのページリストを探索して、連結すると連続するページが存在するか確認する。このような処理を、連結すると連続するページが見つからなくなるまで繰り返す。また、空きページ数を増加させる処理も行う。図7の例では、ノーマルページ管理情報に全体の空きページの数を管理していたが、例えば図17で示すように、バディ毎に、空きページ数を管理する。但し、バディ単位での空き数を管理するようにしてもよい。 In response to this, the normal page management mechanism 201 receives a page release request including the number of released pages of the normal page and the release page list from the page release mechanism 104 (step S103). Then, the normal page management mechanism 201 performs a page return process to the buddy page pool 206 (step S105). For example, if the release page is page 2, 2 1 page page list to search for and verify contiguous pages to be linked there. If there is no page to be continuous to be consolidated, to register as it is 2 1 page of the page list. On the other hand, it will be consolidated if there is a page to be continuous to be consolidated, to search the page list of 2 page 2, to check whether the page to be continuous with the coupling exists. Such processing is repeated until a continuous page is not found when connected. Also, a process for increasing the number of empty pages is performed. In the example of FIG. 7, the total number of empty pages is managed in the normal page management information. However, for example, as shown in FIG. 17, the number of empty pages is managed for each buddy. However, the number of vacancies in units of buddies may be managed.
 そして、ノーマルページ管理機構201は、ステップS105において最終的な返却先バディのサイズがラージページと一致し且つ転用済みページ数が1以上となっているか確認する(ステップS107)。ノーマルページ管理機構201は、例えばラージページ管理機構102から非予約ラージページプール107の非予約ラージページ管理情報における転用済みページ数を取得するか、非予約ラージページプール107の非予約ラージページ管理情報における転用済みページ数に直接アクセスして取得する。最終的な返却先バディのサイズがラージページと一致するという条件又は転用済みページ数が1以上となっているという条件のうちいずれかを満たさない場合には、処理を終了する。 In step S105, the normal page management mechanism 201 confirms whether the final return destination buddy size matches the large page and the number of diverted pages is 1 or more (step S107). The normal page management mechanism 201 acquires, for example, the number of diverted pages in the non-reserved large page management information of the non-reserved large page pool 107 from the large page management mechanism 102 or the non-reserved large page management information of the non-reserved large page pool 107 Get directly accessed the number of diverted pages in. If either the condition that the final return destination buddy size matches the large page or the condition that the number of diverted pages is 1 or more is not satisfied, the process ends.
 一方、ステップS105において最終的な返却先バディのサイズがラージページと一致し且つ転用済みページ数が1以上となっている場合には、ノーマルページ管理機構201は、バディページプール206のノーマルページ管理情報における、ラージページと一致するサイズのバディの空きページ数を、返却ページ数分だけ減算する(ステップS109)。また、ノーマルページ管理情報における総ページ数も、返却ページ数分だけ減算する。そして、端子Fを介して、図12のステップS77に移行する。 On the other hand, if the final return destination buddy size matches the large page in step S105 and the number of diverted pages is 1 or more, the normal page management mechanism 201 manages the normal page management of the buddy page pool 206. In the information, the number of empty pages of buddies whose size matches the large page is subtracted by the number of return pages (step S109). Also, the total number of pages in the normal page management information is subtracted by the number of return pages. Then, the process proceeds to step S77 in FIG.
 このようにバディページプール206を導入することによって、ページ返却処理が一部異なるが、他の処理の部分については同様である。 The introduction of the buddy page pool 206 in this way makes part of the page return process different, but the same is true for the other processes.
 このようにバディページプール206を導入しても、第1の実施の形態と同様に、非予約ラージページプール107を導入して、メモリの利用効率を上げることができるようになる。 Even if the buddy page pool 206 is introduced in this way, the non-reserved large page pool 107 can be introduced and the memory utilization efficiency can be increased as in the first embodiment.
 以上本技術の実施の形態について説明したが、本技術はこれに限定されるものではない。例えば、処理フローで示したノーマルページ管理機構とラージページ管理機能との役割分担は一例にすぎず、各ステップの処理主体を変更することも可能な場合がある。また、ノーマルページ管理機構及びラージページ管理機構とが一体で実装される場合もある。 The embodiment of the present technology has been described above, but the present technology is not limited to this. For example, the division of roles between the normal page management mechanism and the large page management function shown in the processing flow is merely an example, and it may be possible to change the processing subject of each step. In some cases, the normal page management mechanism and the large page management mechanism are integrated.
 なお、上で述べたコンピュータ100及び200は、全体としては図18に示すようなコンピュータ等の情報処理装置であって、メモリ2501とCPU2503(プロセッサとも呼ぶ)とハードディスク・ドライブ(HDD:Hard Disk Drive)2505と表示装置2509に接続される表示制御部2507とリムーバブル・ディスク2511用のドライブ装置2513と入力装置2515とネットワークに接続するための通信制御部2517とがバス2519で接続されている。オペレーティング・システム及び本実施例における処理を実施するためのアプリケーション・プログラムは、HDD2505に格納されており、CPU2503により実行される際にはHDD2505からメモリ2501に読み出される。CPU2503は、アプリケーション・プログラムの処理内容に応じて表示制御部2507、通信制御部2517、ドライブ装置2513を制御して、所定の動作を行わせる。また、処理途中のデータについては、主としてメモリ2501に格納されるが、HDD2505に格納されるようにしてもよい。本技術の実施例では、上で述べた処理を実施するためのアプリケーション・プログラムはコンピュータ読み取り可能なリムーバブル・ディスク2511に格納されて頒布され、ドライブ装置2513からHDD2505にインストールされる。インターネットなどのネットワーク及び通信制御部2517を経由して、HDD2505にインストールされる場合もある。このようなコンピュータ装置は、上で述べたCPU2503、メモリ2501などのハードウエアとオペレーティングシステム及びアプリケーション・プログラムなどのプログラムとが有機的に協働することにより、上で述べたような各種機能を実現する。 The computers 100 and 200 described above are information processing apparatuses such as a computer as shown in FIG. 18 as a whole, and include a memory 2501, a CPU 2503 (also referred to as a processor), and a hard disk drive (HDD: Hard Disk Drive). 2505, a display control unit 2507 connected to the display device 2509, a drive device 2513 for the removable disk 2511, an input device 2515, and a communication control unit 2517 for connecting to a network are connected by a bus 2519. The operating system and the application program for executing the processing in this embodiment are stored in the HDD 2505, and are read from the HDD 2505 to the memory 2501 when executed by the CPU 2503. The CPU 2503 controls the display control unit 2507, the communication control unit 2517, and the drive device 2513 according to the processing content of the application program, and performs a predetermined operation. Further, data in the middle of processing is mainly stored in the memory 2501, but may be stored in the HDD 2505. In an embodiment of the present technology, an application program for performing the above-described processing is stored in a computer-readable removable disk 2511 and distributed, and installed from the drive device 2513 to the HDD 2505. In some cases, the HDD 2505 may be installed via a network such as the Internet and the communication control unit 2517. Such a computer apparatus realizes various functions as described above by organically cooperating hardware such as the CPU 2503 and memory 2501 described above and programs such as an operating system and application programs. To do.
 典型的には、本実施の形態におけるノーマルページ管理機構及びラージページ管理機構は、例えばオペレーティングシステムの一部として実装される。すなわち、CPU2505により実行されて、上で述べたような機能を実現するようになっている。 Typically, the normal page management mechanism and the large page management mechanism in the present embodiment are implemented as a part of the operating system, for example. That is, it is executed by the CPU 2505 to realize the functions described above.
 以上述べた本実施の形態をまとめると、以下のようになる。 The above-described embodiment can be summarized as follows.
 本実施の形態に係るメモリ管理方法は、(A)第1のサイズのページの要求を受け取るステップと、(B)第1のサイズのページに分割されている第1のメモリ領域における空きページが上記要求に応じるには不足する場合、第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域における第2のサイズの空きページを第1のサイズのページに分割して、上記要求に対して第1のサイズのページを割り当てる割当ステップとを含む。 In the memory management method according to the present embodiment, (A) a step of receiving a request for a page of the first size, and (B) an empty page in the first memory area divided into pages of the first size. If there is a shortage to meet the above request, the empty page of the second size in the second memory area that is divided into pages of the second size larger than the first size is divided into pages of the first size. And allocating a first size page for the request.
 このように第1のサイズのページが不足するならば、第2のサイズの空きページを転用するため、メモリの利用効率を向上させることができるようになる。 If there is a shortage of pages of the first size in this way, empty pages of the second size are diverted, so that the memory utilization efficiency can be improved.
 また、上で述べた割当ステップが、(B1)上記要求に含まれる第1の要求ページ数が第1のメモリ領域における空きページ数を上回るか判断するステップと、(B2)第1の要求ページ数が第1のメモリ領域における空きページ数を上回る場合、第1の要求ページ数を第2のサイズのページ数に換算することで得られる第2の要求ページ数だけ第2のメモリ領域における第2のサイズのページを確保するステップと、(B3)確保された第2のサイズのページを第1のサイズのページに分割して、第1の要求ページ数だけ上記要求に対して割り当てるステップとを含むようにしてもよい。このようにすれば具体的に第2のサイズのページを転用できるようになる。 The allocation step described above includes (B1) determining whether the number of first requested pages included in the request exceeds the number of free pages in the first memory area; and (B2) first requested page. If the number exceeds the number of free pages in the first memory area, the second requested page number obtained by converting the first requested page number into the second size page number is the second in the second memory area. A step of securing a page having a size of 2, and a step of (B3) dividing the secured second size page into pages of the first size and allocating them to the request by the number of first request pages. May be included. In this way, the second size page can be specifically transferred.
 さらに、本実施の形態に係るメモリ管理方法は、(C)第1のサイズのページの解放を検出するステップと、(D)解放された第1のサイズのページを含む第1のサイズの空き連続ページのページ数が所定の閾値以上であって且つ第2のメモリ領域における第2のサイズのページを第1のサイズのページとして転用していた場合には、第1のサイズの空き連続ページを連結して第2のサイズのページを生成し、第2のサイズの空きページとして登録するステップとをさらに含むようにしてもよい。このようにすれば、転用していた第2のサイズのページを返却することができ、第2のサイズのページの利用に供することができるようになる。 Furthermore, the memory management method according to the present embodiment includes (C) a step of detecting the release of a first size page, and (D) a first size of free space including the released first size page. When the number of continuous pages is equal to or greater than a predetermined threshold and the second size page in the second memory area is diverted as the first size page, the empty continuous page of the first size To generate a second size page and register it as a free page of the second size. If it does in this way, the page of the 2nd size which was diverted can be returned, and it can use now for the utilization of the page of the 2nd size.
 また、第1のサイズの空きページが、連続する空きページのサイズ毎に管理されている場合もある。このような場合、メモリ管理方法は、(E)第1のサイズのページの解放を検出するステップと、(F)解放された第1のサイズのページと既に存在する空き連続ページとから生成される第2の空き連続ページのサイズが第2のサイズであり且つ第2のメモリ領域における第2のサイズのページを第1のサイズのページとして転用していた場合には、第2の空き連続ページを連結して第2のサイズのページを生成し、第2のサイズの空きページとして登録するステップとをさらに含むようにしてもよい。例えば2のべき乗サイズで管理するバディページプールの仕組みを採用する場合においても、適切に対処することができる。 Also, there are cases where the first size of free pages is managed for each continuous free page size. In such a case, the memory management method is generated from (E) the step of detecting the release of the first size page, and (F) the released first size page and the free continuous page that already exists. If the size of the second free continuous page is the second size and the second size page in the second memory area is diverted as the first size page, the second free continuous page The method may further include a step of concatenating the pages to generate a second size page and registering it as a free page of the second size. For example, even when a buddy page pool mechanism managed with a power-of-two size is adopted, it is possible to appropriately cope with it.
 なお、第2のサイズのページに分割されている第3のメモリ領域が、ラージページを使用する特定のジョブ専用の領域として確保されている場合もある。 Note that the third memory area divided into pages of the second size may be reserved as an area dedicated to a specific job using a large page.
 さらに、本実施の形態に係るコンピュータは、(A)第1のサイズのページに分割されている第1のメモリ領域と第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域とを含むメモリと、(B)第1のサイズのページの要求に応じて、第1のメモリ領域における空きページが上記要求に応じるには不足する場合、第2のメモリ領域における第2のサイズの空きページを第1のサイズのページに分割して、上記要求に対して第1のサイズのページを割り当てるメモリ管理機構とを有する。 Further, the computer according to the present embodiment has (A) a first memory area divided into pages of a first size and a second page divided into pages of a second size larger than the first size. And (B) in response to a request for a page of the first size, if there are not enough free pages in the first memory area to satisfy the request, the second memory area A memory management mechanism that divides an empty page of size 2 into pages of a first size and allocates a page of the first size in response to the request.
 なお、上で述べたような処理をコンピュータに実施させるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブル・ディスク、CD-ROM(Compact Disk-Read Only Memory)などの光ディスク、光磁気ディスク、半導体メモリ(例えばROM)、ハードディスク等のコンピュータ読み取り可能な記憶媒体又は記憶装置に格納される。なお、処理途中のデータについては、RAM等の記憶装置に一時保管される。 It is possible to create a program for causing a computer to carry out the processing described above, such as a flexible disk, an optical disk such as a CD-ROM (Compact Disk-Read Only Memory), a magneto-optical disk, and the like. The data is stored in a computer-readable storage medium or storage device such as a disk, a semiconductor memory (for example, ROM), and a hard disk. Note that data being processed is temporarily stored in a storage device such as a RAM.

Claims (9)

  1.  第1のサイズのページの要求をオペレーティングシステムから受け取るステップと、
     前記第1のサイズのページに分割されている第1のメモリ領域における空きページが前記要求に応じるには不足する場合、前記第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域における前記第2のサイズの空きページを前記第1のサイズのページに分割して、前記要求に対して分割した第1のサイズのページを割り当てる割当ステップと、
     を、コンピュータに実行させるためのメモリ管理プログラム。
    Receiving a request for a first size page from the operating system;
    If empty pages in the first memory area divided into pages of the first size are insufficient to meet the request, the second page is divided into pages of a second size larger than the first size. An allocation step of dividing the second size free page in the second memory area into the first size page and allocating the divided first size page in response to the request;
    Memory management program for causing a computer to execute
  2.  前記割当ステップが、
     前記要求に含まれる第1の要求ページ数が前記第1のメモリ領域における空きページ数を上回るか判断するステップと、
     前記第1の要求ページ数が前記第1のメモリ領域における空きページ数を上回る場合、前記第1の要求ページ数を前記第2のサイズのページ数に換算することで得られる第2の要求ページ数だけ前記第2のメモリ領域における前記第2のサイズのページを確保するステップと、
     確保された前記第2のサイズのページを第1のサイズのページに分割して、前記第1の要求ページ数だけ前記要求に対して割り当てるステップと、
     を含む請求項1記載のメモリ管理プログラム。
    The assigning step comprises:
    Determining whether the number of first requested pages included in the request exceeds the number of free pages in the first memory area;
    When the first requested page number exceeds the number of free pages in the first memory area, the second requested page obtained by converting the first requested page number into the number of pages of the second size. Securing a number of pages of the second size in the second memory area,
    Dividing the secured second size page into first size pages and assigning to the request as many as the first requested pages;
    The memory management program according to claim 1, comprising:
  3.  前記第1のサイズのページの解放を検出するステップと、
     解放された前記第1のサイズのページを含む前記第1のサイズの空き連続ページのページ数が所定の閾値以上であって且つ前記第2のメモリ領域における前記第2のサイズのページを前記第1のサイズのページとして転用していた場合には、前記第1のサイズの空き連続ページを連結して前記第2のサイズのページを生成し、前記第2のサイズの空きページとして登録するステップと、
     をさらに、前記コンピュータに実行させるための請求項1又は2記載のメモリ管理プログラム。
    Detecting the release of the first size page;
    The number of free continuous pages of the first size including the released first size pages is equal to or greater than a predetermined threshold, and the second size pages in the second memory area are the first size. If the page is diverted as a page of size 1, a step of generating the second size page by concatenating the free continuous pages of the first size and registering it as a free page of the second size When,
    The memory management program according to claim 1, further comprising: causing the computer to execute.
  4.  前記第1のサイズの空きページが、連続する空きページのサイズ毎に管理されており、
     前記第1のサイズのページの解放を検出するステップと、
     解放された前記第1のサイズのページと既に存在する空き連続ページとから生成される第2の空き連続ページのサイズが前記第2のサイズであり、且つ前記第2のメモリ領域における前記第2のサイズのページを前記第1のサイズのページとして転用していた場合には、前記第2の空き連続ページを連結して前記第2のサイズのページを生成し、前記第2のサイズの空きページとして登録するステップと、
     をさらに前記コンピュータに実行させるための請求項1乃至3のいずれか1項記載のメモリ管理プログラム。
    The empty pages of the first size are managed for each continuous empty page size,
    Detecting the release of the first size page;
    The size of the second free continuous page generated from the released page of the first size and the free continuous page that already exists is the second size, and the second size in the second memory area. When the page of the size is used as the page of the first size, the second continuous page is concatenated to generate the second size page, and the second size of the free page is generated. Register as a page,
    The memory management program according to claim 1, further causing the computer to execute the following.
  5.  第1のサイズのページの要求をオペレーティングシステムから受け取るステップと、
     前記第1のサイズのページに分割されている第1のメモリ領域における空きページが前記要求に応じるには不足する場合、前記第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域における前記第2のサイズの空きページを前記第1のサイズのページに分割して、前記要求に対して分割した第1のサイズのページを割り当てる割当ステップと、
     を、コンピュータが実行することを特徴とするメモリ管理方法。
    Receiving a request for a first size page from the operating system;
    If empty pages in the first memory area divided into pages of the first size are insufficient to meet the request, the second page is divided into pages of a second size larger than the first size. An allocation step of dividing the second size free page in the second memory area into the first size page and allocating the divided first size page in response to the request;
    Is executed by a computer.
  6.  前記割当ステップが、
     前記要求に含まれる第1の要求ページ数が前記第1のメモリ領域における空きページ数を上回るか判断するステップと、
     前記第1の要求ページ数が前記第1のメモリ領域における空きページ数を上回る場合、前記第1の要求ページ数を前記第2のサイズのページ数に換算することで得られる第2の要求ページ数だけ前記第2のメモリ領域における前記第2のサイズのページを確保するステップと、
     確保された前記第2のサイズのページを第1のサイズのページに分割して、前記第1の要求ページ数だけ前記要求に対して割り当てるステップと、
     を含む請求項6記載のメモリ管理方法。
    The assigning step comprises:
    Determining whether the number of first requested pages included in the request exceeds the number of free pages in the first memory area;
    When the first requested page number exceeds the number of free pages in the first memory area, the second requested page obtained by converting the first requested page number into the number of pages of the second size. Securing a number of pages of the second size in the second memory area,
    Dividing the secured second size page into first size pages and assigning to the request as many as the first requested pages;
    The memory management method according to claim 6, further comprising:
  7.  前記第1のサイズのページの解放を検出するステップと、
     解放された前記第1のサイズのページを含む前記第1のサイズの空き連続ページのサイズが所定の閾値以上であって且つ前記第2のメモリ領域における前記第2のサイズのページを前記第1のサイズのページとして転用していた場合には、前記第1のサイズの空き連続ページを連結して前記第2のサイズのページを生成し、前記第2のサイズの空きページとして登録するステップと、
     をさらに、前記コンピュータが実行することを特徴とする請求項5又は6記載のメモリ管理方法。
    Detecting the release of the first size page;
    The size of the first continuous free page including the released first size page is equal to or larger than a predetermined threshold value, and the second size page in the second memory area is the first size. The second size page is generated by concatenating the first continuous free pages, and is registered as the second free page. ,
    The memory management method according to claim 5, wherein the computer further executes.
  8.  前記第1のサイズの空きページが、連続する空きページのサイズ毎に管理されており、
     前記第1のサイズのページの解放を検出するステップと、
     解放された前記第1のサイズのページと既に存在する空き連続ページとから生成される第2の空き連続ページのサイズが前記第2のサイズであり且つ前記第2のメモリ領域における前記第2のサイズのページを前記第1のサイズのページとして転用していた場合には、前記第2の空き連続ページを連結して前記第2のサイズのページを生成し、前記第2のサイズの空きページとして登録するステップと、
     をさらに前記コンピュータが実行することを特徴とする請求項5乃至7のいずれか1項記載のメモリ管理方法。
    The empty pages of the first size are managed for each continuous empty page size,
    Detecting the release of the first size page;
    The size of the second free continuous page generated from the released page of the first size and the existing free continuous page is the second size, and the second size in the second memory area is the second size. When a page of size is diverted as the page of the first size, the second vacant continuous page is concatenated to generate the second size page, and the second size vacant page As a step to register as
    The memory management method according to claim 5, wherein the computer further executes.
  9.  第1のサイズのページに分割されている第1のメモリ領域と前記第1のサイズより大きい第2のサイズのページに分割されている第2のメモリ領域とを含むメモリと、
     第1のサイズのページの要求に応じて、前記第1のメモリ領域における空きページが前記要求に応じるには不足する場合、前記第2のメモリ領域における前記第2のサイズの空きページを前記第1のサイズのページに分割して、前記要求に対して分割した第1のサイズのページを割り当てるメモリ管理機構と、
     を有するコンピュータ。
    A memory including a first memory area divided into pages of a first size and a second memory area divided into pages of a second size larger than the first size;
    In response to a request for a first size page, if there are not enough free pages in the first memory area to satisfy the request, the second size free page in the second memory area is A memory management mechanism that divides the page into one size and allocates the first page divided in response to the request;
    Having a computer.
PCT/JP2011/052488 2011-02-07 2011-02-07 Memory management program, memory management method and information processing device WO2012107988A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/052488 WO2012107988A1 (en) 2011-02-07 2011-02-07 Memory management program, memory management method and information processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2011/052488 WO2012107988A1 (en) 2011-02-07 2011-02-07 Memory management program, memory management method and information processing device

Publications (1)

Publication Number Publication Date
WO2012107988A1 true WO2012107988A1 (en) 2012-08-16

Family

ID=46638231

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/052488 WO2012107988A1 (en) 2011-02-07 2011-02-07 Memory management program, memory management method and information processing device

Country Status (1)

Country Link
WO (1) WO2012107988A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015143943A (en) * 2014-01-31 2015-08-06 富士通株式会社 information processing apparatus, control method, and control program
CN115373964A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Memory out-of-range detection method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6410365A (en) * 1987-07-03 1989-01-13 Fuji Electric Co Ltd Alternate buffer automatic acquisition system
JPH08339324A (en) * 1995-06-12 1996-12-24 Fuji Xerox Co Ltd Information processor
JPH09319658A (en) * 1996-05-24 1997-12-12 Nec Corp Memory managing system for variable page size
JP2003196152A (en) * 2001-12-27 2003-07-11 Nec Corp Memory pool management method
JP2006126973A (en) * 2004-10-26 2006-05-18 Mitsubishi Electric Corp Storage area management method, storage area allocation program, garbage collection processing program, storage area management program, and message management program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6410365A (en) * 1987-07-03 1989-01-13 Fuji Electric Co Ltd Alternate buffer automatic acquisition system
JPH08339324A (en) * 1995-06-12 1996-12-24 Fuji Xerox Co Ltd Information processor
JPH09319658A (en) * 1996-05-24 1997-12-12 Nec Corp Memory managing system for variable page size
JP2003196152A (en) * 2001-12-27 2003-07-11 Nec Corp Memory pool management method
JP2006126973A (en) * 2004-10-26 2006-05-18 Mitsubishi Electric Corp Storage area management method, storage area allocation program, garbage collection processing program, storage area management program, and message management program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015143943A (en) * 2014-01-31 2015-08-06 富士通株式会社 information processing apparatus, control method, and control program
CN115373964A (en) * 2022-10-24 2022-11-22 北京智芯微电子科技有限公司 Memory out-of-range detection method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US8583756B2 (en) Dynamic configuration and self-tuning of inter-nodal communication resources in a database management system
JP5939740B2 (en) Method, system and program for dynamically allocating resources
US7882505B2 (en) Method and apparatus for switching between per-thread and per-processor resource pools in multi-threaded programs
US7844853B2 (en) Methods and apparatus for restoring a node state
US10248175B2 (en) Off-line affinity-aware parallel zeroing of memory in non-uniform memory access (NUMA) servers
JP5510556B2 (en) Method and system for managing virtual machine storage space and physical hosts
US6968557B1 (en) Reducing stack memory resources in a threaded computer system
US20090307432A1 (en) Memory management arrangements
JP2008226181A (en) Parallel execution program, recording medium storing it, parallel execution device, and parallel execution method
US7770177B2 (en) System for memory reclamation based on thread entry and release request times
WO2020125396A1 (en) Processing method and device for shared data and server
KR20090108868A (en) Virtual machine management system and method for managing processor resources thereof
JP4241921B2 (en) Computer system and its resource allocation method
KR20070090649A (en) Apparatus and method for providing cooperative scheduling on multi-core system
US7523284B1 (en) Method and apparatus for providing memory management within a system management mode
Li et al. A novel disk I/O scheduling framework of virtualized storage system
WO2012107988A1 (en) Memory management program, memory management method and information processing device
CN108287762B (en) Distributed computing interactive mode use resource optimization method and computer equipment
US11663026B2 (en) Allocation of accelerator resources based on job type
JP4211645B2 (en) A computer system with a dedicated processor
Jeon et al. Design and implementation of Multi-kernel manager
JP2011257973A (en) Memory management method and memory management device
CN114168334A (en) Spare frame-based execution allocation method, device, equipment and storage medium
JPH07182298A (en) Method and device for processing information
JPH02178747A (en) Memory control system for virtual storage computer system

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: 11858319

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: 11858319

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP