WO2010113380A1 - Système de calculateur - Google Patents

Système de calculateur Download PDF

Info

Publication number
WO2010113380A1
WO2010113380A1 PCT/JP2010/000804 JP2010000804W WO2010113380A1 WO 2010113380 A1 WO2010113380 A1 WO 2010113380A1 JP 2010000804 W JP2010000804 W JP 2010000804W WO 2010113380 A1 WO2010113380 A1 WO 2010113380A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
shared
block
data
read
Prior art date
Application number
PCT/JP2010/000804
Other languages
English (en)
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 日本電気株式会社
Publication of WO2010113380A1 publication Critical patent/WO2010113380A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Definitions

  • the present invention relates to a computer system, and more particularly to a computer system including an external storage device that stores a file containing read-only data, a main storage device that includes a shared memory unit, and a data processing device.
  • Protection attributes such as read (read), write (write), execute (execute), etc. can be set independently for the memory, so if you set the protection attributes appropriately when reading a program or shared library into the memory For example, when there is a bug in the program, an appropriate countermeasure can be taken.
  • a program and a shared library are divided into a text area (program body to be executed) and a data area (data used when executing the program).
  • a data area data used when executing the program.
  • the text area sets read and execute attributes
  • the data area sets read and write attributes. That is, the value in the data area can be rewritten, while the value in the text area cannot be rewritten.
  • the text area is read-only, the text area of the same shared library can be shared with another program even while a certain program is being executed.
  • a memory address used in a program at the time of memory access is called a virtual memory address (or virtual address).
  • the virtual memory address designated by the program is converted into a fixed physical memory address (or physical address) of the actually mounted memory. This address conversion work is performed at high speed by hardware called MMU (Memory Management Unit).
  • the MMU manages the memory separately for each block.
  • a certain virtual memory address is divided into a virtual block address and an intra-block offset.
  • a certain physical memory address is divided into a physical block address and an intra-block offset.
  • the intra-block offset uses the intra-block offset of the virtual address as it is as the intra-block offset of the physical address, and converts the virtual block address into a physical block address.
  • a method in which one virtual storage area exists in the entire computer system and the virtual storage area is divided into partitions and used is called a single virtual storage system.
  • a method of assigning independent virtual memory for each program is called a multiple virtual memory method.
  • storage protection and security can be maintained between programs.
  • the shared library is mapped so as to have the same address on the shared memory.
  • the text library When arranging the text area of the shared library in the shared memory, the text library is arranged so that the head address of the text area of the shared library matches the head address of the memory block (for example, see FIG. 8 of Patent Document 1).
  • the data area of the shared library needs to be changed from the text area and the protection attribute, the data area is arranged in a memory block different from the memory block in which the text area is arranged.
  • the start address of the data area is arranged in an area starting from a position shifted from the start address of the memory block by an offset equal to the size of the text area (for example, see Non-Patent Document 1). .
  • the size of the text area of the shared library is not necessarily the same as the memory block size. For this reason, the problem of an area that cannot be used in the memory block occurs. This problem is called internal memory fragmentation.
  • there are two shared libraries A and B where the text areas are a and b, and the data areas are a 'and b'.
  • the size of the memory block is 4 kilobytes and the size of the text area and data area of the shared libraries A and B is 4 kilobytes or less, if these two shared libraries A and B are arranged in the shared memory, for example, FIG. As shown. In FIG. 8, an unhatched area in the memory block and an offset area located in front of the data areas a 'and b' are unused areas.
  • a computer system capable of changing the size of a memory block has been put into practical use in accordance with the increase in the amount of memory mounted and the necessity of efficient memory management.
  • a computer system that can specify any size among nine types of block sizes, 4 kilobytes, 16 kilobytes, 256 kilobytes, 1 megabyte, 4 megabytes, 16 megabytes, 64 megabytes, and 256 megabytes.
  • the file size of the shared library is not necessarily increased accordingly.
  • the internal fragmentation of the memory increases as the block size increases.
  • a larger unused area is created in the memory block, resulting in a situation where the memory cannot be used up.
  • the unused area generated in the memory block in which the data areas a ′ and b ′ are arranged has a problem in terms of storage protection and file structure, but the memory in which the text areas a and b are arranged.
  • the unused area generated in the block has room for reduction.
  • An object of the present invention is to provide a computer system that solves the above-described problem, that is, the problem that the internal fragmentation of a memory becomes large when loading read-only data of a file into a shared memory.
  • the computer system of the present invention includes an external storage device that stores a plurality of files including read-only data that is commonly used by one or more programs, and a main memory that includes a shared memory unit that is commonly used by the one or more programs. Execution of a program for loading read-only data of a plurality of files into the same memory block of the shared memory unit in a computer system comprising a device and a data processing device connected to the external storage device and the main storage device A part.
  • the internal fragmentation of the memory that occurs when loading the read-only data of the file into the shared memory can be reduced.
  • FIG. 10 is an explanatory diagram of a method for arranging a shared library in a memory block in Patent Document 1.
  • FIG. FIG. 5 is an illustration of a method according to the invention for placing a shared library in a memory block. It is a figure which shows the example of allocation of the physical block address of a main memory. It is a figure which shows the state of a certain time of the mapping table part of a 1st execution program. It is a figure which shows the example of the content at another time of the mapping table part of a 1st execution program. It is a figure which shows the example of the content at a certain time of the mapping table part of a 2nd execution program. It is a figure which shows the example of the content at another time of the mapping table part of a 2nd execution program.
  • the computer system 100 includes at least a main storage device 110, an external storage device 120, and a data processing device 130 that operates under program control.
  • the main storage device 110 includes a shared memory unit 111.
  • the shared memory unit 111 is a memory shared between programs (application programs and the like), and is managed by being divided into blocks having the same size as the virtual storage block of the program.
  • the block size is variable, and an arbitrary size can be designated from a plurality of predetermined sizes.
  • the minimum value of a plurality of predetermined sizes is 4 kilobytes (4,096 bytes), and the remaining size is 2 n times (n is a positive integer of 1 or more) times 4 kilobytes. It is a size.
  • the reason why the remaining block size is 2 n times the minimum size is as follows.
  • the shared library 1211 is loaded so that its head address coincides with an address boundary determined by the minimum size. For this reason, if the size of the remaining block is not 2 n times the minimum size, a case may occur where the head address of the block does not coincide with the address boundary determined by the minimum size. This is because when the first shared library is loaded into the block, an empty area is generated at the beginning of the block.
  • Each block of the shared memory unit 111 can be shared by a plurality of programs.
  • the text area of the shared library is read by the data processing device 130.
  • the text area of the shared library read into the block of the shared memory unit 111 is called from the program and used.
  • the external storage device 120 includes a file system unit 121.
  • the file system unit 121 holds an execution file, a shared library, and other files necessary for the execution of the data processing device 130.
  • the shared library 1211 includes one or more library functions that are commonly used by one or more programs.
  • the external storage device 120 is used for reading a file, but the method of using the external storage device 120 is not limited thereto.
  • the data processing device 130 includes a shared memory management unit 131, a shared memory management table unit 132, a program execution unit 133, a shared library management table unit 134, a mapping table unit 135, and a mapping address determination unit 136. Composed.
  • the shared memory management table unit 132 is a table for managing the usage status of the shared memory unit 111.
  • FIG. 5 shows the structure of one entry of the shared memory management table unit 132, which is composed of a shared memory block address 1321, a head physical address 1322, and a free size 1323.
  • the entry of the shared memory management table unit 132 includes attributes representing access restrictions such as read / write / execution of access to the shared memory unit 111 and other attributes for control. May be.
  • the shared memory block address 1321 is a number (memory block number) used when managing the shared memory unit 111 in block size.
  • the start physical address 1322 is the start physical address of the block of the shared memory unit 111.
  • the empty size 1323 indicates an unused memory size in the block of the shared memory unit 111.
  • the initial value of the empty size 1323 is a block size, and every time a new shared library 1211 is loaded into the block, an amount corresponding to the size of the shared library 1211 is subtracted.
  • the on-demand paging method is a method in which a physical page (physical block) is allocated to a logical page (logical block) at the time when the memory contents of the corresponding address are required.
  • the page is not read into the memory unless the page is actually accessed, so that the memory usage can be kept low.
  • the block size of the computer system 100 is the minimum block size of 4 KB
  • the page size is also 4 KB. That is, pages are read into the memory in units of 4 KB. Therefore, if the top address of the shared library 1211 always coincides with the 4 KB boundary, the shared library 1211 having a capacity of 4 KB or less can be accommodated in one page, and can be read into the memory by paging processing for one page.
  • the shared memory management table unit 132 may have various management methods other than those described above. For example, a method of managing not every shared memory block but every free area is also conceivable. This is convenient for the purpose of releasing the memory in which the shared library 1211 is loaded when a certain shared library 1211 is not linked from any program.
  • the shared memory management unit 131 refers to or rewrites the shared memory management table unit 132 to manage the physical address and remaining capacity of the shared memory unit 111 mapped to the program.
  • the shared library management table unit 134 is a table for managing the usage status of the shared library 1211 and the loading status to the shared memory unit 111.
  • FIG. 6 shows the structure of one entry of the shared library management table unit 134, which is composed of a shared library name 1341, a shared memory block address 1342, and a physical address 1343.
  • the entry of the shared library management table unit 134 may include an attribute representing access restriction of the shared library 1211 and other attributes for control.
  • the shared library name 1341 is the file name of the shared library 1211 included in the file system unit 121.
  • the shared memory block address 1342 is a shared memory block address of the shared memory unit 111 in which the shared library 1211 is loaded.
  • the physical address 1343 is a physical address at which the shared library 1211 is loaded, and is a physical address in the block of the shared memory unit 111 indicated by the shared memory block address 1342.
  • the program execution unit 133 loads the shared library 1211 necessary for executing the program to the shared memory unit 111 and maps it, and then executes the program.
  • the program execution unit 133 determines whether or not the shared library 1211 is already loaded in the shared memory unit 111, and obtains information on the shared library 1211 loaded in the shared memory unit 111. 134 is referred to or rewritten.
  • the program execution unit 133 attempts to reduce internal fragmentation of the memory by actively loading a plurality of shared libraries 1211 into one block of the shared memory unit 111.
  • the mapping table part 135 describes the correspondence between the virtual memory address of the program and the physical memory address of the main storage device 110. Since the computer system 100 according to the present embodiment employs a multiple virtual storage management system that provides virtual space independently to each program, the mapping table unit 135 exists for each program. In the memory access instructed by the program, the main storage device 110 is accessed using the physical address obtained by searching the mapping table unit 135 corresponding to the program with the virtual address.
  • a computer system to which the present invention is applied is not limited to a computer system that employs a multiple virtual storage management method, and can also be applied to a computer system that employs a single virtual storage management method.
  • FIG. 7 shows one entry of the mapping table unit 135, which is composed of a virtual block address 1351 and a physical block address 1352.
  • the entry of the mapping table unit 135 may include attributes representing access restrictions such as reading / writing / execution of memory access and other attributes for control.
  • the virtual block address 1351 is a block number of a virtual memory address assigned for each program. Since all programs can have the same size, for example, in the case of a 32-bit address space, all programs hold information corresponding to 1,048,576 entries.
  • the physical block address 1352 is a block number of a physical memory address where the program is actually loaded.
  • the same physical block address is written in association with the same or different virtual block address in the mapping table unit 135 of a plurality of programs, the plurality of programs are in a state of sharing the physical block. For this reason, if the text area of the shared library 1211 is stored in the physical block, the text area of the shared library 1211 is shared by a plurality of programs.
  • the mapping address determination unit 136 refers to the mapping table unit 135 to determine a virtual memory address for mapping the block of the shared memory unit 111 loaded with the shared library 1211 necessary for program execution to the program. . Further, the mapping address determination unit 136 notifies the mapping table unit 135 of the physical block address 1352 of the shared memory unit 111 and the determined virtual block address 1352 to update the mapping table unit 135.
  • the mapping address determination unit 136 maps the block if there is already a block of the shared memory unit 111 including the shared library 1211, and otherwise maps the block. A block of the shared memory unit 111 that is sufficiently free to place the shared library 1211 is secured, the shared library 1211 is read, and the block is mapped to a free virtual address of the program.
  • FIG. 2 is a flowchart showing the program execution operation in the computer system 100 according to the present embodiment.
  • the program execution unit 133 first checks the file of the execution program and maps the necessary shared library 1211 to the execution program (step S10). Thereafter, the program execution unit 133 executes the execution program (step S20).
  • FIG. 3 is a flowchart showing the details of step S10 of FIG. 2, that is, the mapping operation of the shared library 1211 before executing the program in the present embodiment.
  • the program execution unit 133 performs the process of FIG. 3 for each shared library 1211 necessary for executing the execution program.
  • the mapping operation of the shared library 1211 in the present embodiment will be described with reference to FIG.
  • the program execution unit 133 searches the shared library management table unit 134 to check whether or not the shared library 1211 is already loaded in the shared memory unit 111 (step S100).
  • the shared memory management unit 1131 allocates a block of the shared memory unit 111 that has enough free space for the shared library 1211 to be loaded. Then, it is loaded (step S101) and loaded into a vacant part of the block of the allocated shared memory unit 11 (step S102).
  • the text area of the shared library 1211 is loaded, the text area of the shared library 1211 is loaded into an empty block so that the physical address at the head of the text area matches the address boundary determined by the minimum block size. To do.
  • the program execution unit 133 assigns a free virtual memory address of the execution program by the mapping address determination unit 136 (step S103) and loads the shared library 1211 of the shared memory unit 111 to the virtual memory address. Is mapped (step S104).
  • step S100 When the necessary shared library 1211 is loaded in the shared memory unit 111 (Yes in step S100), the program execution unit 133 assigns a free virtual memory address of the execution program by the mapping address determination unit 136 (step S103). Then, the block in which the shared library 1211 of the shared memory unit 11 has been loaded is mapped to the virtual memory address (step S104).
  • the program execution unit 133 starts executing the execution program.
  • mapping of a certain shared library 1211 can be delayed until the execution program actually accesses the library function in the shared library 1211 for the first time, not when the execution program is started. The contents are the same.
  • a main storage device 110 composed of a nonvolatile storage unit 112 and a volatile storage unit 113 is connected to a CPU 140 through a bus 160.
  • the CPU 140 has an MMU 141.
  • the CPU 140 corresponds to the data processing device 130 of the first embodiment in FIG.
  • the nonvolatile storage unit 112 stores an OS 150 and a plurality of programs (not shown) in advance. Further, the mapping address determination unit 136, the shared memory management unit 131, and the program execution unit 133 are implemented as a function of the OS 150.
  • a shared memory unit 111 In the volatile storage unit 113, a shared memory unit 111, a mapping table unit 135, a shared memory management table unit 132, and a shared library management table unit 134 are secured.
  • the data processing apparatus 130 includes a shared memory management unit 131, a shared memory management table unit 132, a program execution unit 133, a shared library management table unit 134, a mapping table unit 135, and a mapping It is assumed that the address determination unit 136 is provided in hardware.
  • the shared memory management unit 131, the program execution unit 133, and the mapping address determination unit 136 are realized by the CPU 140 and the OS 150 executed thereon.
  • the shared memory management table unit 132, the shared library management table unit 134, and the mapping table unit 135 are stored in the main storage device 110 as tables that are referenced and updated from the OS 150.
  • the shared memory management unit 131, the program execution unit 133, and the mapping address determination unit 136 can be realized in hardware and can be realized in software.
  • FIG. 10 shows an example of physical block address allocation of the main storage device 110.
  • physical block addresses 0x11 to 0x19 are assigned to the nonvolatile storage unit 112, and physical block addresses 0x111 to 0x119 are assigned to the shared memory unit 111.
  • the size is extremely small in order to easily explain the present embodiment, and many physical block addresses are assigned to the actual storage medium.
  • the memory block size selected by designation is 1 megabyte (hexadecimal 0x100000), and the minimum block size is 4 kilobytes (hexadecimal 0x1000).
  • FIG. 11 shows a specific example of the contents of the mapping table unit 135 in the initial state of the first execution program (size is 1 megabyte). Although the number of entries is extremely reduced in FIG. 11 for ease of explanation, there are actually many entries. As shown in FIG. 11, in the initial state, the physical block address of the block that stores the first execution program stored in the nonvolatile storage unit 111 for the block of the virtual block address 0x1000 of the first execution program 0x12 is written.
  • FIG. 13 shows a specific example of the contents of the mapping table unit 135 in the initial state of the second execution program (size is 2 megabytes). Although the number of entries is extremely reduced in FIG. 13 for ease of explanation, there are actually many entries.
  • FIG. 15 shows the specific contents of the initial state of the shared memory management table unit 132. Although the number of entries is extremely reduced in FIG. 15 for ease of explanation, there are actually many entries. As shown in FIG. 15, in the initial state, the shared library is not loaded in each shared memory block, and all are free areas.
  • FIG. 19 shows specific contents of the initial state of the shared library management table unit 134. Although the number of entries is extremely reduced in FIG. 19 for ease of explanation, there are actually many entries. As shown in FIG. 19, in the initial state, all entries in the shared library management table unit 134 are NULL. That is, in the initial state, no shared library 1211 is loaded in the shared memory unit 111.
  • shared library c shared library / lib / libc. so (text area is 1 kilobyte)
  • shared library m shared library m
  • shared library j The following two shared libraries are required by the second execution program.
  • Shared library m (2) Shared library / lib / libj. so (text area is 16 kilobytes) (hereinafter referred to as shared library j).
  • the first program and the second program require the same shared library m. Further, the first program does not require the shared library j required by the second program, and the second program does not require the shared library c required by the first program.
  • the first execution program has a size of 1 megabyte and is loaded into the physical memory block 0x12, and the corresponding virtual block address uses 0x1000. Since it is 1 megabyte, only one physical memory block is used.
  • the mapping table unit 135 of the first execution program is as shown in FIG.
  • the program execution unit 133 searches each entry in the shared library management table unit 134 to search whether the shared library c is included in any shared memory block.
  • the program execution unit 133 notifies the shared memory management unit 131 of the size of 1 kilobyte of the text area of the shared library c and requests a block of the shared memory unit 111. Since the shared memory management unit 131 refers to the shared memory management table unit 132 and is in the state shown in FIG. 15, for example, a shared memory block address 0 and a head address 0x11100000 are programmed as information related to a shared memory block having a free space of 1 kilobyte. Return to the execution unit 133.
  • the program execution unit 133 issues an instruction to read the shared library c from the file system unit 121 to the shared memory unit 111, and the shared library c is 1 kilobyte starting from the physical address 0x11100000 of the block at the block address 0 of the shared memory unit 111. Load into region. When the loading is completed, the program execution unit 133 registers “shared library name / lib / libc.so”, “shared memory block address 0”, and “physical address 0x11100000” in the shared library management table unit 134. As a result, the shared library management table unit 134 changes from the state of FIG. 19 to the state of FIG.
  • the program execution unit 133 sets the size of the text area of the shared library c to 1 kilobyte, but the minimum block size is 4 kilobytes.
  • the shared memory management table unit 132 is updated to reduce only kilobytes. As a result, the shared memory management table unit 132 changes from the state of FIG. 15 to the state of FIG.
  • mapping address determination unit 136 searches for an empty area of the virtual memory block of the first program. Assuming that 0x1001 is obtained, the mapping address determination unit 136 registers “virtual block address 0x1001” and “physical block address 0x111” in the mapping table unit 135 of the first program. As a result, the mapping table unit 135 of the first program changes from the state of FIG. 11 to the state of FIG.
  • the program execution unit 133 loads the data area of the shared library c into an empty block of a memory other than the shared memory by a method similar to the conventional method, and maps the block to a virtual memory block of the first program.
  • the program execution unit 133 holds “shared library name / lib / libm.so” and “virtual address 0x100100000” as information necessary for calling the shared library c from the first execution program.
  • the shared library c includes a plurality of library functions, what is actually called is a library function in the shared library c.
  • Specific processing for realizing dynamic linking follows a standard format such as ELF.
  • the program execution unit 133 searches each entry of the shared library management table unit 134 to search whether the shared library m is included in any shared memory block. Since the shared library management table unit 134 at this time is in the state shown in FIG. 20, it can be seen that the shared library m is not loaded in the shared memory unit 111.
  • the program execution unit 133 notifies the shared memory management unit 131 of the size of the text area of the shared library m, 8 kilobytes, and requests a block of the shared memory unit 111.
  • the shared memory management unit 131 refers to the shared memory management table unit 132 and is in the state of FIG. 16, for example, the shared memory block number 0 and the head address 0x11101000 are used as information related to a shared memory block having a free space of 8 kilobytes or more. It returns to the program execution unit 133.
  • the program execution unit 133 issues an instruction to read the shared library m from the file system unit 121 to the shared memory unit 111, and loads the shared library m into an 8 kilobyte area starting from the physical address 0x11101000 of the block of the shared memory block address 0 To do.
  • the program execution unit 133 registers “shared library name / lib / libm.so”, “shared memory block address 0”, and “physical address 0x11101000” in the shared library management table unit 134.
  • the shared library management table unit 134 changes from the state of FIG. 20 to the state of FIG.
  • the program execution unit 133 is shared through the shared memory management unit 131 to reduce the free size of the shared memory block number 0 by 8 kilobytes.
  • the memory management table unit 132 is updated. As a result, the shared memory management table unit 132 changes from the state of FIG. 16 to the state of FIG.
  • mapping address determination unit 136 Since the block having the shared memory block address 0 is already mapped to the first execution program, the mapping address determination unit 136 does not need to perform mapping processing on the mapping table unit 135 of the first execution program again. That is, the mapping table section 135 of the first program remains in the state shown in FIG.
  • the program execution unit 133 loads the data area of the shared library m into an empty block of a memory other than the shared memory by a method similar to the conventional method, and maps the block to a virtual memory block of the first program.
  • the program execution unit 133 Since the in-block offset is 0x1000, the program execution unit 133 has information of “shared library name / lib / libm.so” and “virtual address 0x100101000” as information necessary for calling the shared library m from the first execution program. Are stored in the data area (not shown) of the first execution program.
  • one shared memory block is shared by the text areas of a plurality of shared libraries, so that the internal fragmentation of the memory can be reduced.
  • the main body of the second execution program has a size of 2 megabytes and is loaded into physical memory blocks 0x13 to 0x14. Further, 0x1000 to 0x1001 are used as virtual block addresses. Since it is 2 megabytes, two physical memory blocks are used. In this case, the mapping table unit 135 of the second execution program is as shown in FIG.
  • the program execution unit 133 searches each entry of the shared library management table unit 134 to search whether the shared library m is included in any shared memory block. Since the shared library management table unit 134 at this time is in the state shown in FIG. 21, it can be seen that the shared library m is already loaded in the block of the shared memory block address 0 of the physical block address 0x111.
  • mapping address determination unit 136 searches for a free area in the virtual memory block of the second execution program and obtains 0x1002.
  • the mapping address determination unit 136 registers “virtual block address 0x1002” and “physical block address 0x111” in the mapping table unit 135 of the second execution program.
  • the mapping table unit 135 of the second execution program changes from the state of FIG. 13 to the state of FIG.
  • the program execution unit 133 Since the in-block offset is 0x1000, the program execution unit 133 has information of “shared library name / lib / libm.so” and “virtual address 0x100201000” as information necessary for calling the shared library m from the second execution program. Are stored in the data area (not shown) of the second execution program.
  • both the shared library c and the shared library m are loaded in the block of the shared memory block address 0.
  • the second program does not need to link the shared library c, but can be read from the address space of the second program as a result.
  • mapping is performed in a read-only manner, there is no particular problem even if the shared library c is shared.
  • the program execution unit 133 searches each entry in the shared library management table unit 134 to search whether the shared library j is included in any shared memory block. Since the shared library management table unit 134 at this time is in the state shown in FIG. 21, it can be seen that the shared library j is not loaded in the shared memory unit 111.
  • the program execution unit 133 notifies the shared memory management unit 131 of the size of the text area of the shared library j, which is 16 kilobytes, and requests a block of the shared memory unit 111.
  • the shared memory management unit 131 refers to the shared memory management table unit 132
  • the shared memory management table unit 132 is in the state of FIG. It returns to the program execution unit 133.
  • the program execution unit 133 issues an instruction to read the shared library j from the file system unit 121 to the shared memory unit 111, and loads the shared library j into a 16-kilobyte area starting from the physical address 0x1113000 in the block of the shared memory block address 0 To do.
  • the program execution unit 133 registers “shared library name / lib / libj.so”, “shared memory block address 0”, and “physical address 0x11103000” in the shared library management table unit 134.
  • the shared library management table unit 134 changes from the state of FIG. 21 to the state of FIG.
  • the program execution unit 133 is shared through the shared memory management unit 131 to reduce the free size of the shared memory block number 0 by 16 kilobytes.
  • the memory management table unit 132 is updated. As a result, the shared memory management table unit 132 changes from the state of FIG. 17 to the state of FIG.
  • mapping address determination unit 136 Since the block having the shared memory block address 0 has already been mapped to the second execution program, the mapping address determination unit 136 does not need to perform the mapping process on the mapping table unit 135 of the second execution program again. That is, the mapping table part 135 of the second program remains in the state shown in FIG.
  • the program execution unit 133 loads the data area of the shared library j into an empty block of a memory other than the shared memory by a method similar to the conventional method, and maps the block to a virtual memory block of the second program.
  • the program execution unit 133 Since the intra-block offset is 0x3000, the program execution unit 133 includes information on “shared library name / lib / libj.so” and “virtual address 0x100203000” as information necessary for calling the shared library j from the second execution program. Hold.
  • the shared memory block address 0 is loaded with the shared library c, the shared library m, and the shared library j.
  • the first program does not need to link the shared library j, but as a result can be read from the address space of the first program.
  • the mapping is performed only for reading, there is no particular problem even if the shared library j is shared.
  • the internal fragmentation of the memory that occurs when the shared library is loaded into the shared memory can be kept small.
  • the first reason is that one shared memory block is shared by multiple shared library text areas.
  • the second reason is that when one shared memory block is shared by the text areas of a plurality of execution programs, even if a text area of a shared library which is unnecessary for the execution program is included, Because sharing is done. That is, when a shared library text area used by a program is newly loaded, even if the shared library text area not used by the program is already loaded, as long as there is a free area, This is because an algorithm for selecting as a load destination shared memory block is employed.
  • FIG. 9 shows an example when the minimum block size is 2 kilobytes.
  • the program execution unit 133 determines that the top physical address for loading the text area of the shared library 1211 is the minimum block size (first and second embodiments). In this case, the text area of the shared library 1211 is loaded into the memory block of the shared memory unit 111 so as to coincide with the address boundary determined by 4 KB). However, as a third embodiment of the present invention, the program execution unit 133 matches the address boundary determined by the size of the head physical address for loading the text area of the shared library 1211 smaller than the minimum block size. As described above, the text area of the shared library 1211 may be loaded into the memory block of the shared memory unit 111. According to the third embodiment, the internal fragmentation of the memory that occurs when the text area of the shared library is loaded into the shared memory can be further reduced.
  • the case where the text area of the shared library is arranged in the shared memory has been taken up.
  • the data of the read-only data file is arranged in the shared memory.
  • the present invention is also applicable to.
  • FIG. 23 is a block diagram illustrating a configuration of a computer system according to the present embodiment. In the present embodiment, an outline of the above-described computer system will be described.
  • the computer system according to the present embodiment is common to the external storage device 2 that stores a plurality of files 1 including read-only data commonly used by one or more programs and the one or more programs.
  • the same memory block of the shared memory unit 3 in a computer system composed of the main storage device 4 including the shared memory unit 3 used for the memory, the external storage device 2 and the data processing device 5 connected to the main storage device 4 Are provided with a program execution unit 6 for loading read-only data of a plurality of files 1.
  • the program execution unit 6 transfers the read-only data of the file 1 to the shared memory unit so that the leading physical address for loading the read-only data of the file 1 matches the address boundary determined by a predetermined size. 3 is loaded into the memory block.
  • the computer system adopts a configuration in which the minimum value of the block size, which is a storage space management unit, is used as the predetermined size.
  • the size of a block which is a management unit of storage space, is variable.
  • the minimum value of the block size is S
  • the variable block size other than that is 2 n (S).
  • the configuration is such that n is a positive integer) times.
  • the program execution unit 6 when the program execution unit 6 newly loads read-only data of a file used in a certain program into the memory block of the shared memory unit 3, the read-only data of the file that is not used by the program is stored.
  • a configuration is adopted in which even a memory block that has already been loaded is selected as a load destination memory block as long as there is an empty area.
  • the predetermined size is set.
  • S where L is the size of the read-only data of the loaded file and f up is a function for rounding up the decimal point
  • the free size of the memory block managed by the shared memory management table unit is expressed as S ⁇ f up (L / S)
  • a shared memory management unit that subtracts only is adopted.
  • the above computer system adopts a configuration in which the read-only data of file 1 is the text area of the shared library.
  • the above computer system adopts a configuration in which file 1 is a read-only data file.
  • the read-only data management method which is executed when the above-described computer system operates, stores a plurality of files 1 including read-only data commonly used by one or more programs. And the external storage device 2 including the shared memory unit 3 commonly used in the one or more programs, and the external storage device 2 and the data processing device 5 connected to the main storage device 4.
  • Read-only data management method in the computer system the step of loading the read-only data of the file 1 into the memory block of the shared memory unit 3, and the reading of another file when there is an empty area in the memory block And a step of loading the dedicated data into the memory block.
  • the computer system described above can be realized by incorporating a program into a computer.
  • a program according to another aspect of the present invention is common to the external storage device 2 that stores a plurality of files 1 including read-only data that is commonly used by one or more programs, and the one or more programs.
  • a computer composed of a main storage device 4 including the shared memory unit 3 used for the above, and an external storage device 2 and a data processing device 5 connected to the main storage device 4 is placed in the same memory block of the shared memory unit 3.
  • a configuration is adopted in which the program execution unit 6 loads the read-only data of the plurality of files 1.
  • the present invention can be applied to uses such as a computer system that realizes a system with small internal fragmentation of memory.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Afin de résoudre un problème consistant en ce que la fragmentation interne de la mémoire devient plus grande lorsque des données à lecture seule d'un fichier sont chargées dans une mémoire partagée, le système de calculateur est configuré avec un dispositif de mémorisation externe qui mémorise une pluralité de fichiers contenant des données à lecture seule utilisées en commun par un ou plusieurs programmes ; une unité de mémorisation principale contenant une unité de mémoire partagée qui est utilisée en commun par un ou plusieurs programmes ; et un dispositif de traitement de données connecté au dispositif de mémorisation externe et au dispositif de mémorisation principal. Une unité d'exécution de programme pour charger des données à lecture seule d'une pluralité de fichiers est prévue dans un même bloc de mémoire de l'unité de mémoire partagée.
PCT/JP2010/000804 2009-03-31 2010-02-10 Système de calculateur WO2010113380A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2009-084860 2009-03-31
JP2009084860 2009-03-31

Publications (1)

Publication Number Publication Date
WO2010113380A1 true WO2010113380A1 (fr) 2010-10-07

Family

ID=42827698

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2010/000804 WO2010113380A1 (fr) 2009-03-31 2010-02-10 Système de calculateur

Country Status (1)

Country Link
WO (1) WO2010113380A1 (fr)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0619717A (ja) * 1992-06-30 1994-01-28 Juki Corp 情報処理装置
JPH06332675A (ja) * 1993-05-20 1994-12-02 Mitsubishi Electric Corp 共有ライブラリ管理機構
JP2008033838A (ja) * 2006-07-31 2008-02-14 Sanyo Electric Co Ltd メモリ管理装置及びメモリ管理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0619717A (ja) * 1992-06-30 1994-01-28 Juki Corp 情報処理装置
JPH06332675A (ja) * 1993-05-20 1994-12-02 Mitsubishi Electric Corp 共有ライブラリ管理機構
JP2008033838A (ja) * 2006-07-31 2008-02-14 Sanyo Electric Co Ltd メモリ管理装置及びメモリ管理方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CARY A. COUTANT ET AL.: "HP-UX Kyoyu Library", UNIX MAGAZINE, vol. 9, no. 4, 1 April 1994 (1994-04-01), pages 129 - 139 *

Similar Documents

Publication Publication Date Title
US20230259452A1 (en) Computing system and method for controlling storage device
JP5255348B2 (ja) クラッシュダンプ用のメモリアロケーション
JP4815346B2 (ja) コンピュータ装置のデータにアクセスする方法
JP6460497B2 (ja) ファイルアクセス方法およびファイルアクセス装置、ならびに記憶装置
KR102061079B1 (ko) 파일 액세스 방법 및 관련 기기
US8176142B2 (en) Shared JAVA jar files
JP5422652B2 (ja) フラッシュメモリ記憶装置における動的メモリ割当てに起因する自己エビクションの回避
US10824555B2 (en) Method and system for flash-aware heap memory management wherein responsive to a page fault, mapping a physical page (of a logical segment) that was previously reserved in response to another page fault for another page in the first logical segment
US20150220452A1 (en) System, Method and Computer-Readable Medium for Dynamically Mapping a Non-Volatile Memory Store
CN110928803B (zh) 一种内存管理方法及装置
JPH07152641A (ja) プログラムキャッシュ装置
CN116302491A (zh) 内存管理方法、装置、计算机设备及存储介质
JP2011186561A (ja) メモリ管理装置
CN115712500A (zh) 内存释放、内存恢复方法、装置、计算机设备及存储介质
US8185693B2 (en) Cache-line aware collection for runtime environments
WO2024108939A1 (fr) Cadre de mappage multi-niveau et procédé et système de traitement de demande d'opération de données
EP3690660B1 (fr) Procédé de mise en correspondance d'adresse de mémoire cache et dispositif associé
CN116225693A (zh) 元数据管理方法、装置、计算机设备及存储介质
CN113535392B (zh) 基于cma实现支持大内存连续分配的内存管理方法及系统
US20090031100A1 (en) Memory reallocation in a computing environment
WO2010113380A1 (fr) Système de calculateur
JP5891963B2 (ja) アドレス管理装置、及びプログラム
JP4792065B2 (ja) データ記憶方法
KR101825013B1 (ko) 비휘발성 메모리에 영구 보존 데이터를 저장할 수 있는 시스템에서의 데이터 관리 방법
JP2009301102A (ja) キャッシュメモリを利用するためのメモリシステム、その方法及びそのプログラム

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

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP