WO2014119063A1 - 情報処理装置、情報処理方法、およびプログラム - Google Patents

情報処理装置、情報処理方法、およびプログラム Download PDF

Info

Publication number
WO2014119063A1
WO2014119063A1 PCT/JP2013/078734 JP2013078734W WO2014119063A1 WO 2014119063 A1 WO2014119063 A1 WO 2014119063A1 JP 2013078734 W JP2013078734 W JP 2013078734W WO 2014119063 A1 WO2014119063 A1 WO 2014119063A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
area
memory
unit
management information
Prior art date
Application number
PCT/JP2013/078734
Other languages
English (en)
French (fr)
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 US14/765,366 priority Critical patent/US10503702B2/en
Publication of WO2014119063A1 publication Critical patent/WO2014119063A1/ja

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
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1847File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present invention relates to an information processing apparatus using a nonvolatile memory.
  • Non-Volatile Memory Non-Volatile Memory
  • NV memory Non-Volatile Memory
  • EEPROM EEPROM
  • An information processing apparatus includes an NV memory that is a non-volatile recording medium, a file system unit that manages one or more files stored in the NV memory, and an executing process.
  • the information processing apparatus includes an NV memory area that can be used as a file by the file system unit in response to the request, and a memory management unit that allocates the reserved area to the process.
  • An information processing apparatus is the information processing apparatus according to the first embodiment, wherein the file system unit is information for managing one or more files, A file management information storage means for storing one or more file management information, which is information in which a file identifier for identifying a file and an area identifier for identifying one or more NV memory areas corresponding to the file are associated with each other; In response to a request from an executing process, the management unit detects an unused area that is an unused NV memory area by using file management information in order to secure an NV memory area to be allocated to the process.
  • an unused area detecting means for acquiring one or more area identifiers for identifying unused areas, one or more area identifiers acquired by the unused area detecting means,
  • the file management information and either is with corresponding one or more file identifier yl management information has an information processing apparatus and a file management information write once means that appended to the file management information storage means.
  • An information processing apparatus is the information processing apparatus according to the first embodiment, wherein the file system unit is information for managing one or more files, File management information storage means for storing file management information, which is information in which a file identifier for identifying a file and an area identifier for identifying one or more NV memory areas corresponding to the file are associated with each other.
  • An area identifier storage means for storing one or more area identifiers; an area identifier acquisition means for acquiring one or more area identifiers from the file management information storage means; and storing the acquired area identifiers in the area identifier storage means; NV identified by one of one or more area identifiers stored in the area identifier storage means in response to a request from the process being executed An information processing apparatus and a assigning means for assigning a region of memory for the process.
  • the information processing apparatus is the information processing apparatus according to the third embodiment, and the area identifier acquisition unit is configured to perform all operations from the file management information storage unit at a predetermined timing.
  • This is an information processing apparatus that acquires the area identifier and accumulates the acquired area identifier in the area identifier storage means.
  • the information processing apparatus is the information processing apparatus according to the third embodiment, in which the area identifier acquisition unit is configured to respond to a request from the process being executed. It is determined whether or not one or more area identifiers are stored in the storage means, and if not stored, one or more area identifiers are acquired from the file management information storage means, and the acquired area identifiers are stored as area identifiers. An information processing apparatus that accumulates in the means.
  • An information processing apparatus is the information processing apparatus according to the first embodiment, and the file system unit requests the process in response to a request from the process being executed.
  • a file having the same size as the file size is written to the NV memory area, and the memory management unit assigns the NV memory area to which the file system unit has written the file to the process in response to a request from the process being executed. It is a processing device.
  • the NV memory when used as the main memory and storage, it is possible to reduce inconsistencies in the file system when the system is abnormally terminated.
  • Block diagram of information processing apparatus 1 according to Embodiment 1 A flowchart for explaining the overall operation of the information processing apparatus 1 according to the first embodiment. Flowchart for explaining area allocation processing in the first embodiment Flowchart for explaining area release processing in the first embodiment The figure which shows the example of the file management information in Embodiment 1 The figure which shows the example of the file management information in Embodiment 1 The figure which shows the example of the memory management information in Embodiment 1 The figure which shows the example of the memory management information in Embodiment 1 The figure which shows the example of the file management information in Embodiment 1 FIG. 3 is a diagram illustrating a configuration example of a system in the first embodiment.
  • the figure which shows the example of the prototype declaration of the function in Embodiment 1 The figure which shows the example of the call of the function in Embodiment 1
  • the figure which shows the experimental result of the comparison of the memory allocation cost in Embodiment 1 The figure which shows the example of the starting command of QEMU in Embodiment 1
  • the information processing apparatus 1 that uses an NV memory as a main memory and a storage without distinguishing between an area that is used as a main memory and an area that is used as a storage.
  • the information processing apparatus 1 managed by the file system will be described.
  • the storage is a so-called secondary storage device or a storage device called an auxiliary storage device.
  • the main memory is a so-called primary storage device or a storage device called a main storage device.
  • the “area used as the main memory” may be rephrased as “area used by the process being executed”.
  • FIG. 1 is a block diagram of the information processing apparatus 1 in the present embodiment.
  • the information processing apparatus 1 includes an NV memory 11, a reception unit 12, a file system unit 13, and a memory management unit 14.
  • the file system unit 13 includes a file management information storage unit 131.
  • the memory management unit 14 includes an area identifier storage unit 141, an unused area detection unit 142, a file management information addition unit 143, an area identifier acquisition unit 144, and an allocation unit 145.
  • the file system unit 13 and the memory management unit 14 included in the information processing apparatus 1 according to the present embodiment are, for example, a so-called OS or what is called a kernel of the OS.
  • the NV memory 11 is a non-volatile recording medium.
  • the NV memory 11 is, for example, PCM (Phase Change Memory, phase change memory), MRAM, ReMAM, EEPROM, flash memory, or the like.
  • the NV memory 11 is not particularly limited in shape or type as long as it is a nonvolatile memory.
  • the NV memory 11 is preferably a non-volatile memory that can be accessed in byte units, for example.
  • the NV memory 11 usually has one or more areas.
  • the area normally stores data used by the process.
  • the process may be called a job, a task, a thread, or the like, for example.
  • the data is, for example, a file, a part of the file, a value assigned to a variable, or the like.
  • the size (capacity) of the region is usually predetermined.
  • the size is, for example, 4 KB (kilobytes), 512 B (bytes), or the like.
  • the one area is used as, for example, a “block” from the file system unit 13 described later.
  • the one area is used as, for example, a “page” from the memory management unit 14 described later. That is, the one area is usually called by two or more names.
  • the size of the block and the size of the page are the same.
  • the size is preferably 4 KB.
  • one or more areas of the NV memory 11 are hereinafter referred to as “area of the NV memory 11” or “area” as appropriate. Further, an area where data is not written or an area where data writing is permitted is referred to as an unused area as appropriate. Further, an area where data is written, an area where data writing is not permitted, and the like will be appropriately referred to as a use area hereinafter.
  • the NV memory 11 is usually arranged in one physical address space.
  • the physical address space usually has one or more consecutive physical addresses.
  • “arranged in the physical address space” means that one or more areas of the NV memory 11 are associated with one physical address. That is, the one area is identified by one physical address.
  • the one area may be indirectly identified by, for example, a logical address or a virtual address.
  • one or more areas of the NV memory 11 are identified by area identifiers.
  • the area identifier is information for identifying the one or more areas.
  • the area identifier is, for example, a physical address, a logical address, or a virtual address. That is, the region identifier may be information that directly or indirectly identifies the one or more regions.
  • the placement of the NV memory 11 in the physical address space is normally performed by the file system unit 13 described later.
  • the arrangement may be performed by, for example, the memory management unit 14 described later.
  • the arrangement may be performed by, for example, an address space arrangement unit (not shown).
  • the accepting unit 12 accepts instructions and information.
  • the instruction is, for example, an instruction to execute a program, an instruction to execute a process, an instruction to assign an area to a process, an instruction to operate a file, or the like.
  • the information is, for example, a so-called command or an argument given to the command.
  • the file system unit 13 is a so-called file system.
  • the file system is usually a disk file system (local file system).
  • the file system is, for example, PRAMFS (Persistent and Protected RAM File System), Ext2 (Second Extended System), or SCMFS (A File System Storage Storage).
  • the file system supports XIP (eXecution-In-Place), and any file system that targets the NV memory 11 may be used. That is, the file system unit 13 uses the NV memory 11 as so-called storage.
  • the file system unit 13 usually divides the NV memory 11 into one or more areas and uses the one area as a block.
  • the file system unit 13 since the file system unit 13 is a file system, it manages one or more files stored in the NV memory 11. “Managing files” means, for example, writing a file requested to be written to the NV memory 11, reading a file requested to be read from the NV memory 11, and deleting a file requested to be deleted from the NV memory 11.
  • Deleting accumulating information for managing the written file (hereinafter referred to as file management information as appropriate) in the file management information storage unit 131 according to the writing, and deleting the information according to the deletion Deleting file management information corresponding to a file from the file management information storage unit 131, storing an area identifier for identifying an area in which no file is written, in the file management information storage unit 131, and an area in which the file is written Is obtained from the file management information storage means 131 upon request. It is like.
  • deleting a file indicates, for example, deleting the file management information corresponding to the file without deleting the file from the NV memory 11 or deleting the file in the file management information. For example, a flag may be given.
  • the file system unit 13 is a file system and is an OS function. Therefore, “file management” may be considered to include all processing performed by the file system and all functions of the file system.
  • the file system may be considered to include a so-called virtual file system.
  • the file management information is information for managing files.
  • the file management information usually has at least a file identifier and a region identifier.
  • One file identifier is usually associated with one or more area identifiers.
  • the file identifier is, for example, an arbitrary character string, an arbitrary numerical value, a so-called file name, or the like.
  • the file identifier may be any format or content as long as the file can be identified.
  • the file management information includes information indicating file attributes such as the date and time when the file was created, the date and time when the file was updated, the access right (permission) of the file, and the user who created the file. Also good. These pieces of information are usually associated with one file identifier.
  • the file system unit 13 when writing one file to the NV memory 11, the file system unit 13 first determines to which one or more areas the one file is to be written, for example. The one or more areas are usually unused areas. Then, the file system unit 13 divides the one file into one or more data for each determined area. Then, the file system unit 13 writes the divided one or more data in the determined one or more areas.
  • the file system unit 13 when one file is written in the NV memory 11, the file system unit 13 usually has a file identifier for identifying the written file and one or more area identifiers for identifying one or more areas to be written to. Is stored in the file management information storage unit 131.
  • the accumulation is usually an addition to the file management information storage unit 131.
  • the file system unit 13 when reading one file from the NV memory 11, the file system unit 13 first acquires an area identifier for identifying one or more areas in which the one file is written from the file management information. Then, the file system unit 13 acquires data of the file divided into one or more from the area indicated by the acquired one or more area identifiers.
  • the file system unit 13 when deleting one file from the NV memory 11, the file system unit 13 first acquires a file identifier for identifying one or more areas in which the one file is written from the file management information. . Then, the file system unit 13 deletes the data from the area indicated by the acquired one or more area identifiers. Note that “erasing” usually includes deleting the file management information.
  • the file system unit 13 normally deletes the file management information having a file identifier for identifying the deleted file from the file management information storage unit 131.
  • the file system unit 13 deletes, for example, file management information having a file identifier for identifying the one file from the file management information storage unit 131. May only do.
  • the deletion of the file management information may be, for example, giving a flag indicating deletion to the file management information.
  • file system inconsistency is a state in which the consistency of the file system is not maintained. This state is, for example, a state in which the file management information has an area identifier that is not associated with a file identifier. In other words, this state is a state in which the file management information has only the area identifier. That is, “file system inconsistency” is a state in which an area managed as a used area in the file management information is not used by any file.
  • the file system unit 13 may hold file area management information, which is information for managing one or more areas, for example. “Manage area” means to manage whether one area is an unused area or a used area.
  • the file area management information includes, for example, one or more area identifiers that identify unused areas. Further, the file area management information includes, for example, one or more area identifiers that identify used areas. Further, the file area management information includes, for example, one or more area identifiers that identify unused areas and used areas. In the case of having one or more area identifiers for identifying an unused area and a used area, each of the one or more area identifiers is usually associated with a flag indicating whether the area is an unused area or a used area. Yes.
  • the file area management information may be stored in, for example, a file area management information storage unit (not shown).
  • the file system unit 13 stores the file area management information by using one or more area identifiers for identifying each of the written areas as one or more area identifiers for identifying used areas. Accumulate in the means.
  • the file system unit 13 may delete the area identifier, or may add a flag indicating that the area is a used area to the area identifier.
  • the file system unit 13 uses one or more area identifiers for identifying the one or more deleted areas as area identifiers for identifying unused areas. Accumulate in management information storage means. When the same area identifier is already stored, the file system unit 13 may delete the area identifier, or may add a flag indicating that the area identifier is an unused area.
  • the file system unit 13 may determine the area using, for example, the above file area management information.
  • the file management information storage unit 131 stores one or more file management information.
  • the set of the one or more file management information is appropriately referred to as a file management information group. Since the file management information has already been described, the description thereof is omitted.
  • the memory management unit 14 performs so-called memory management.
  • Memory management refers to, for example, securing one or more areas of the NV memory 11 in response to a request from an executing process, allocating the secured area to the process, or when the process ends. For example, one or more areas allocated to the process are released as unused areas.
  • “Securing one or more areas” means obtaining one or more area identifiers for identifying the one or more areas.
  • a running process usually has one virtual address space. Therefore, “allocating one or more areas” usually means associating one or more virtual addresses of the virtual address space with one or more area identifiers, or assigning the one or more area identifiers to a process. Such as passing.
  • the area identifier is usually a physical address.
  • the memory management unit 14 may associate a process identifier for identifying the process.
  • the memory management unit 14 accumulates information indicating the associated result (hereinafter, appropriately, memory management information) in the NV memory 11.
  • the allocation of the area is hereinafter appropriately referred to as area allocation, memory allocation, block allocation, page allocation, or the like.
  • “releasing one or more areas” usually means releasing the association between the virtual address and the area identifier.
  • the memory management unit 14 normally deletes the memory management information indicating the association from the NV memory 11.
  • the memory management information is information for managing unused areas and used areas of the NV memory 11. Further, the memory management information usually has at least one or more virtual addresses and one or more physical addresses. In addition, the one or more virtual addresses and the one or more physical addresses are usually associated one-to-one. Further, the associated information may be associated with a process identifier for identifying the process. The process identifier is, for example, a process name or a process number. Further, the process identifier may be any format or content as long as it can identify the process. Further, the process management information may be information in which one or more virtual addresses and one or more physical addresses are associated with each other, or may be information having one or more associated information.
  • the one or more areas secured by the memory management unit 14 are usually one or more areas that the file system unit 13 can use as files.
  • “One or more areas that can be used as a file” means one or more areas in which a file may be written, one or more areas in which a file is written, and data that is written can be handled as a file One or more regions having a characteristic. In other words, the one or more areas may be one or more unused areas or one or more used areas.
  • the memory management unit 14 usually secures one or more areas via the file system unit 13. “Through the file system unit 13” means to secure one or more areas using the file management information stored in the file management information storage unit 131.
  • the memory management unit 14 manages an area allocated to a process, an unused area, a used area, and the like.
  • the “management” means, for example, accumulating information indicating the correspondence between virtual addresses and area identifiers in a predetermined storage area, or storing one or more area identifiers for identifying unused areas in advance. For example, accumulation in an area, accumulation of one or more area identifiers for identifying a use area in a predetermined storage area, and the like.
  • the predetermined storage area is usually an area that the NV memory 11 has.
  • memory management is a well-known technique, description is abbreviate
  • the memory management unit 14 normally performs securing of one or more areas, allocation of the secured one or more areas to a process, release of the allocated one or more areas, and the like by means described below. .
  • the area identifier storage means 141 stores one or more area identifiers. Since the area identifier has already been described, the description is omitted.
  • the area identifier is usually a physical address.
  • the unused area detection unit 142 detects an unused area from the NV memory 11 and acquires one or more area identifiers for identifying the unused area. “Detecting an unused area” means specifying an unused area. Also, the unused area detection unit 142 normally detects one or more unused areas that match the size requested by the process. The term “fits the size requested from the process” usually means that the requested size can be accommodated. That is, the size of the one or more unused areas is usually a size that is equal to or larger than the requested size, and is a size that has a minimum difference from the requested size. Also, the unused area detection unit 142 usually acquires the one or more area identifiers using file management information.
  • the file management information is file management information stored in the file management information storage unit 131.
  • the unused area detection unit 142 first acquires one or more area identifiers that identify one or more areas of the NV memory 11.
  • the one or more area identifiers are stored in advance in the NV memory 11, for example.
  • the unused area detection unit 142 acquires one or more area identifiers that the file management information does not have from among the acquired one or more area identifiers.
  • the physical addresses of the physical address space in which the NV memory 11 is arranged are “0xF0000001”, “0xF0000002”, “0xF00000003”, and “0xF0000004”.
  • the area identifiers included in the file management information are physical addresses “0xF0000001” and “0xF0000004”.
  • the size of each of the one or more areas included in the NV memory 11 is “4 KB”.
  • the size requested by the process is “3 KB”. In such a case, the number of areas to be secured is one. Accordingly, the unused area detection unit 142 detects two areas identified by physical addresses “0xF0000002” and “0xF0000004” as unused areas. Then, the unused area detection unit 142 acquires one of the two physical addresses.
  • one or more areas identified by the one or more area identifiers acquired by the unused area detection unit 142 are normally allocated to the process that requested the allocation of the areas.
  • the assignment is usually performed by an assignment unit 145 described later. Further, the allocation may be performed by the unused area detection unit 142.
  • the file management information appending means 143 appends the file management information to the file management information storage means 131.
  • “Add file management information” means that file management information is accumulated in the file management information storage unit 131 and a new record (file management information) is added to the file management information group stored in the file management information storage unit 131. Is to add.
  • the file management information stored in the file management information storage unit 131 is information in which one file identifier is associated with one or more area identifiers.
  • the one file identifier is usually one of one or more file identifiers stored in the file management information storage unit 131.
  • the one or more area identifiers are usually one or more area identifiers acquired by the unused area detection unit 142.
  • the file management information appending unit 143 appends the file management information by the following procedure, for example.
  • A-1 One or more area identifiers acquired by the unused area detection unit 142 are acquired.
  • A-2) One file identifier is acquired from one or more file identifiers included in the file management information.
  • A-3) One or more area identifiers acquired in (a-1) and one file identifier acquired in (a-2) are associated with each other to create file management information.
  • A-4) The file management information created in (a-3) is added to the file management information storage means 131.
  • the file management information appending unit 143 may append the file management information by the following procedure, for example.
  • B-1 One or more area identifiers acquired by the unused area detection unit 142 are acquired.
  • B-2) One or more area identifiers acquired in (b-1) are added to the file management information storage means 131.
  • B-3) One file identifier is acquired from one or more file identifiers included in the file management information.
  • B-4) One file identifier acquired in (b-3) is added to the file management information storage unit 131 in association with the one or more area identifiers added in (b-2).
  • “adding an area identifier” means that the area identifier is accumulated in the file management information storage unit 131 and stored in the file management information group stored in the file management information storage unit 131. The area identifier is added as a new record.
  • add a file identifier in association with an area identifier means that a file identifier is added to the file management information storage means 131 and the file identifier is added to the above (b-2). ) Included in the record added.
  • one file identifier acquired in the above (a-2) and (b-3) is usually acquired by a predetermined method.
  • the “predetermined method” is, for example, selecting at random or selecting in a predetermined order.
  • the predetermined order is, for example, ascending order or descending order of file identifiers, ascending order or descending order of date and time.
  • the file management information appending unit 143 may accumulate in the file management information storage unit 131 the file management information in which the one or more area identifiers are associated with the one file identifier. What is necessary is just the procedure and method.
  • the area identifier acquisition unit 144 acquires one or more area identifiers from the file management information storage unit 131.
  • the one or more area identifiers are area identifiers included in the file management information stored in the file management information storage unit 131. Then, the area identifier acquisition unit 144 accumulates the acquired one or more area identifiers in the area identifier storage unit 141.
  • the area identifier acquisition unit 144 usually acquires one or more area identifiers by one of two methods.
  • One of the two methods will be secured in advance as appropriate below.
  • the other of the two methods is hereinafter referred to as on-demand securing as appropriate.
  • the area identifier acquisition unit 144 usually acquires all area identifiers from the file management information storage unit 131 at a predetermined timing.
  • the predetermined timing is usually immediately after the information processing apparatus 1 is activated.
  • the predetermined timing is, for example, immediately after the information processing apparatus 1 is activated, immediately after a process is first requested to be executed, or immediately after execution of a process that is first requested to be executed. It may be.
  • the area identifier acquisition unit 144 normally acquires an area identifier in response to a request from a process being executed. At this time, the area identifier acquisition unit 144 usually first determines whether one or more area identifiers are stored in the area identifier storage unit 141. Then, when not stored, the region identifier acquisition unit 144 acquires a region identifier. At this time, the area identifier acquisition unit 144 acquires one or more area identifiers that match the size requested by the process.
  • one or more areas identified by the one or more area identifiers acquired by the area identifier acquisition unit 144 are normally assigned to the process that requested the area allocation.
  • the assignment is usually performed by an assignment unit 145 described later.
  • the allocation may be performed by the area identifier acquisition unit 144.
  • the allocation unit 145 allocates one or more areas to the process in response to a request from the running process. Further, the assigning unit 145 stores process management information indicating the assignment result in a predetermined storage area.
  • the predetermined storage area is usually an area of the NV memory 11.
  • the allocation unit 145 allocates one or more areas identified by the one or more area identifiers to the process that requested the allocation.
  • the allocation method is hereinafter referred to as a semi-direct fusion method as appropriate.
  • the semi-direct fusion method in addition to the allocation, one or more area identifiers acquired by the unused area detection unit 142 by the file management information appending unit 143 correspond to one or more file identifiers included in the file management information.
  • the attached file management information is added to the file management information storage means 131.
  • an allocation method for only accumulating the one or more area identifiers in the file management information storage unit 131 is hereinafter referred to as a direct fusion method as appropriate. That is, in the direct fusion method, one or more areas identified by the one or more area identifiers acquired by the unused area detection unit 142 are assigned to the process, and the one or more area identifiers are added to the file management information storage unit 131. To do.
  • the semi-direct fusion method in addition to the allocation and the additional writing, the file identifier is added to the file management information storage unit 131 in association with the one or more added area identifiers.
  • the allocation unit 145 acquires the one or more region identifiers acquired by the region identifier acquisition unit 144 and stored in the region identifier storage unit 141. Allocate the area identified by one of them to the process that requested the allocation.
  • the allocation method is hereinafter referred to as an indirect fusion method as appropriate.
  • the assigning unit 145 deletes from the region identifier storing unit 141 one or more region identifiers that identify one or more regions assigned to the process.
  • the allocation unit 145 matches the size requested by the process from the one or more area identifiers stored in the area identifier storage unit 141.
  • One or more region identifiers for identifying one or more regions are obtained.
  • the assigning unit 145 assigns one or more areas identified by the one or more area identifiers to the process that requested the assignment.
  • the allocation unit 145 is identified by one or more region identifiers stored in the region identifier storage unit 141. Allocate the above area to the process that requested the allocation.
  • the allocation unit 145 may instruct the file system unit 13 to write a file having the same size as that requested by the process to the NV memory 11 in response to a request from the process being executed. .
  • the “writing a file” means creating a file.
  • the assigning unit 145 receives one or more area identifiers for identifying the area in which the file is written from the file system unit 13. Then, the assigning unit 145 assigns one or more areas identified by the one or more area identifiers to the process that requested the assignment.
  • the allocation method will be appropriately referred to as mmap method below.
  • the memory management unit 14 may hold memory area management information, which is information for managing one or more areas, for example. Since the format and contents of the memory management information are the same as the file area management information, the description thereof is omitted. Further, the memory area management information may be stored in a memory area management information storage unit (not shown).
  • the assigning unit 145 stores the memory area management information by using one or more area identifiers for identifying the assigned one or more areas as area identifiers for identifying used areas. Accumulate in the means.
  • the assigning unit 145 may delete the area identifier, for example, or associate a flag indicating that the area is used with the area identifier. .
  • the assigning unit 145 uses the one or more area identifiers that identify one or more areas assigned to the process as the area identifier that identifies the unused area. Accumulate in management information storage means. Further, when the same area identifier is already stored, the assigning unit 145 may delete the identifier, for example, and store a flag indicating that the area is an unused area in association with the area identifier. May be.
  • the allocation unit 145 may determine the area using, for example, memory area management information.
  • the input means such as information and instructions in the reception unit 12 may be anything such as a menu screen or a keyboard.
  • the accepting unit 12 can be realized by control software for a menu screen, a device driver for input means such as a keyboard, and the like.
  • the file system unit 13, the memory management unit 14, the unused area detection unit 142, the file management information additional recording unit 143, the area identifier acquisition unit 144, and the allocation unit 145 can be usually realized by an MPU, a memory, or the like.
  • the processing procedure of the file system unit 13 and the like is usually realized by software, and the software is recorded on a recording medium such as a ROM.
  • the file system unit 13 and the like may be realized by hardware (dedicated circuit).
  • the file management information storage means 131 and the area identifier storage means 141 are usually realized by one or more areas of the NV memory 11.
  • the file management information storage unit 131 and the like may be realized by a non-volatile recording medium other than the NV memory 11 or a volatile recording medium, for example.
  • the process in which the predetermined information is stored in the file management information storage unit 131 or the like does not matter.
  • the predetermined information may be stored in the file management information storage unit 131 or the like via a recording medium, a communication line, an input device, or the like.
  • FIG. 2 is a flowchart showing the overall operation of the information processing apparatus 1.
  • the branch processing (judgment) block is replaced with a rhombus standardized by JIS (Japanese Industrial Standards), and a hexagon (preparation). Is used.
  • Step S201 The file system unit 13 places the NV memory 11 in the physical address space.
  • the arrangement may be performed by the memory management unit 14.
  • Step S202 The memory management unit 14 determines whether or not the method of allocating the area to the process is an indirect fusion method and prior reservation. For example, when information indicating the allocation method of the area is stored in a predetermined storage area, the memory management unit 14 determines the allocation method of the area based on the information. If the indirect fusion method and prior reservation are established, the process proceeds to step S203. If not, the process proceeds to step S205.
  • Step S203 The area identifier acquisition unit 144 acquires all the area identifiers stored in the file management information storage unit 131.
  • Step S204 The region identifier acquisition unit 144 stores the acquired one or more region identifiers in the region identifier storage unit 141.
  • Step S205 The file system unit 13 determines whether the receiving unit 12 has received a file writing instruction.
  • the file write instruction is an instruction for writing a file to the NV memory 11. Also, the file writing instruction usually has a file identifier and data constituting the file. And when it receives, it progresses to step S206, and when that is not right, it progresses to step S209.
  • Step S206 The file system unit 13 acquires one or more area identifiers in order to secure one or more areas for writing the file.
  • Step S207 The file system unit 13 writes the file in one or more areas identified by the one or more area identifiers acquired in Step S206.
  • Step S208 The file system unit 13 associates the one or more area identifiers acquired in Step S206 with the file identifier for identifying the file written in Step S207, and stores it in the file management information storage unit 131 as file management information. To do.
  • Step S209 The file system unit 13 determines whether the receiving unit 12 has received a file reading instruction.
  • the file read instruction is an instruction for reading a file from the NV memory 11. Further, the file read instruction usually has a file identifier. And when it receives, it progresses to step S210, and when that is not right, it progresses to step S212.
  • Step S210 The file system unit 13 acquires one or more area identifiers for identifying one or more areas in which a file to be read is written from the file management information storage unit 131.
  • Step S211 The file system unit 13 reads a file from one or more areas identified by the one or more area identifiers acquired in Step S210.
  • Step S212 The file system unit 13 determines whether the receiving unit 12 has received a file deletion instruction.
  • the file deletion instruction is an instruction for deleting a file from the NV memory 11. Further, the file deletion instruction usually has a file identifier. And when it receives, it progresses to step S213, and when that is not right, it progresses to step S216.
  • Step S213 The file system unit 13 acquires, from the file management information storage unit 131, one or more area identifiers that identify one or more areas in which a file to be deleted is written.
  • Step S214 The file system unit 13 deletes the file from one or more areas identified by the one or more area identifiers acquired in Step S213.
  • Step S215) The file system unit 13 deletes the file management information having one or more area identifiers acquired in step S213 from the file management information storage unit 131.
  • Step S216 The memory management unit 14 determines whether or not the reception unit 12 has received a process execution instruction.
  • the process execution instruction is an instruction for executing a process.
  • the process execution instruction usually has a process identifier. And when it receives, it progresses to step S217, and when that is not right, it returns to step S205.
  • Step S21-7 The information processing apparatus 1 executes a process.
  • Step S228 In response to a request from the process being executed, the memory management unit 14 allocates one or more areas to the process. Details of this processing will be described with reference to the flowchart of FIG.
  • Step S219 The memory management unit 14 determines whether or not the execution of the process is finished. If completed, the process proceeds to step S220; otherwise, the process returns to step S219.
  • Step S220 The memory management unit 14 releases one or more areas allocated to the process that has been executed. Details of this processing will be described with reference to the flowchart of FIG.
  • the process may be terminated by powering off or a process termination interrupt.
  • FIG. 3 is a flowchart showing the area allocation processing in step S218 of the flowchart of FIG.
  • Step S301 The memory management unit 14 determines whether or not the method of allocating the area to the process is a semi-direct fusion method. If the semi-direct fusion method is used, the process proceeds to step S302. If not, the process proceeds to step S305.
  • the unused area detection unit 142 uses the file management information stored in the file management information storage unit 131 to detect one or more unused areas that match the size requested by the process. One or more area identifiers for identifying each unused area are acquired.
  • Step S303 The file management information appending means 143 creates file management information by associating one or more area identifiers acquired in step S302 with one or more file identifiers included in the file management information.
  • Step S304 The file management information appending unit 143 appends the file management information created in Step S303 to the file management information storage unit 131.
  • Step S305 The memory management unit 14 determines whether or not the method of allocating the area to the process is an indirect fusion method and prior reservation. If the indirect fusion method and prior reservation are established, the process proceeds to step S306; otherwise, the process proceeds to step S307.
  • Step S306 The allocation unit 145 acquires one or more region identifiers that match the size requested by the process from the region identifier storage unit 141.
  • Step S307 The memory management unit 14 determines whether or not the method of allocating the area to the process is an indirect fusion method and on-demand reservation. If the indirect fusion method and on-demand reservation are ensured, the process proceeds to step S308; otherwise, the process proceeds to step S312.
  • Step S308 The region identifier acquisition unit 144 determines whether one or more region identifiers are stored in the region identifier storage unit 141. If stored, the process proceeds to step S311; otherwise, the process proceeds to step S309.
  • Step S309 The area identifier acquisition unit 144 acquires one or more area identifiers that match the size requested by the process from the file management information storage unit 131.
  • Step S310 The region identifier acquisition unit 144 stores the one or more region identifiers acquired in Step S309 in the region identifier storage unit 141.
  • Step S311 The allocation unit 145 acquires one or more region identifiers that match the size requested by the process from the region identifier storage unit 141. At this time, the assigning unit 145 deletes the acquired one or more region identifiers from the region identifier storage unit 141.
  • the deletion may be, for example, giving a flag indicating deletion.
  • Step S312 The memory management unit 14 determines whether or not the area allocation method for the process is the mmap method. If the mmap method is used, the process proceeds to step S313; otherwise, the process proceeds to step S315.
  • Step S313 The allocation unit 145 transmits a file write instruction for writing a file having the same size as the size requested by the process to the file system unit 13.
  • the allocating unit 145 receives one or more area identifiers for identifying the area in which the file is written from the file system unit 13.
  • Step S315) The allocation unit 145 receives one or more region identifiers acquired in Step S302, one or more region identifiers acquired in Step S306, one or more region identifiers acquired in Step S311, or received in Step S314.
  • One or more region identifiers are allocated to the process that requested the region allocation.
  • the allocation unit 145 normally stores memory management information indicating the allocation result in a memory management information storage unit (not shown). Then, the process returns to the upper process.
  • FIG. 4 is a flowchart showing the area release processing in step S220 of the flowchart of FIG.
  • Step S401 The allocating unit 145 determines whether or not the method of allocating the area to the process is a semi-direct fusion method. If the semi-direct fusion method is used, the process proceeds to step S402. If not, the process proceeds to step S404.
  • Step S402 The allocating unit 145 deletes the file management information having one or more area identifiers for identifying each of the one or more areas allocated to the process from the file management information storage unit 131.
  • Step S403 The allocation unit 145 deletes the memory management information having one or more area identifiers for identifying each of the one or more areas allocated to the process from the memory management information storage unit (not shown).
  • Step S404 The assigning means 145 determines whether or not the method of assigning the area to the process is the indirect fusion method. When it is an indirect fusion method, it progresses to step S405, and when that is not right, it progresses to step S408.
  • Step S405 The allocation unit 145 acquires one or more area identifiers for identifying one or more areas allocated to the process from a memory management information storage unit (not shown).
  • Step S406 The assigning unit 145 accumulates the one or more region identifiers acquired in Step S405 in the region identifier storage unit 141.
  • the deletion may be, for example, deleting a flag indicating deletion.
  • Step S407 The allocation unit 145 deletes the memory management information having one or more area identifiers acquired in Step S405 from the memory management information storage unit (not shown).
  • Step S408 The allocation unit 145 determines whether or not the method of allocating the area to the process is the mmap method. If the mmap method is used, the process proceeds to step S409, and if not, the process returns to the upper process.
  • the allocation unit 145 acquires one or more area identifiers for identifying one or more areas allocated to the process from a memory management information storage unit (not shown).
  • Step S410 The allocation unit 145 transmits a file deletion instruction for deleting a file written in one or more areas identified by the one or more area identifiers acquired in Step S409 to the file system unit 13. To do.
  • Step S411 The allocation unit 145 deletes the memory management information having one or more area identifiers acquired in Step S409 from the memory management information storage unit (not shown). Then, the process returns to the upper process.
  • the NV memory 11 is arranged in one physical address space.
  • the NV memory 11 is assumed to have one or more areas having a size of 4 KB.
  • Example 1 In this example, an example of area allocation by the semi-direct fusion method will be described.
  • the file management information storage unit 131 stores one or more file management information shown in FIG.
  • the file management information includes an ID for uniquely identifying a record, a file identifier (item name: file), and a physical address.
  • the physical address is an area identifier.
  • a file identified by the file identifier “file01” is written in three areas identified by the physical addresses “0x00000001”, “0x00000002”, and “0x00000003”. Indicates that
  • the reception unit 12 receives a process execution instruction for executing the program as a process.
  • the process execution instruction has a process identifier “proc01”.
  • the information processing apparatus 1 executes the program identified by the process identifier as a process.
  • the accepting unit 12 accepts an area assignment instruction that is an instruction for assigning an area.
  • the area allocation instruction has a process identifier “proc01” and an allocated area size “10 KB”.
  • the unused area detection unit 142 detects one or more unused areas that match the size “10 KB” using the file management information in FIG. 5, and one or more physical areas that identify the one or more areas. Get the address. Since the size of each area included in the NV memory 11 is “4 KB”, the unused area detection unit 142 acquires three physical addresses. Here, in FIG. 5, an area identified by a physical address other than the physical address described in the figure is an unused area. As a result, it is assumed that the unused area detection unit 142 has acquired physical addresses of “0x00000004”, “0x00000005”, and “0x00000006”.
  • the assigning unit 145 assigns the three areas identified by the three physical addresses acquired by the unused area detecting unit 142 to the process identified by the process identifier “proc01”. Then, the allocation unit 145 stores memory management information indicating the allocation result in a memory management information storage unit (not shown).
  • the stored memory management information is shown in FIG.
  • the memory management information includes an ID for uniquely identifying a record, a process identifier (item name: process), a virtual address, and a physical address.
  • the memory management information includes virtual addresses “0xF0000001”, “0xF0000002”, and “0xF00000003” included in the virtual address space of the process identified by the process identifier “proc01”, and physical addresses “0x00000004” and “0x00000005”. , “0x00000006” correspond to each other.
  • Example 2 In this example, an example of area allocation by the indirect fusion method will be described. In this example, it is assumed that the file management information storage unit 131 stores the file management information shown in FIG.
  • Example 2 First, an example of advance reservation will be described. Similarly to Example 1, it is assumed that the user operates the information processing apparatus 1 and performs an operation for executing an arbitrary program. Here, since the instruction received by the receiving unit 12 is the same as that in Example 1, the description thereof is omitted.
  • the area identifier acquisition unit 144 acquires all physical addresses (seven) included in the file management information of FIG. Then, the area identifier acquisition unit 144 accumulates the acquired seven physical addresses in the area identifier storage unit 141.
  • the assigning unit 145 acquires three physical addresses that match the size “10 KB” required by the process identified by the process identifier “proc01” from the area identifier storage unit 141. As a result, it is assumed that the assigning unit 145 has acquired three physical addresses of “0x00000011”, “0x00000012”, and “0x00000013”. Further, the assigning unit 145 deletes the three physical addresses from the area identifier storage unit 141. The deletion may be, for example, giving a flag indicating deletion.
  • the assigning unit 145 assigns the three areas identified by the acquired three physical addresses to the process identified by the process identifier “proc01”. Then, the allocation unit 145 stores memory management information indicating the allocation result in a memory management information storage unit (not shown).
  • the stored memory management information is shown in FIG. The information included in the memory management information and the meaning indicated by the memory management information are the same as those in FIG.
  • the allocation unit 145 acquires physical addresses “0x00000011”, “0x00000012”, and “0x00000013” corresponding to the process identifier “proc01” from the memory management information of FIG. Then, the assigning unit 145 deletes the memory management information of FIG. 8 from the memory management information storage unit.
  • the assigning unit 145 accumulates the acquired three physical addresses in the area identifier storage unit 141.
  • the accumulation may be, for example, deleting a flag indicating deletion.
  • the area identifier acquisition unit 144 determines whether one or more area identifiers are stored in the area identifier storage unit 141. As a result, it is assumed that the area identifier acquisition unit 144 determines that one or more area identifiers are not stored.
  • the area identifier acquisition unit 144 acquires three physical addresses that match the size “10 KB” required by the process identified by the process identifier “proc01” from the file management information in FIG. As a result, it is assumed that the area identifier acquisition unit 144 has acquired three physical addresses “0x00000011”, “0x00000012”, and “0x00000013”. Then, the area identifier acquisition unit 144 stores the three physical addresses in the area identifier storage unit 141.
  • the allocation unit 145 obtains three physical addresses “0x00000011”, “0x00000012”, and “0x00000013” stored in the area identifier storage unit 141. Further, the assigning unit 145 deletes the three physical addresses from the area identifier storage unit 141.
  • the assigning unit 145 assigns the three areas identified by the acquired three physical addresses to the process identified by the process identifier “proc01”. Then, the allocation unit 145 stores memory management information indicating the allocation result in a memory management information storage unit (not shown). The stored memory management information is shown in FIG.
  • Example 3 In this example, an example of area allocation by the mmap method will be described. In this example, it is assumed that the file management information storage unit 131 stores the file management information shown in FIG.
  • Example 2 similarly to Example 1, it is assumed that a process identified by the process identifier “proc01” is being executed, and that the process requests allocation of an area of size “10 KB”.
  • the allocating unit 145 transmits a file write instruction for writing a file of size “10 KB” to the NV memory 11 to the file system unit 13. It is assumed that the file write instruction has a file size “10 KB”.
  • the accepting unit 12 accepts the above file writing instruction.
  • the file system unit 13 acquires an arbitrary file identifier according to the file write instruction.
  • the file system unit 13 uses the file management information in FIG. 5 to acquire physical addresses for identifying three unused areas that match the file size “10 KB”. As a result, it is assumed that the file system unit 13 has acquired the file identifier “file99”. Further, it is assumed that the file system unit 13 has acquired physical addresses of “0x00000004”, “0x00000005”, and “0x00000006”.
  • the file system unit 13 writes the file in the three areas identified by the acquired three physical addresses. Then, the file system unit 13 accumulates the file management information indicating the result of the writing in the file management information storage unit 131 and adds the file management information to the file management information group in FIG. The file management information after the additional writing is shown in FIG. The information included in the file management information and the meaning indicated by the file management information are the same as those in FIG.
  • the file system unit 13 transmits three physical addresses for identifying the area where the file is written to the memory management unit 14.
  • the assigning means 145 receives three physical addresses “0x00000004”, “0x00000005”, and “0x00000006”. Then, the assigning unit 145 assigns the three areas identified by the three physical addresses to the process identified by the process identifier “proc01”. Then, the allocation unit 145 stores memory management information indicating the allocation result in a memory management information storage unit (not shown). The stored memory management information is shown in FIG.
  • Example 4 In this example, an example of a specific method for realizing the information processing apparatus 1 will be described.
  • the NV memory 11 is simply expressed as “NV memory”.
  • the information processing apparatus 1 is assumed to be a Linux (registered trademark) kernel (hereinafter referred to as a kernel).
  • FIG. 10 shows the configuration example.
  • FIG. 10 is a conceptual diagram showing a system in which an NV memory and a file system are merged.
  • the information processing apparatus 1 The area of the NV memory is managed by the file system.
  • a file is stored in the file system on the NV memory, a block for storing file data is allocated as usual.
  • Program text and data stored in the file can be directly referred to as main memory by XIP.
  • an empty block is acquired from the file system.
  • the process of FIG. 10 maps the text of the file by XIP, and maps the area necessary for the heap by acquiring an empty block.
  • the free memory area and the empty block are both unused areas.
  • the implementation of the semi-direct fusion method requires a function for adding and deleting a reference to a block secured from the file system to a file created in advance.
  • a direct fusion method is used.
  • the file to which the reference to the block is added and deleted is designated from the user program.
  • the function for that is implemented as a character type device driver.
  • the device driver's ioctl interface is used to receive the identifier of the file to add and delete references to the block.
  • FIG. 11 shows a prototype declaration of a function that implements the ioctl interface.
  • the function shown in FIG. 11 receives a file descriptor as a file identifier.
  • the value is received by the third argument “arg”.
  • the function also acquires a file structure from the file descriptor using “fget ()”. Since the file structure represents the entity of the file, the inode number, the function for operating the file, and the like can be traced from there.
  • the inode is a data structure of a file system and is well known, and thus detailed description is omitted.
  • the second argument “cmd” designates whether to use a semi-direct fusion method or an indirect fusion method (prior reservation or on-demand reservation).
  • the offset in the file system of the secured block is set as the offset in the file to which the reference is added, and the block is added to the file.
  • the implementation for adding and deleting references depends on the internal structure of the file system, and is necessary for each file system to be used (for example, Ext2 or PRAMFS).
  • the internal structure of PRAMFS is simple. Therefore, when implemented in PRAMFS, a function that directly manipulates the inode of the file is implemented.
  • the internal structure of Ext2 is somewhat complicated. Therefore, when mounting on Ext2, the existing code is called as much as possible to add and delete. For this reason, the mounting in Ext2 is a redundant mounting that involves securing and releasing extra blocks.
  • the implementation of the indirect fusion method requires a function for acquiring the address of a block allocated to a file for both advance and on-demand reservation, and a function for managing an unused free block for memory allocation.
  • the identifier of the file used for memory allocation is received by the device driver implemented in the semi-direct fusion method.
  • the interface for memory allocation and release requests from the process through the memory allocator is the same as in the direct fusion method.
  • a so-called free list is used for managing free blocks.
  • “get_xip_mem ()” that is an interface provided by a file system that supports XIP is used.
  • the virtual address and physical page number in the kernel of the block corresponding to “offset” in the file are received in “kmem” and “pfn”, respectively. be able to.
  • the third argument specifies whether to secure a block. As shown in FIG. 12, when “1” is designated, a block is secured, and when “0” is designated, a block is not secured.
  • “offset” in FIG. 12 is changed from the beginning of the file to a value corresponding to the last block at the time of initialization. As a result, all blocks are reserved, and their virtual address and physical page number can be acquired. Then, a free list is created using the secured block addresses. In the case of on-demand reservation, blocks are allocated from the beginning of the file, but a new block is reserved when the free list is empty. In both pre-allocation and on-demand allocation, when the memory is released, the block is returned to the free list and is not released to the file system.
  • the indirect fusion method can be implemented using the file system interface, it is not necessary to change to the file system, and implementation for each file system is also unnecessary.
  • the mmap method is a method that uses a mmap system call (hereinafter referred to as “mmap” as appropriate) to secure a block from a file system and use it for allocating memory to a process. Therefore, a new implementation in the kernel is not necessary to realize the mmap method.
  • mmap system call
  • the mmap system call is used when memory allocation is performed by a program.
  • malloc () is used for memory allocation.
  • Example 5 An experimental result of operating the information processing apparatus 1 realized by the realizing method shown in Example 4 will be described.
  • the direct fusion method, semi-direct fusion method, indirect fusion method (on-demand reservation), and mmap method are 2.3% and 2.5% respectively in PRAMFS. 1.2%, 27.9%, the cost is large. On the other hand, Ext2 has a large cost of 5.2%, 111.5%, 3.2%, and 73.6%, respectively.
  • the indirect fusion method on-demand reservation
  • block allocation to a file occurs whenever a larger memory allocation occurs. However, since the block once allocated is managed and reused in the free list after being released, the influence on the allocation cost is small.
  • the semi-direct fusion method has a small impact on cost in PRAMFS, while the cost of Ext2 is large.
  • the file system used for the comparison is Ext2 for which a file system repair tool is provided. Then, a comparison is made with respect to the case where memory allocation is performed by the five methods of the direct fusion method, the semi-direct fusion method, the indirect fusion method (preliminary reservation and ondemand reservation), and the mmap method. The comparison is based on the number of file system inconsistency reports detected by the file system repair tool (e2fsck) after restarting the OS when a program for securing memory is executed and the program is forcibly terminated with a 512 MB area secured. Do.
  • e2fsck file system repair tool
  • the application of the file system repair tool to the file system on the NV memory will be after restarting after abnormal termination.
  • the contents of the NV memory area need to be saved at the time of restart, and therefore, an actual machine in which the memory is initialized at the time of restart cannot be used. Therefore, a QEMU (http://wiki.qemu.org/Main_Page) with an NV main memory emulation function added is used as an evaluation environment.
  • the command shown in FIG. 15 is executed, the 128 MB DRAM area is secured, and the file “nvmemory.img” is mapped to the area from the physical address “0x10000000” as the NV memory. to start.
  • the inconsistency in the number of free blocks is different between the entire file system and a plurality of block groups, which is considered to be an inconsistency caused directly by the direct fusion method.
  • the inconsistency in the number of free blocks is a relatively minor inconsistency, but if left unattended, the file system will be in a memory leak state and needs to be repaired.
  • the five methods of the semi-direct fusion method, the indirect fusion method (preliminary reservation and on-demand reservation), and the mmap method are used for allocation to the main memory, and all blocks secured from the file system are referred to from the file.
  • the experiments performed did not cause inconsistencies. However, this does not guarantee that it will not cause inconsistencies in any case.
  • Abnormal termination during operations on the file system can cause inconsistencies. However, such inconsistency can also occur in normal file operations and does not occur due to memory allocation by the above five methods.
  • the influence of the block securing cost from the file system is large.
  • the mmap method secures one block at a time, it is greatly influenced by the free area management method of the file system. Therefore, the PRAMFS having a simple internal structure is targeted, and the free space management method in the file system is made a structure suitable for the operation on the memory, thereby reducing the block securing cost and verifying its influence.
  • the operation required to secure one block from the file system is basically to extract one element from the free list in the direct fusion method and the indirect fusion method.
  • blocks are secured through a free area management method of the file system. Since PRAMFS employs a bitmap for managing the free space, a bitmap search cost is required. In HDDs that require a long time to seek, it causes fragmentation inside the file, and therefore, the method of managing free blocks in a list is not usually used.
  • a bitmap is used in many file systems because it can easily find another empty block close to a certain block and suppress internal fragments.
  • the number of instructions executed in QEMU and the number of instructions executed in Atom are not completely the same due to the influence of interrupts, but are close to each other.
  • the reduction in the memory allocation cost of the mmap method is 37.5% due to the reduction in the free space management method, and is not as large as the execution time. It is the number of cache misses that may have caused the difference in execution time. In FIG. 18, a large difference is seen in both “LLC Misses” and “MEM LOAD RETIRED.L2 MISS”.
  • the L2 cache of “Atom D2700” is 512 KB per core, which is smaller than the current notebook PC processor.
  • the information processing apparatus 1 when the NV memory is used as the main memory and the storage, it is possible to reduce inconsistencies in the file system at the time of abnormal termination of the system.
  • the above-described file management information, file area management information, memory management information, and memory area management information may be expressed by one piece of information, for example.
  • This information is area management information.
  • the area management information includes, for example, all physical addresses included in the physical address space where the NV memory 11 is arranged.
  • Each of the one or more physical addresses includes, for example, a file identifier, a logical address, a process identifier, a virtual address, and a flag indicating whether the area identified by the physical address is an unused area or a used area. With correspondence.
  • the file management information may be, for example, information having one file identifier, one area identifier, and information indicating the number of areas (hereinafter, area number information as appropriate). Good. In this case, these three pieces of information are usually associated with each other.
  • the one area identifier usually identifies the first area in which the file identified by the one file identifier is written.
  • the number-of-areas information usually indicates the number of areas written continuously from the head area.
  • the file management information means that a file is written in three areas identified by the area identifiers “0x00000011”, “0x00000012”, and “0x00000013”.
  • the file management information may be information having one or more pieces of information including one file identifier, one region identifier, and number-of-regions information.
  • the memory management unit 14 may include a file identifier acquisition unit that acquires one or more file identifiers included in the file management information.
  • the file identifier acquisition unit normally acquires one or more file identifiers included in the file management information by a predetermined method.
  • the file management information appending unit 143 normally associates one or more area identifiers acquired by the unused area detection unit 142 with one file identifier acquired by the file identifier acquisition unit, and file management information Create
  • each process or each function may be realized by centralized processing by a single device or a single system, or distributed by a plurality of devices or a plurality of systems. It may be realized by being processed.
  • each component may be configured by dedicated hardware, or a component that can be realized by software may be realized by executing a program.
  • each component can be realized by a program execution unit such as a CPU reading and executing a software program recorded on a recording medium such as a hard disk or a semiconductor memory.
  • the software that realizes the information processing apparatus in each of the above embodiments is, for example, the following program.
  • this program responds to requests from a computer that can access an NV memory, which is a non-volatile recording medium, from a file system unit that manages one or more files stored in the NV memory and a process that is being executed.
  • the file system unit secures an area of the NV memory that can be used as a file, and functions as a memory management unit that allocates the secured area to the process.
  • the functions realized by the program do not include functions that can only be realized by hardware.
  • the program may be executed by being downloaded from a server or the like, or a program recorded on a predetermined recording medium (for example, an optical disk such as a CD-ROM, a magnetic disk, a semiconductor memory, etc.) is read out. May be executed. Further, this program may be used as a program constituting a program product.
  • a predetermined recording medium for example, an optical disk such as a CD-ROM, a magnetic disk, a semiconductor memory, etc.
  • the computer that executes the program may be singular or plural. That is, centralized processing may be performed, or distributed processing may be performed.
  • FIG. 19 is an overview of the computer system 9 that executes the above-described program to realize the information processing apparatus and the like of the above-described embodiment.
  • the above-described embodiments can be realized by computer hardware and a computer program executed thereon.
  • the computer system 9 includes a computer 901 including a CD-ROM drive 9011 and an FD drive 9012, a keyboard 902, a mouse 903, and a monitor 904.
  • FIG. 20 is a block diagram of the computer system 9.
  • a computer 901 is connected to an MPU 9013, a ROM 9014 for storing a program such as a boot-up program, and an MPU 9013 in addition to a CD-ROM drive 9011 and an FD drive 9012, and temporarily commands the application program.
  • the computer 901 may further include a network card that provides connection to a LAN.
  • a program that causes the computer system 9 to execute the functions of the information processing apparatus and the like of the above-described embodiment is stored in the CD-ROM 9101 or FD 9102, inserted into the CD-ROM drive 9011 or FD drive 9012, and further the hard disk 9016. May be forwarded to.
  • the program may be transmitted to the computer 901 via a network (not shown) and stored in the hard disk 9016.
  • the program is loaded into the RAM 9015 when executed.
  • the program may be loaded directly from the CD-ROM 9101, the FD 9102, or the network.
  • the program does not necessarily include an operating system (OS) or a third-party program that causes the computer 901 to execute the functions of the information processing apparatus according to the above-described embodiment.
  • the program only needs to include an instruction portion that calls an appropriate function (module) in a controlled manner and obtains a desired result. How the computer system 9 operates is well known and will not be described in detail.
  • the information processing apparatus has an effect of reducing inconsistencies in the file system at the time of abnormal termination of the system when the NV memory is used as the main memory and the storage. This is useful as a function of the system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System (AREA)

Abstract

 不揮発性の記録媒体であるNVメモリと、NVメモリに保存されている1以上のファイルを管理するファイルシステム部と、実行中のプロセスからの要求に応じて、ファイルシステム部がファイルとして使用し得るNVメモリの領域を確保し、確保した領域をプロセスに割り当てるメモリ管理部とを備える情報処理装置により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。

Description

情報処理装置、情報処理方法、およびプログラム
 本発明は、不揮発性メモリを使用する情報処理装置等に関するものである。
 従来、SSD(非特許文献1参照)や、EEPROM(非特許文献2参照)などの不揮発性メモリ(Non-Volatile Memory、以下、適宜、NVメモリ)が開発されている。
"SSDとは"、[online]、IT用語辞典 e-Words、[2013年1月23日検索]、インターネット[URL;http://e-words.jp/w/SSD.html] "EEPROMとは"、[online]、IT用語辞典 e-Words、[2013年1月23日検索]、インターネット[URL;http://e-words.jp/w/EEPROM.html]
 近年、NVメモリをメインメモリとして用いる研究、およびメインメモリをストレージとして用いる研究等により、NVメモリをメインメモリとして使用する領域とストレージとして使用する領域とを区別することなく、NVメモリをメインメモリおよびストレージとして使用することが可能となっている。NVメモリを、メインメモリおよびストレージの両方として使用することができるということは、その両方を1つに融合できることを意味する。また、当該融合により、システムの処理性能向上につながるという利点がある。しかしながら、その一方で、ファイルシステムのブロックを直接メインメモリの一部とすることには、実装面、管理面での欠点もある。これは、つまり、従来のNVメモリをメインメモリおよびストレージとして用いる方法では、システムの異常終了時においてファイルシステムの不整合を起こす可能性があった。
 本発明の第一の実施態様にかかる情報処理装置は、不揮発性の記録媒体であるNVメモリと、NVメモリに保存されている1以上のファイルを管理するファイルシステム部と、実行中のプロセスからの要求に応じて、ファイルシステム部がファイルとして使用し得るNVメモリの領域を確保し、確保した領域をプロセスに割り当てるメモリ管理部とを備える情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 また、本発明の第二の実施態様にかかる情報処理装置は、第一の実施態様にかかる情報処理装置であって、ファイルシステム部は、1以上のファイルを管理するための情報であり、ファイルを識別するファイル識別子と、ファイルに対応する1以上のNVメモリの領域を識別する領域識別子とが対応付いた情報である1以上のファイル管理情報が格納されるファイル管理情報格納手段を備え、メモリ管理部は、実行中のプロセスからの要求に応じて、プロセスに割り当てるNVメモリの領域を確保するために、ファイル管理情報を用いて、使用されていないNVメモリの領域である未使用領域を検出し、未使用領域を識別する1以上の領域識別子を取得する未使用領域検出手段と、未使用領域検出手段が取得した1以上の領域識別子と、ファイル管理情報が有する1以上のファイル識別子のいずれかとが対応付いたファイル管理情報を、ファイル管理情報格納手段に追記するファイル管理情報追記手段とを備える情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 また、本発明の第三の実施態様にかかる情報処理装置は、第一の実施態様にかかる情報処理装置であって、ファイルシステム部は、1以上のファイルを管理するための情報であり、ファイルを識別するファイル識別子と、ファイルに対応する1以上のNVメモリの領域を識別する領域識別子とが対応付いた情報であるファイル管理情報が格納されるファイル管理情報格納手段を備え、メモリ管理部は、1以上の領域識別子が格納される領域識別子格納手段と、ファイル管理情報格納手段から、1以上の領域識別子を取得し、取得した領域識別子を領域識別子格納手段に蓄積する領域識別子取得手段と、実行中のプロセスからの要求に応じて、領域識別子格納手段に格納されている1以上の領域識別子のうちのいずれかにより識別されるNVメモリの領域をプロセスに対して割り当てる割当手段とを備える情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 また、本発明の第四の実施態様にかかる情報処理装置は、第三の実施態様にかかる情報処理装置であって、領域識別子取得手段は、所定のタイミングで、ファイル管理情報格納手段から、すべての領域識別子を取得し、取得した領域識別子を領域識別子格納手段に蓄積する情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 また、本発明の第五の実施態様にかかる情報処理装置は、第三の実施態様にかかる情報処理装置であって、領域識別子取得手段は、実行中のプロセスからの要求に応じて、領域識別子格納手段に1以上の領域識別子が格納されているか否かを判断し、格納されていない場合に、ファイル管理情報格納手段から、1以上の領域識別子を取得し、取得した領域識別子を領域識別子格納手段に蓄積する情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 また、本発明の第六の実施態様にかかる情報処理装置は、第一の実施態様にかかる情報処理装置であって、ファイルシステム部は、実行中のプロセスからの要求に応じて、プロセスが要求したサイズと同サイズのファイルを、NVメモリの領域に書き込み、メモリ管理部は、実行中のプロセスからの要求に応じて、ファイルシステム部がファイルを書き込んだNVメモリの領域を、プロセスに割り当てる情報処理装置である。
 このような構成により、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 本発明によれば、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
実施の形態1における情報処理装置1のブロック図 実施の形態1における情報処理装置1の全体動作について説明するフローチャート 実施の形態1における領域の割当処理について説明するフローチャート 実施の形態1における領域の解放処理について説明するフローチャート 実施の形態1におけるファイル管理情報の例を示す図 実施の形態1におけるファイル管理情報の例を示す図 実施の形態1におけるメモリ管理情報の例を示す図 実施の形態1におけるメモリ管理情報の例を示す図 実施の形態1におけるファイル管理情報の例を示す図 実施の形態1におけるシステムの構成例を示す図 実施の形態1における関数のプロトタイプ宣言の例を示す図 実施の形態1における関数の呼び出しの例を示す図 実施の形態1における閾値の変更例を示す図 実施の形態1におけるメモリ割当コストの比較の実験結果を示す図 実施の形態1におけるQEMUの起動コマンドの例を示す図 実施の形態1における不整合報告の結果を示す図 実施の形態1におけるファイルシステムの整合性への影響の実験結果を示す図 実施の形態1における実行命令数、キャッシュミス回数の計測結果を示す図 実施の形態1におけるコンピュータシステムの概観図 実施の形態1におけるコンピュータシステムのブロック図
 以下、本発明による情報処理装置等の実施形態について図面を参照して説明する。なお、実施の形態において同じ符号を付した構成要素は同様の動作を行うので、再度の説明を省略する場合がある。また、本実施の形態において説明する各情報の形式、内容などは、あくまで例示であり、各情報の持つ意味を示すことができれば、形式、内容などは問わない。
 (実施の形態1)
 本実施の形態において、メインメモリとして使用する領域とストレージとして使用する領域とを区別することなく、NVメモリをメインメモリおよびストレージとして使用する情報処理装置1であって、メインメモリとして使用する領域をファイルシステムにて管理する情報処理装置1について説明する。なお、ここで、ストレージとは、いわゆる2次記憶装置や、補助記憶装置と呼ばれる記憶装置のことである。また、メインメモリとは、いわゆる1次記憶装置や、主記憶装置と呼ばれる記憶装置のことである。また、「メインメモリとして使用する領域」は、「実行中のプロセスが使用する領域」と言い換えてもよい。
 図1は、本実施の形態における情報処理装置1のブロック図である。情報処理装置1は、NVメモリ11、受付部12、ファイルシステム部13、メモリ管理部14を備える。また、ファイルシステム部13は、ファイル管理情報格納手段131を備える。また、メモリ管理部14は、領域識別子格納手段141、未使用領域検出手段142、ファイル管理情報追記手段143、領域識別子取得手段144、割当手段145を備える。
 また、本実施の形態における情報処理装置1が備えるファイルシステム部13、およびメモリ管理部14は、例えば、いわゆるOSや、当該OSのカーネルと呼ばれるものなどである。
 NVメモリ11は、不揮発性の記録媒体である。NVメモリ11は、例えば、PCM(Pahse Change Memory、相変化メモリ)や、MRAM、ReMAM、EEPROM、フラッシュメモリなどである。また、NVメモリ11は、通常、不揮発性メモリであれば、その形状や種類などは、問わない。また、NVメモリ11は、例えば、バイト単位アクセスが可能な不揮発性メモリであることが好適である。
 また、NVメモリ11は、通常、1以上の領域を有する。当該領域には、通常、プロセスが使用するデータが格納される。当該プロセスは、例えば、ジョブや、タスク、スレッドなどと呼ばれる場合もある。また、当該データは、例えば、ファイルや、ファイルの一部、変数に代入された値などである。また、領域のサイズ(容量)は、通常、予め決められている。当該サイズは、例えば、4KB(キロバイト)や、512B(バイト)などである。また、当該一の領域は、例えば、後述のファイルシステム部13からは、「ブロック」として使用される。また、当該一の領域は、例えば、後述のメモリ管理部14からは、「ページ」として使用される。つまり、当該一の領域は、通常、2以上の名称で呼ばれる。また、本実施の形態において、当該ブロックのサイズと、当該ページのサイズとは、同一である。また、当該サイズは、4KBであることが好適である。
 なお、NVメモリ11が有する1以上の各領域を、以下、適宜、「NVメモリ11の領域」、または「領域」とする。また、データが書き込まれていない領域や、データの書き込みが許可されている領域などを、以下、適宜、未使用領域とする。また、データが書き込まれている領域や、データの書き込みが許可されていない領域などを、以下、適宜、使用領域とする。
 また、NVメモリ11は、通常、一の物理アドレス空間に配置される。当該物理アドレス空間は、通常、連続した1以上の物理アドレスを有する。また、「物理アドレス空間に配置される」とは、NVメモリ11が有する1以上の各領域と、一の物理アドレスとが対応付けられることである。つまり、当該一の領域は、一の物理アドレスにより識別される。また、当該一の領域は、例えば、論理アドレスや仮想アドレスなどにより間接的に識別されてもよい。
 また、NVメモリ11が有する1以上の各領域は、領域識別子により識別される。領域識別子とは、当該1以上の各領域を識別する情報である。領域識別子は、例えば、物理アドレスや、論理アドレス、仮想アドレスなどである。つまり、領域識別子は、当該1以上の各領域を、直接的または間接的に識別する情報であればよい。
 また、上記、NVメモリ11の物理アドレス空間への配置は、通常、後述のファイルシステム部13が行う。また、当該配置は、例えば、後述のメモリ管理部14が行ってもよい。また、当該配置は、例えば、図示しないアドレス空間配置部が行ってもよい。
 受付部12は、指示や情報などを受け付ける。指示は、例えば、プログラムの実行の指示や、プロセスの実行の指示、プロセスへの領域の割当の指示、ファイル操作の指示などである。また、情報は、例えば、いわゆるコマンドや、当該コマンドに与える引数などである。また、これらの指示や情報は、通常、指示や情報を出力するプログラムが出力する。
 ファイルシステム部13は、いわゆるファイルシステムである。当該ファイルシステムは、通常、ディスクファイルシステム(ローカルファイルシステム)である。また、当該ファイルシステムは、例えば、PRAMFS(Persistent and Protected RAM File System)や、Ext2(Second Extended Filesystem)、SCMFS(A File System for Storage Class Memory)などである。また、当該ファイルシステムは、XIP(eXecute-In-Place)をサポートしており、NVメモリ11を対象としたファイルシステムであれば、何でもよい。つまり、ファイルシステム部13は、NVメモリ11を、いわゆるストレージとして使用する。また、ファイルシステム部13は、通常、NVメモリ11を1以上の領域に分割し、当該一の領域を、ブロックとして使用する。
 また、ファイルシステム部13は、ファイルシステムであるので、NVメモリ11に保存されている1以上のファイルを管理する。「ファイルを管理する」とは、例えば、書き込みを要求されたファイルをNVメモリ11に書き込むこと、読み出しを要求されたファイルをNVメモリ11から読み出すこと、削除を要求されたファイルをNVメモリ11から削除すること、当該書き込みに応じて、当該書き込んだファイルを管理するための情報(以下、適宜、ファイル管理情報)をファイル管理情報格納手段131に蓄積すること、当該削除に応じて、当該削除したファイルに対応するファイル管理情報をファイル管理情報格納手段131から削除すること、ファイルが書き込まれていない領域を識別する領域識別子をファイル管理情報格納手段131に蓄積すること、ファイルが書き込まれている領域の識別子を要求に応じてファイル管理情報格納手段131から取得することなどである。また、ファイルを削除することとは、例えば、NVメモリ11からはファイルを削除せず、当該ファイルに対応するファイル管理情報を削除することや、当該ファイル管理情報にファイルが削除されたことを示すフラグを付与することなどであってもよい。
 なお、ファイルシステム部13は、ファイルシステムであり、OSの機能である。従って、「ファイルを管理する」とは、ファイルシステムが行う処理や、ファイルシステムの機能のすべてを含むと考えてよい。また、ファイルシステムには、いわゆる仮想ファイルシステムを含むと考えてもよい。
 ここで、ファイル管理情報とは、ファイルを管理するための情報である。ファイル管理情報は、通常、少なくとも、ファイル識別子と、領域識別子とを有する。また、一のファイル識別子は、通常、1以上の領域識別子と対応付いている。ファイル識別子は、例えば、任意の文字列や、任意の数値、いわゆるファイル名などである。また、ファイル識別子は、ファイルを識別することができれば、その形式や内容などは、問わない。
 また、ファイル管理情報は、例えば、ファイルが作成された日時や、ファイルが更新された日時、ファイルのアクセス権(パーミッション)、ファイルを作成したユーザなどのファイルの属性を示す情報を有していてもよい。また、これらの情報は、通常、一のファイル識別子に対応付いている。
 例えば、一のファイルをNVメモリ11に書き込む場合、ファイルシステム部13は、例えば、まず、当該一のファイルを、どの1以上の領域に書き込むのかを決定する。当該1以上の領域は、通常、未使用領域である。そして、ファイルシステム部13は、当該一のファイルを、当該決定した領域ごとの1以上のデータに分割する。そして、ファイルシステム部13は、当該分割した1以上のデータを、当該決定した1以上の各領域に書き込む。
 また、例えば、一のファイルをNVメモリ11に書き込んだ場合、ファイルシステム部13は、通常、書き込んだファイルを識別するファイル識別子と、書き込み先の1以上の各領域を識別する1以上の領域識別子との対応を示すファイル管理情報を、ファイル管理情報格納手段131に蓄積する。当該蓄積は、通常、ファイル管理情報格納手段131への追記である。
 また、例えば、一のファイルをNVメモリ11から読み出す場合、ファイルシステム部13は、まず、当該一のファイルが書き込まれている1以上の領域を識別する領域識別子を、ファイル管理情報から取得する。そして、ファイルシステム部13は、取得した1以上の領域識別子が示す領域から、1以上に分割されたファイルのデータを取得する。
 また、例えば、一のファイルをNVメモリ11から削除する場合、ファイルシステム部13は、まず、当該一のファイルが書き込まれている1以上の領域を識別するファイル識別子を、ファイル管理情報から取得する。そして、ファイルシステム部13は、取得した1以上の領域識別子が示す領域から、データを消去する。なお、当該「消去」には、通常、当該ファイル管理情報を削除することも含まれる。
 また、例えば、一のファイルをNVメモリ11から削除した場合、ファイルシステム部13は、通常、削除したファイルを識別するファイル識別子を有するファイル管理情報を、ファイル管理情報格納手段131から削除する。
 また、例えば、一のファイルをNVメモリ11から削除する場合、ファイルシステム部13は、例えば、当該一のファイルを識別するファイル識別子を有するファイル管理情報を、ファイル管理情報格納手段131から削除することのみを行ってもよい。また、当該ファイル管理情報の削除は、例えば、当該ファイル管理情報に削除したことを示すフラグを付与することであってもよい。
 また、ここで、「ファイルシステムの不整合」とは、ファイルシステムの整合性が保たれていない状態のことである。当該状態は、例えば、上記のファイル管理情報において、ファイル識別子が対応付いていない領域識別子を有している状態のことである。言い換えると、当該状態は、ファイル管理情報が領域識別子のみを有している状態のことである。つまり、「ファイルシステムの不整合」とは、ファイル管理情報において使用領域として管理されている領域が、どのファイルからも使用されていない状態のことである。
 また、ファイルシステム部13は、例えば、1以上の領域を管理するための情報であるファイル領域管理情報を保持していてもよい。「領域を管理する」とは、一の領域が未使用領域であるのか使用領域であるのかを管理することである。ファイル領域管理情報は、例えば、未使用領域を識別する1以上の領域識別子を有する。また、ファイル領域管理情報は、例えば、使用領域を識別する1以上の領域識別子を有する。また、ファイル領域管理情報は、例えば、未使用領域および使用領域を識別する1以上の領域識別子を有する。未使用領域および使用領域を識別する1以上の領域識別子を有する場合、当該1以上の各領域識別子には、通常、領域が未使用領域であるのか使用領域であるのかを示すフラグが対応付いている。また、ファイル領域管理情報は、例えば、図示しないファイル領域管理情報格納手段に格納されていてもよい。
 例えば、NVメモリ11にファイルを書き込んだ場合、ファイルシステム部13は、当該書き込んだ1以上の各領域を識別する1以上の領域識別子を、使用領域を識別する領域識別子として、ファイル領域管理情報格納手段に蓄積する。また、同じ領域識別子が既に格納されている場合、ファイルシステム部13は、当該領域識別子を削除してもよいし、当該領域識別子に使用領域であることを示すフラグを付与してもよい。
 また、例えば、NVメモリ11からファイルを削除した場合、ファイルシステム部13は、当該削除した1以上の各領域を識別する1以上の領域識別子を、未使用領域を識別する領域識別子として、ファイル領域管理情報格納手段に蓄積する。また、同じ領域識別子が既に格納されている場合、ファイルシステム部13は、当該領域識別子を削除してもよいし、当該領域識別子に未使用領域であることを示すフラグを付与してもよい。
 また、ファイルを書き込む領域を決定する場合、ファイルシステム部13は、例えば、上記のファイル領域管理情報を用いて、当該領域を決定してもよい。
 なお、ファイルシステムは、公知の技術であるので、ファイルシステム部13が行う処理や動作については、適宜、説明を省略する。
 ファイル管理情報格納手段131には、1以上のファイル管理情報が格納される。当該1以上のファイル管理情報の集合を、以下、適宜、ファイル管理情報群とする。また、ファイル管理情報については、説明済みであるので、説明を省略する。
 メモリ管理部14は、いわゆるメモリ管理を行う。メモリ管理とは、例えば、実行中のプロセスからの要求に応じて、NVメモリ11が有する1以上の領域を確保し、当該確保した領域を当該プロセスに割り当てることや、プロセスが終了した場合に、当該プロセスに割り当てられていた1以上の領域を、未使用領域として解放することなどである。
 「1以上の領域を確保する」とは、当該1以上の各領域を識別する1以上の領域識別子を取得することである。
 また、実行中のプロセスは、通常、1つの仮想アドレス空間を持つ。従って、「1以上の領域を割り当てる」とは、通常、当該仮想アドレス空間が有する1以上の各仮想アドレスと、1以上の各領域識別子とを対応付けることや、当該1以上の領域識別子をプロセスに渡すことなどである。当該領域識別子は、通常、物理アドレスである。また、このとき、メモリ管理部14は、プロセスを識別するプロセス識別子を対応付けてもよい。また、このとき、メモリ管理部14は、当該対応付けた結果を示す情報(以下、適宜、メモリ管理情報)を、NVメモリ11に蓄積する。また、当該領域の割り当てを、以下、適宜、領域割当、メモリ割当、ブロック割当、ページ割当などとする。
 また、「1以上の領域を解放する」とは、通常、仮想アドレスと領域識別子との対応付けを解除することである。この場合、メモリ管理部14は、通常、当該対応付けを示すメモリ管理情報を、NVメモリ11から削除する。
 ここで、メモリ管理情報とは、NVメモリ11の未使用領域や使用領域を管理するための情報である。また、メモリ管理情報は、通常、少なくとも、1以上の仮想アドレスと、1以上の物理アドレスとを有する。また、当該1以上の各仮想アドレスと、1以上の各物理アドレスとは、通常、1対1で対応付いている。また、当該対応付いた情報には、プロセスを識別するプロセス識別子が対応付いていてもよい。プロセス識別子は、例えば、プロセス名や、プロセスの番号などである。また、プロセス識別子は、プロセスを識別することができれば、その形式や内容などは、問わない。また、プロセス管理情報は、1以上の仮想アドレスと1以上の物理アドレスとが対応付いた情報であってもよいし、当該対応付いた情報を1以上有する情報であってもよい。
 また、メモリ管理部14が確保する1以上の領域は、通常、ファイルシステム部13がファイルとして使用し得る1以上の領域である。「ファイルとして使用し得る1以上の領域」とは、ファイルが書き込まれる可能性のある1以上の領域や、ファイルが書き込まれている1以上の領域、書き込まれているデータがファイルとして扱われる可能性のある1以上の領域などである。つまり、当該1以上の領域は、1以上の未使用領域であってもよいし、1以上の使用領域であってもよい。また、メモリ管理部14は、通常、ファイルシステム部13を介して1以上の領域の確保を行う。「ファイルシステム部13を介して」とは、ファイル管理情報格納手段131に格納されているファイル管理情報を用いて、1以上の領域を確保することである。
 また、メモリ管理部14は、プロセスに割り当てた領域や、未使用領域、使用領域などの管理を行う。当該「管理」とは、例えば、仮想アドレスと領域識別子との対応を示す情報を予め決められた記憶領域に蓄積することや、未使用領域を識別する1以上の領域識別子を予め決められた記憶領域に蓄積すること、使用領域を識別する1以上の領域識別子を予め決められた記憶領域に蓄積することなどである。また、当該予め決められた記憶領域とは、通常、NVメモリ11が有する領域である。
 なお、メモリ管理は、公知の技術であるので、メモリ管理部14が行う処理や動作については、適宜、説明を省略する。また、メモリ管理部14は、例えば、1以上の領域の確保や、当該確保した1以上の領域のプロセスへの割り当て、割り当てた1以上の領域の解放などを、通常、後述の各手段により行う。
 領域識別子格納手段141には、1以上の領域識別子が格納される。領域識別子については、説明済みであるので、説明を省略する。なお、当該領域識別子は、通常、物理アドレスである。
 未使用領域検出手段142は、NVメモリ11から未使用領域を検出し、当該未使用領域を識別する1以上の領域識別子を取得する。「未使用領域を検出する」とは、未使用領域を特定することである。また、未使用領域検出手段142は、通常、プロセスから要求されたサイズに合う1以上の未使用領域を検出する。当該「プロセスから要求されたサイズに合う」とは、通常、当該要求されたサイズが収まることである。つまり、当該1以上の未使用領域のサイズは、通常、当該要求されたサイズ以上のサイズであり、当該要求されたサイズとの差が最小であるサイズである。また、未使用領域検出手段142は、通常、当該1以上の領域識別子を、ファイル管理情報を用いて取得する。当該ファイル管理情報は、ファイル管理情報格納手段131に格納されているファイル管理情報である。
 例えば、未使用領域検出手段142は、まず、NVメモリ11が有する1以上の各領域を識別する1以上の領域識別子を取得する。当該1以上の領域識別子は、例えば、予めNVメモリ11に格納されているものとする。そして、未使用領域検出手段142は、当該取得した1以上の領域識別子のうち、ファイル管理情報が有さない1以上の領域識別子を取得する。
 例えば、NVメモリ11が配置された物理アドレス空間が有する物理アドレスが、「0xF0000001」、「0xF0000002」、「0xF0000003」、「0xF0000004」であるとする。また、ファイル管理情報が有する領域識別子が、物理アドレス「0xF0000001」、「0xF0000004」であるとする。また、NVメモリ11が有する1以上の各領域のサイズが、「4KB」であるとする。また、プロセスから要求されたサイズが、「3KB」であるとする。この様な場合、確保すべき領域の数は、1つである。従って、未使用領域検出手段142は、物理アドレス「0xF0000002」、「0xF0000004」により識別される2つの領域を未使用領域として検出する。そして、未使用領域検出手段142は、当該2つの物理アドレスのうちの1つを取得する。
 なお、未使用領域検出手段142が取得した1以上の各領域識別子により識別される1以上の領域は、通常、領域の割り当てを要求したプロセスに割り当てられる。また、当該割り当ては、通常、後述の割当手段145が行う。また、当該割り当ては、未使用領域検出手段142が行ってもよい。
 ファイル管理情報追記手段143は、ファイル管理情報格納手段131にファイル管理情報を追記する。「ファイル管理情報を追記する」とは、ファイル管理情報格納手段131にファイル管理情報を蓄積し、ファイル管理情報格納手段131に格納されているファイル管理情報群に、新たなレコード(ファイル管理情報)を追記することである。また、当該ファイル管理情報格納手段131に蓄積されるファイル管理情報は、一のファイル識別子と1以上の領域識別子とが対応付いた情報である。当該1のファイル識別子は、通常、ファイル管理情報格納手段131に格納されている1以上のファイル識別子のいずれかである。また、当該1以上の領域識別子は、通常、未使用領域検出手段142が取得した1以上の領域識別子である。
 ファイル管理情報追記手段143は、例えば、以下の手順により、ファイル管理情報を追記する。
(a-1)未使用領域検出手段142が取得した1以上の領域識別子を取得する。
(a-2)ファイル管理情報が有する1以上のファイル識別子から、1つのファイル識別子を取得する。
(a-3)(a-1)で取得した1以上の領域識別子と、(a-2)で取得した1つのファイル識別子とを対応付けて、ファイル管理情報を作成する。
(a-4)(a-3)で作成したファイル管理情報を、ファイル管理情報格納手段131に追記する。
 また、ファイル管理情報追記手段143は、例えば、以下の手順により、ファイル管理情報を追記してもよい。
(b-1)未使用領域検出手段142が取得した1以上の領域識別子を取得する。
(b-2)(b-1)で取得した1以上の領域識別子を、ファイル管理情報格納手段131に追記する。
(b-3)ファイル管理情報が有する1以上のファイル識別子から、1つのファイル識別子を取得する。
(b-4)(b-3)で取得した1つのファイル識別子を、(b-2)で追記した1以上の領域識別子に対応付けて、ファイル管理情報格納手段131に追記する。
 なお、上記の(b-2)において、「領域識別子を追記する」とは、ファイル管理情報格納手段131に領域識別子を蓄積し、ファイル管理情報格納手段131に格納されているファイル管理情報群に、当該領域識別子を新たなレコードとして追記することである。
 また、上記の(b-4)において、「領域識別子に対応付けてファイル識別子を追記する」とは、ファイル管理情報格納手段131にファイル識別子を追記し、当該ファイル識別子を上記の(b-2)で追記したレコードに含めることである。
 また、上記の(a-2)、(b-3)で取得する1つのファイル識別子は、通常、予め決められた方法により取得される。当該「予め決められた方法」とは、例えば、ランダムに選ぶことや、予め決められた順序で選ぶことなどである。予め決められた順序とは、例えば、ファイル識別子の昇順または降順、日時の昇順または降順などである。
 また、ファイル管理情報追記手段143は、結果的に、上記の1以上の領域識別子と、上記の1つのファイル識別子とが対応付いたファイル管理情報を、ファイル管理情報格納手段131に蓄積することができればよく、その手順や方法などは、問わない。
 領域識別子取得手段144は、ファイル管理情報格納手段131から、1以上の領域識別子を取得する。当該1以上の領域識別子は、ファイル管理情報格納手段131に格納されているファイル管理情報が有する領域識別子である。そして、領域識別子取得手段144は、当該取得した1以上の領域識別子を、領域識別子格納手段141に蓄積する。
 また、領域識別子取得手段144は、通常、2つの方法のいずれかにより、1以上の領域識別子を取得する。当該2つの方法のうちの1つを、以下、適宜、事前確保とする。また、当該2つの方法のうちのもう1つを、以下、適宜、オンデマンド確保とする。
 事前確保の場合、領域識別子取得手段144は、通常、予め決められたタイミングで、ファイル管理情報格納手段131から、すべての領域識別子を取得する。当該予め決められたタイミングとは、通常、情報処理装置1の起動の直後である。また、当該予め決められたタイミングとは、例えば、情報処理装置1の起動中や、最初にプロセスの実行の要求があった直後、最初に実行の要求があったプロセスの実行が開始された直後などであってもよい。
 また、オンデマンド確保の場合、領域識別子取得手段144は、通常、実行中のプロセスから要求があるたびに、当該要求に応じて、領域識別子を取得する。また、このとき、領域識別子取得手段144は、通常、まず、領域識別子格納手段141に1以上の領域識別子が格納されているか否かを判断する。そして、格納されていない場合に、領域識別子取得手段144は、領域識別子を取得する。また、このとき、領域識別子取得手段144は、プロセスから要求されたサイズに合う1以上の領域識別子を取得する。
 なお、領域識別子取得手段144が取得した1以上の各領域識別子により識別される1以上の領域は、通常、領域の割り当てを要求したプロセスに割り当てられる。また、当該割り当ては、通常、後述の割当手段145が行う。また、当該割り当ては、領域識別子取得手段144が行ってもよい。
 割当手段145は、実行中のプロセスからの要求に応じて、1以上の領域を当該プロセスに割り当てる。また、割当手段145は、当該割り当ての結果を示すプロセス管理情報を、予め決められた記憶領域に蓄積する。当該予め決められた記憶領域とは、通常、NVメモリ11が有する領域である。
 例えば、未使用領域検出手段142が1以上の領域識別子を取得した場合、割当手段145は、当該1以上の各領域識別子により識別される1以上の領域を、割り当てを要求したプロセスに割り当てる。当該割り当ての方法を、以下、適宜、半直接融合方式とする。半直接融合方式では、当該割り当てに加え、ファイル管理情報追記手段143により、未使用領域検出手段142が取得した1以上の領域識別子と、ファイル管理情報が有する1以上のファイル識別子のいずれかとが対応付いたファイル管理情報を、ファイル管理情報格納手段131に追記する。これに対し、当該1以上の領域識別子のファイル管理情報格納手段131への蓄積のみを行う割り当ての方法を、以下、適宜、直接融合方式とする。つまり、直接融合方式では、未使用領域検出手段142が取得した1以上の各領域識別子により識別される1以上の領域をプロセスに割り当て、当該1以上の領域識別子をファイル管理情報格納手段131に追記する。これに対し、半直接融合方式では、当該割り当てと当該追記に加え、ファイル識別子を、追記した1以上の領域識別子に対応付けてファイル管理情報格納手段131に追記する。
 また、例えば、領域識別子取得手段144が1以上の領域識別子を取得した場合、割当手段145は、領域識別子取得手段144が取得し、領域識別子格納手段141に格納されている1以上の領域識別子のうちのいずれかにより識別される領域を、割り当てを要求したプロセスに割り当てる。当該割り当ての方法を、以下、適宜、間接融合方式とする。そして、割当手段145は、プロセスに割り当てた1以上の各領域を識別する1以上の領域識別子を、領域識別子格納手段141から削除する。
 例えば、領域識別子取得手段144が事前確保により1以上の領域識別子を取得した場合、割当手段145は、領域識別子格納手段141に格納されている1以上の領域識別子から、プロセスが要求したサイズに合う1以上の各領域を識別する1以上の領域識別子を取得する。そして、割当手段145は、当該1以上の各領域識別子により識別される1以上の領域を、割り当てを要求したプロセスに割り当てる。
 また、例えば、領域識別子取得手段144がオンデマンド確保により1以上の領域識別子を取得した場合、割当手段145は、領域識別子格納手段141に格納されている1以上の各領域識別子により識別される1以上の領域を、割り当てを要求したプロセスに割り当てる。
 また、割当手段145は、例えば、実行中のプロセスからの要求に応じて、当該プロセスが要求したサイズと同サイズのファイルをNVメモリ11に書き込むことを、ファイルシステム部13に指示してもよい。当該「ファイルを書き込む」ことは、ファイルを作成することである。そして、割当手段145は、ファイルシステム部13から、ファイルが書き込まれた領域を識別する1以上の領域識別子を受信する。そして、割当手段145は、当該1以上の各領域識別子により識別される1以上の領域を、割り当てを要求したプロセスに割り当てる。当該割り当ての方法を、以下、適宜、mmap方式とする。
 また、メモリ管理部14は、例えば、1以上の領域を管理するための情報であるメモリ領域管理情報を保持していてもよい。メモリ管理情報の形式や内容などは、ファイル領域管理情報と同様であるので、説明を省略する。また、メモリ領域管理情報は、図示しないメモリ領域管理情報格納手段に格納されていてもよい。
 例えば、プロセスに1以上の領域を割り当てた場合、割当手段145は、当該割り当てた1以上の各領域を識別する1以上の領域識別子を、使用領域を識別する領域識別子として、メモリ領域管理情報格納手段に蓄積する。また、同じ領域識別子が既に格納されている場合、割当手段145は、例えば、当該領域識別子を削除してもよいし、当該領域識別子に、使用領域であることを示すフラグを対応付けてもよい。
 また、例えば、プロセスの実行が終了した場合、割当手段145は、当該プロセスに割り当てていた1以上の各領域を識別する1以上の領域識別子を、未使用領域を識別する領域識別子として、メモリ領域管理情報格納手段に蓄積する。また、同じ領域識別子が既に格納されている場合、割当手段145は、例えば、当該識別子を削除してもよいし、当該領域識別子に、未使用領域であることを示すフラグを対応付けて蓄積してもよい。
 また、プロセスに割り当てる領域を決定する場合、割当手段145は、例えば、メモリ領域管理情報を用いて、当該領域を決定してもよい。
 なお、受付部12における情報や指示などの入力手段は、メニュー画面によるものや、キーボードなど、何でもよい。受付部12は、メニュー画面の制御ソフトウェアや、キーボード等の入力手段のデバイスドライバなどで実現され得る。
 また、ファイルシステム部13、メモリ管理部14、未使用領域検出手段142、ファイル管理情報追記手段143、領域識別子取得手段144、割当手段145は、通常、MPUやメモリ等から実現され得る。また、ファイルシステム部13などの処理手順は、通常、ソフトウェアで実現され、当該ソフトウェアはROM等の記録媒体に記録されている。なお、ファイルシステム部13などは、ハードウェア(専用回路)で実現されてもよい。
 また、ファイル管理情報格納手段131、領域識別子格納手段141は、通常、NVメモリ11が有する1以上の領域で実現される。また、ファイル管理情報格納手段131などは、例えば、NVメモリ11以外の不揮発性の記録媒体や、揮発性の記録媒体で実現されてもよい。また、ファイル管理情報格納手段131などに所定の情報が記憶される過程は、問わない。例えば、当該所定の情報は、記録媒体や、通信回線、入力デバイスなどを介してファイル管理情報格納手段131などに記憶されてもよい。
 次に、情報処理装置1の全体動作について、フローチャートを用いて説明する。図2は、情報処理装置1の全体動作を示すフローチャートである。なお、図2をはじめ以下の説明において参照するフローチャートにおいては、紙面の都合上、分岐処理(判断)のブロックに、JIS(Japanese Industrial Standards)に規格されている菱形に変えて六角形(準備)を用いている。
 (ステップS201)ファイルシステム部13は、NVメモリ11を物理アドレス空間に配置する。当該配置は、メモリ管理部14が行ってもよい。
 (ステップS202)メモリ管理部14は、プロセスへの領域の割当方法が、間接融合方式かつ事前確保であるか否かを判断する。例えば、当該領域の割当方法を示す情報が所定の記憶領域に格納されている場合、メモリ管理部14は、当該情報により領域の割当方法を判断する。そして、間接融合方式かつ事前確保である場合は、ステップS203に進み、そうでない場合は、ステップS205に進む。
 (ステップS203)領域識別子取得手段144は、ファイル管理情報格納手段131に格納されているすべての領域識別子を取得する。
 (ステップS204)領域識別子取得手段144は、取得した1以上の領域識別子を、領域識別子格納手段141に蓄積する。
 (ステップS205)ファイルシステム部13は、受付部12がファイル書込指示を受け付けたか否かを判断する。ファイル書込指示とは、ファイルをNVメモリ11に書き込むための指示である。また、ファイル書込指示は、通常、ファイル識別子と、ファイルを構成するデータとを有する。そして、受け付けた場合は、ステップS206に進み、そうでない場合は、ステップS209に進む。
 (ステップS206)ファイルシステム部13は、ファイルを書き込むための1以上の領域を確保するために、1以上の領域識別子を取得する。
 (ステップS207)ファイルシステム部13は、ステップS206で取得した1以上の各領域識別子が識別する1以上の領域に、ファイルを書き込む。
 (ステップS208)ファイルシステム部13は、ステップS206で取得した1以上の領域識別子と、ステップS207で書き込んだファイルを識別するファイル識別子とを対応付け、ファイル管理情報としてファイル管理情報格納手段131に蓄積する。
 (ステップS209)ファイルシステム部13は、受付部12がファイル読出指示を受け付けたか否かを判断する。ファイル読出指示とは、ファイルをNVメモリ11から読み出すための指示である。また、ファイル読出指示は、通常、ファイル識別子を有する。そして、受け付けた場合は、ステップS210に進み、そうでない場合は、ステップS212に進む。
 (ステップS210)ファイルシステム部13は、読み出すファイルが書き込まれている1以上の各領域を識別する1以上の領域識別子を、ファイル管理情報格納手段131から取得する。
 (ステップS211)ファイルシステム部13は、ステップS210で取得した1以上の各領域識別子により識別される1以上の領域から、ファイルを読み出す。
 (ステップS212)ファイルシステム部13は、受付部12がファイル削除指示を受け付けたか否かを判断する。ファイル削除指示とは、ファイルをNVメモリ11から削除するための指示である。また、ファイル削除指示は、通常、ファイル識別子を有する。そして、受け付けた場合は、ステップS213に進み、そうでない場合は、ステップS216に進む。
 (ステップS213)ファイルシステム部13は、削除するファイルが書き込まれている1以上の各領域を識別する1以上の領域識別子を、ファイル管理情報格納手段131から取得する。
 (ステップS214)ファイルシステム部13は、ステップS213で取得した1以上の各領域識別子により識別される1以上の領域から、ファイルを削除する。
 (ステップS215)ファイルシステム部13は、ステップS213で取得した1以上の領域識別子を有するファイル管理情報を、ファイル管理情報格納手段131から削除する。
 (ステップS216)メモリ管理部14は、受付部12がプロセス実行指示を受け付けたか否かを判断する。プロセス実行指示とは、プロセスを実行するための指示である。また、プロセス実行指示は、通常、プロセス識別子を有する。そして、受け付けた場合は、ステップS217に進み、そうでない場合は、ステップS205に戻る。
 (ステップS217)情報処理装置1は、プロセスを実行する。
 (ステップS218)メモリ管理部14は、実行中のプロセスからの要求に応じて、当該プロセスに1以上の領域を割り当てる。この処理の詳細は、図3のフローチャートを用いて説明する。
 (ステップS219)メモリ管理部14は、プロセスの実行が終了したか否かを判断する。終了した場合は、ステップS220に進み、そうでない場合は、ステップS219に戻る。
 (ステップS220)メモリ管理部14は、実行が終了したプロセスに割り当てられていた1以上の領域を解放する。この処理の詳細は、図4のフローチャートを用いて説明する。
 なお、図2のフローチャートにおいて、電源オフや処理終了の割り込みにより処理を終了してもよい。
 図3は、図2のフローチャートのステップS218の領域の割当処理を示すフローチャートである。
 (ステップS301)メモリ管理部14は、プロセスへの領域の割当方法が、半直接融合方式であるか否かを判断する。半直接融合方式である場合は、ステップS302に進み、そうでない場合は、ステップS305に進む。
 (ステップS302)未使用領域検出手段142は、ファイル管理情報格納手段131に格納されているファイル管理情報を用いて、プロセスから要求されたサイズに合う1以上の未使用領域を検出し、当該1以上の各未使用領域を識別する1以上の領域識別子を取得する。
 (ステップS303)ファイル管理情報追記手段143は、ステップS302で取得した1以上の領域識別子と、ファイル管理情報が有する1以上のファイル識別子のいずれかとを対応付け、ファイル管理情報を作成する。
 (ステップS304)ファイル管理情報追記手段143は、ステップS303で作成したファイル管理情報を、ファイル管理情報格納手段131に追記する。
 (ステップS305)メモリ管理部14は、プロセスへの領域の割当方法が、間接融合方式かつ事前確保であるか否かを判断する。間接融合方式かつ事前確保である場合は、ステップS306に進み、そうでない場合は、ステップS307に進む。
 (ステップS306)割当手段145は、領域識別子格納手段141から、プロセスから要求されたサイズに合う1以上の領域識別子を取得する。
 (ステップS307)メモリ管理部14は、プロセスへの領域の割当方法が、間接融合方式かつオンデマンド確保であるか否かを判断する。間接融合方式かつオンデマンド確保である場合は、ステップS308に進み、そうでない場合は、ステップS312に進む。
 (ステップS308)領域識別子取得手段144は、領域識別子格納手段141に1以上の領域識別子が格納されているか否かを判断する。格納されている場合は、ステップS311に進み、そうでない場合は、ステップS309に進む。
 (ステップS309)領域識別子取得手段144は、ファイル管理情報格納手段131から、プロセスから要求されたサイズに合う1以上の領域識別子を取得する。
 (ステップS310)領域識別子取得手段144は、ステップS309で取得した1以上の領域識別子を、領域識別子格納手段141に蓄積する。
 (ステップS311)割当手段145は、領域識別子格納手段141から、プロセスから要求されたサイズに合う1以上の領域識別子を取得する。また、このとき、割当手段145は、当該取得した1以上お領域識別子を、領域識別子格納手段141から削除する。当該削除は、例えば、削除したことを示すフラグを付与することであってもよい。
 (ステップS312)メモリ管理部14は、プロセスへの領域の割当方法が、mmap方式であるか否かを判断する。mmap方式である場合は、ステップS313に進み、そうでない場合は、ステップS315に進む。
 (ステップS313)割当手段145は、プロセスから要求されたサイズと同サイズのファイルを書き込むためのファイル書込指示を、ファイルシステム部13に送信する。
 (ステップS314)割当手段145は、ファイルシステム部13から、ファイルが書き込まれた領域を識別する1以上の領域識別子を受信する。
 (ステップS315)割当手段145は、ステップS302で取得した1以上の領域識別子、またはステップS306で取得した1以上の領域識別子、またはステップS311で取得した1以上の領域識別子、またはステップS314で受信した1以上の領域識別子を、領域の割り当てを要求したプロセスに割り当てる。また、割当手段145は、通常、当該割り当ての結果を示すメモリ管理情報を、図示しないメモリ管理情報格納手段に蓄積する。そして、上位処理にリターンする。
 図4は、図2のフローチャートのステップS220の領域の解放処理を示すフローチャートである。
 (ステップS401)割当手段145は、プロセスへの領域の割当方法が、半直接融合方式であるか否かを判断する。半直接融合方式である場合は、ステップS402に進み、そうでない場合は、ステップS404に進む。
 (ステップS402)割当手段145は、プロセスに割り当てていた1以上の各領域を識別する1以上の領域識別子を有するファイル管理情報を、ファイル管理情報格納手段131から削除する。
 (ステップS403)割当手段145は、プロセスに割り当てていた1以上の各領域を識別する1以上の領域識別子を有するメモリ管理情報を、図示しないメモリ管理情報格納手段から削除する。
 (ステップS404)割当手段145は、プロセスへの領域の割当方法が、間接融合方式であるか否かを判断する。間接融合方式である場合は、ステップS405に進み、そうでない場合は、ステップS408に進む。
 (ステップS405)割当手段145は、プロセスに割り当てていた1以上の各領域を識別する1以上の領域識別子を、図示しないメモリ管理情報格納手段から取得する。
 (ステップS406)割当手段145は、ステップS405で取得した1以上の領域識別子を、領域識別子格納手段141に蓄積する。当該削除は、例えば、削除したことを示すフラグを削除することであってもよい。
 (ステップS407)割当手段145は、ステップS405で取得した1以上の領域識別子を有するメモリ管理情報を、図示しないメモリ管理情報格納手段から削除する。
 (ステップS408)割当手段145は、プロセスへの領域の割当方法が、mmap方式であるか否かを判断する。mmap方式である場合は、ステップS409に進み、そうでない場合は、上位処理にリターンする。
 (ステップS409)割当手段145は、プロセスに割り当てていた1以上の各領域を識別する1以上の領域識別子を、図示しないメモリ管理情報格納手段から取得する。
 (ステップS410)割当手段145は、ステップS409で取得した1以上の各領域識別子により識別される1以上の領域に書き込まれているファイルを削除するためのファイル削除指示を、ファイルシステム部13に送信する。
 (ステップS411)割当手段145は、ステップS409で取得した1以上の領域識別子を有するメモリ管理情報を、図示しないメモリ管理情報格納手段から削除する。そして、上位処理にリターンする。
 (具体例)
 次に、情報処理装置1の動作の具体例について説明する。なお、本具体例において、NVメモリ11は、一の物理アドレス空間に配置されているものとする。また、NVメモリ11は、サイズが4KBである1以上の領域を有しているものとする。
 (例1)
 本例において、半直接融合方式による領域割当の例について説明する。なお、本例において、ファイル管理情報格納手段131には、図5に示す1以上のファイル管理情報が格納されているものとする。当該ファイル管理情報は、レコードを一意に特定するためのIDと、ファイル識別子(項目名:ファイル)と、物理アドレスとを有する。当該物理アドレスは、領域識別子である。また、図5のファイル管理情報は、例えば、物理アドレス「0x00000001」、「0x00000002」、「0x00000003」のそれぞれにより識別される3つの領域に、ファイル識別子「file01」により識別されるファイルが書き込まれていることを示す。
 まず、ユーザが、情報処理装置1を操作し、任意のプログラムを実行する操作を行ったとする。すると、受付部12は、当該プログラムをプロセスとして実行するためのプロセス実行指示を受け付ける。当該プロセス実行指示は、プロセス識別子「proc01」を有するものとする。そして、情報処理装置1は、当該プロセス識別子により識別される上記プログラムを、プロセスとして実行する。
 次に、実行中のプロセスが、10KBの領域を割り当てることを要求したとする。すると、受付部12は、領域を割り当てるための指示である領域割当指示を受け付ける。当該領域割当指示は、プロセス識別子「proc01」と、割り当てる領域のサイズ「10KB」を有しているものとする。
 次に、未使用領域検出手段142は、図5のファイル管理情報を用いて、サイズ「10KB」に合う1以上の未使用領域を検出し、当該1以上の各領域を識別する1以上の物理アドレスを取得する。NVメモリ11が有する各領域のサイズは、「4KB」であるので、未使用領域検出手段142は、3つの物理アドレスを取得する。ここで、図5において、当該図に記載されている物理アドレス以外の物理アドレスにより識別される領域は、未使用領域であるものとする。この結果、未使用領域検出手段142は、「0x00000004」、「0x00000005」、「0x00000006」の物理アドレスを取得したものとする。
 次に、ファイル管理情報追記手段143は、図5のファイル管理情報から、任意のファイル識別子を取得する。この結果、ファイル管理情報追記手段143は、図5の「ID=001」のファイル識別子「file01」を取得したものとする。このとき、ファイル管理情報追記手段143は、ファイル識別子を昇順にソートした際の先頭のファイル識別子を取得すると予め決められていたものとする。
 次に、ファイル管理情報追記手段143は、上記で取得した3つの物理アドレス「0x00000004」、「0x00000005」、「0x00000006」と、上記で取得したファイル識別子「file01」を対応付け、ファイル管理情報を作成する。そして、ファイル管理情報追記手段143は、当該作成したファイル管理情報をファイル管理情報格納手段131に蓄積し、図5のファイル管理情報群に追記する。当該追記後のファイル管理情報は、図6である。図6において、「ID=008」から「ID=010」までが、追記したファイル管理情報である。
 次に、割当手段145は、未使用領域検出手段142が取得した3つの物理アドレスにより識別される3つの領域を、プロセス識別子「proc01」により識別されるプロセスに割り当てる。そして、割当手段145は、当該割り当ての結果を示すメモリ管理情報を、図示しないメモリ管理情報格納手段に蓄積する。当該蓄積したメモリ管理情報は、図7である。当該メモリ管理情報は、レコードを一意に特定するためのIDと、プロセス識別子(項目名:プロセス)と、仮想アドレスと、物理アドレスとを有する。また、当該メモリ管理情報は、プロセス識別子「proc01」により識別されるプロセスの仮想アドレス空間が有する仮想アドレス「0xF0000001」、「0xF0000002」、「0xF0000003」のそれぞれと、物理アドレス「0x00000004」、「0x00000005」、「0x00000006」のそれぞれとが対応付いていることを示す。
 (例2)
 本例において、間接融合方式による領域割当の例について説明する。なお、本例において、ファイル管理情報格納手段131には、図5に示すファイル管理情報が格納されているものとする。
 まず、事前確保の例について説明する。例1と同様に、ユーザが、情報処理装置1を操作し、任意のプログラムを実行するための操作を行ったとする。ここで、受付部12が受け付ける指示などは、例1と同様であるので、説明を省略する。
 次に、領域識別子取得手段144は、図5のファイル管理情報が有するすべての物理アドレス(7つ)を取得する。そして、領域識別子取得手段144は、当該取得した7つの物理アドレスを、領域識別子格納手段141に蓄積する。
 次に、割当手段145は、プロセス識別子「proc01」により識別されるプロセスが要求するサイズ「10KB」に合う3つの物理アドレスを、領域識別子格納手段141から取得する。この結果、割当手段145は、「0x00000011」、「0x00000012」、「0x00000013」の3つの物理アドレスを取得したものとする。また、割当手段145は、当該3つの物理アドレスを、領域識別子格納手段141から削除する。当該削除は、例えば、削除したことを示すフラグを付与することであってもよい。
 次に、割当手段145は、取得した3つの物理アドレスにより識別される3つの領域を、プロセス識別子「proc01」により識別されるプロセスに割り当てる。そして、割当手段145は、当該割り当ての結果を示すメモリ管理情報を、図示しないメモリ管理情報格納手段に蓄積する。当該蓄積したメモリ管理情報は、図8である。当該メモリ管理情報が有する情報や、当該メモリ管理情報が示す意味などは、図7と同様であるので、説明を省略する。
 次に、プロセス識別子「proc01」により識別されるプロセスの実行が終了したとする。すると、割当手段145は、図8のメモリ管理情報から、プロセス識別子「proc01」に対応する物理アドレス「0x00000011」、「0x00000012」、「0x00000013」を取得する。そして、割当手段145は、図8のメモリ管理情報を、メモリ管理情報格納手段から削除する。
 次に、割当手段145は、取得した3つの物理アドレスを、領域識別子格納手段141に蓄積する。当該蓄積は、例えば、削除したことを示すフラグを削除することであってもよい。
 次に、オンデマンド確保の例について説明する。上記と同様に、プロセス識別子「proc01」により識別されるプロセスが実行されており、当該プロセスがサイズ「10KB」の領域の割り当てを要求しているとする。
 次に、領域識別子取得手段144は、領域識別子格納手段141に1以上の領域識別子が格納されているか否かを判断する。この結果、領域識別子取得手段144は、1以上の領域識別子が格納されていないと判断したものとする。
 次に、領域識別子取得手段144は、プロセス識別子「proc01」により識別されるプロセスが要求するサイズ「10KB」に合う3つの物理アドレスを、図5のファイル管理情報から取得する。この結果、領域識別子取得手段144は、「0x00000011」、「0x00000012」、「0x00000013」の3つの物理アドレスを取得したものとする。そして、領域識別子取得手段144は、当該3つの物理アドレスを、領域識別子格納手段141に蓄積する。
 次に、割当手段145は、領域識別子格納手段141に格納されている3つの物理アドレス「0x00000011」、「0x00000012」、「0x00000013」を取得する。また、割当手段145は、当該3つの物理アドレスを、領域識別子格納手段141から削除する。
 次に、割当手段145は、取得した3つの物理アドレスにより識別される3つの領域を、プロセス識別子「proc01」により識別されるプロセスに割り当てる。そして、割当手段145は、当該割り当ての結果を示すメモリ管理情報を、図示しないメモリ管理情報格納手段に蓄積する。当該蓄積したメモリ管理情報は、図8である。
 なお、プロセスの実行の終了後のメモリ管理情報の削除などの例については、上記と同様であるので、説明を省略する。
 (例3)
 本例において、mmap方式による領域割当の例について説明する。なお、本例において、ファイル管理情報格納手段131には、図5に示すファイル管理情報が格納されているものとする。
 まず、例1と同様に、プロセス識別子「proc01」により識別されるプロセスが実行されており、当該プロセスがサイズ「10KB」の領域の割当を要求しているとする。
 次に、割当手段145は、サイズ「10KB」のファイルをNVメモリ11に書き込むためのファイル書込指示を、ファイルシステム部13に送信する。当該ファイル書込指示は、ファイルのサイズ「10KB」を有しているものとする。
 次に、受付部12は、上記のファイル書込指示を受け付ける。そして、ファイルシステム部13は、当該ファイル書込指示に従い、任意のファイル識別子を取得する。また、ファイルシステム部13は、図5のファイル管理情報を用いて、ファイルのサイズ「10KB」に合う3つの未使用領域を識別する物理アドレスを取得する。この結果、ファイルシステム部13は、ファイル識別子「file99」を取得したものとする。また、ファイルシステム部13は、「0x00000004」、「0x00000005」、「0x00000006」の物理アドレスを取得したものとする。
 次に、ファイルシステム部13は、取得した3つの各物理アドレスにより識別される3つの領域に、ファイルを書き込む。そして、ファイルシステム部13は、当該書き込みの結果を示すファイル管理情報を、ファイル管理情報格納手段131に蓄積し、図5のファイル管理情報群に追記する。当該追記後のファイル管理情報は、図9である。当該ファイル管理情報が有する情報や、当該ファイル管理情報が示す意味などは、図5と同様であるので、説明を省略する。
 次に、ファイルシステム部13は、ファイルを書き込んだ領域を識別する3つの物理アドレスを、メモリ管理部14に送信する。
 次に、割当手段145は、3つの物理アドレス「0x00000004」、「0x00000005」、「0x00000006」を受信する。そして、割当手段145は、当該3つの物理アドレスにより識別される3つの領域を、プロセス識別子「proc01」により識別されるプロセスに割り当てる。そして、割当手段145は、当該割り当ての結果を示すメモリ管理情報を、図示しないメモリ管理情報格納手段に蓄積する。当該蓄積したメモリ管理情報は、図7である。
 なお、プロセスの実行の終了後のメモリ管理情報の削除などの例については、例1、例2と同様であるので、説明を省略する。
 (例4)
 本例において、情報処理装置1の具体的な実現方法の例について説明する。なお、本例において、NVメモリ11は、単に「NVメモリ」と表記するものとする。また、情報処理装置1は、Linux(登録商標)カーネル(以下、カーネル)であるものとする。
 まず、情報処理装置1を構成するシステムの構成例について説明する。当該構成例を示す図は、図10である。図10は、NVメモリとファイルシステムが融合されたシステムを示す概念図である。NVメモリが有する領域を、ストレージとして使用する領域、メインメモリとして使用する領域とに区別することなく、NVメモリをストレージおよびメインメモリの両方に使用できるようにするために、情報処理装置1は、NVメモリが有する領域を、ファイルシステムにより管理する。NVメモリ上のファイルシステムにファイルを格納する場合は、通常と同様に、ファイルのデータを格納するためのブロックが割り当てられる。ファイルに格納されたプログラムテキストおよびデータは、XIPにより、メインメモリとして直接参照できる。それ以外に、空きメモリ領域を必要とする場合は、ファイルシステムから空きブロックを取得する。図10のプロセスは、ファイルのテキストをXIPによりマップし、ヒープに必要な領域は空きブロックを取得しマップしている。なお、空きメモリ領域、空きブロックは、共に、未使用領域のことである。
 次に、半直接融合方式の実現方法の例について説明する。半直接融合方式の実装には、ファイルシステムから確保したブロックへの参照を、事前に作成されたファイルに追加および削除する機能が必要となる。ファイルシステムからのブロック確保は、直接融合方式の実装を用いる。また、ブロックへの参照を追加および削除するファイルは、ユーザプログラムから指定する。そのための機能を、キャラクタ型のデバイスドライバとして実装する。
 また、ブロックへの参照を追加および削除するファイルの識別子を受け取るために、デバイスドライバのioctlインタフェースを使用する。ioctlインタフェースを実装した関数のプロトタイプ宣言は、例えば、図11である。
 図11の関数は、ファイルの識別子として、ファイルディスクリプタを受け取る。その値は、3番目の引数「arg」で受け取る。また、当該関数は、「fget()」を用いて、ファイルディスクリプタからfile構造体を取得する。file構造体はファイルの実体を表すため、そこからinode番号や、ファイルを操作する関数などをたどることができる。inodeとは、ファイルシステムのデータ構造であり、公知であるので、詳細な説明を省略する。また、2番目の引数「cmd」で、半直接融合方式、間接融合方式(事前確保またはオンデマンド確保)のいずれを用いるかを指定する。
 半直接融合方式は、確保したブロックのファイルシステム内でのオフセットを、参照を追加するファイル内のオフセットとし、ブロックをファイルに追加する。参照の追加および削除のための実装は、ファイルシステムの内部構造に依存するため、使用するファイルシステム(例えば、Ext2やPRAMFS)のそれぞれに必要である。PRAMFSの内部構造は単純である。従って、PRAMFSに実装する場合は、ファイルのinodeを直接操作する関数を実装する。また、Ext2の内部構造はやや複雑である。従って、Ext2に実装する場合は、可能な限り既存のコードを呼び出すことで、追加と削除を行う実装とする。そのため、Ext2への実装は、余分なブロック確保と解放を伴う冗長な実装となる。
 次に、間接融合方式の実現方法の例について説明する。間接融合方式の実装には、事前およびオンデマンド確保のどちらについても、ファイルに割り当てたブロックのアドレスを取得する機能、メモリ割当には未使用の空きブロックを管理する機能が必要となる。メモリ割当に使用するファイルの識別子は、半直接融合方式で実装したデバイスドライバにより受け取る。また、プロセスからの、メモリアロケータを通した、メモリ割当および解放要求のインタフェースは、直接融合方式と同じである。
 空きブロックの管理には、いわゆるフリーリストを用いる。空きブロックをメインメモリとして割り当てるには、ファイルに割り当てたブロックのアドレスを取得する必要がある。ファイルにブロックを割り当て、そのアドレスを取得するには、XIPをサポートするファイルシステムが提供するインタフェースである「get_xip_mem()」を用いる。図12に示すコードの様に「get_xip_mem()」を呼び出すことで、ファイル内の「offset」に対応するブロックのカーネル内の仮想アドレスおよび物理ページ番号を、それぞれ「kmem」、「pfn」に受け取ることができる。第3引数は、ブロックを確保するか否かを指定する。図12の様に「1」を指定するとブロックが確保され、「0」を指定するとブロックは確保されない。
 また、事前確保では、初期化時に、図12の「offset」を、ファイルの先頭から最後のブロックに対応した値に変更していく。その結果、すべてのブロックが確保され、それらの仮想アドレスおよび物理ページ番号を取得することができる。そして、確保したブロックのアドレスを用いて、フリーリストを作成する。また、オンデマンド確保の場合、ファイルの先頭からブロックを割り当てていくが、フリーリストが空の場合に新たにブロックを確保する。事前確保およびオンデマンド確保のいずれにおいても、メモリ解放時には、ブロックはフリーリストに戻され、ファイルシステムに解放されない。
 上記のように、間接融合方式は、ファイルシステムのインタフェースを用いて実装できるため、ファイルシステムへの変更は不要であり、またファイルシステムごとの実装も不要である。
 次に、mmap方式の実現方法の例について説明する。mmap方式は、ファイルシステムからブロックを確保し、プロセスへのメモリ割当に使用するために、mmapシステムコール(以下、適宜、「mmap」)を用いる方式である。従って、mmap方式を実現するために、カーネル内への新規の実装は、不要である。mmap方式によるメモリ割当を行うには、プログラムでメモリ割当を行う際に、mmapシステムコールを用いるようにする。しかしながら、既存のプログラムの多くでは、メモリ割当には「malloc()」が用いられている。Linux(登録商標)で標準的に用いられている標準Cライブラリ「GNU Libc」では、小さなメモリ割当にはヒープ領域が、大きなメモリ割当には「mmap」により確保された領域が割り当てられるようになっている。この割り当てる領域が小さいか大きいかを判断するための閾値を、図13の様に変更することで、プログラムを修正せずに、常に「mmap」が用いられるようになる。
 (例5)
 本例において、例4に示した実現方法により実現した情報処理装置1を動作させた実験結果などについて説明する。
 まず、メモリ割当コストの比較の実験結果について説明する。
 (実験環境)
 NVメモリをメインメモリとして持つシステムは、一般的に入手可能な状態ではない。また、アクセス遅延の差、書き込み回数の制限は考慮しないとし、DRAMの一部をNVメモリとみなして実験を行った。実験には、「Intel Atom D2700 2.13GHz」を用いた。ハイパースレッディング機能はBIOSで無効化し、1CPUの状態で計測した。DRAMの一部をNVメモリとみなすため、8GBのDRAMを搭載し、当該DRAMの後半の4GBの領域をNVメモリとして使用することにした。カーネルが認識するDRAM領域を制限するために、カーネルに「mem=128M」オプションを渡し、DRAMとしては128MBだけ使用する状態で実験を行った。なお、DRAMのみの場合の実験は、上記のメインメモリの分割を行わない状態で行った。
 (実験結果)
 メモリ割当コストを計測するため、引数で指定された容量のメモリ領域を確保し、その領域の各ページの先頭部分に対し書き込みを行うプログラムを作成し、実行した。測定結果には、メモリ割当コストのみが含まれ、解放コストは含まれない。実行したのは、DRAMのみ、直接融合方式、半直接融合方式、間接融合方式(事前確保およびオンデマンド確保)、mmap方式の5つの方式の場合である。DRAMのみの場合を除き、Ext2とPRAMFSの2つのファイルシステムで実行した。当該実行結果は、図14である。図14において、横軸は割当メモリサイズ(MB)、縦軸はRDTSC(Read Time Stamp Counter)により取得した値をクロック値で割ることで得た実行時間(ミリ秒)である。
 実行結果から、以下の3つのことがわかる。
(1)Ext2における半直接融合方式のコストが大きい
(2)mmap方式のコストはExt2およびPRAMFSの両方で大きい
(3)最もコストが低いのは間接融合方式(事前確保)である
 間接融合方式(事前確保)と比較して、直接融合方式、半直接融合方式、間接融合方式(オンデマンド確保)、mmap方式の各方式は、PRAMFSでは、それぞれ2.3%、2.5%、1.2%、27.9%、コストが大きい。一方、Ext2では、それぞれ5.2%、111.5%、3.2%、73.6%、コストが大きい。間接融合方式(オンデマンド確保)は、より大きなメモリ割当が発生するたびに、ファイルへのブロック割当が発生する。しかしながら、一度割り当てられたブロックは、解放後はフリーリストで管理され再利用されるため、割当コストへの影響は小さい。半直接融合方式は、PRAMFSではコストへの影響は小さく済んでいる一方で、Ext2のコストは大きくなっている。Ext2での実装は、余分なブロック確保と解放を伴う、冗長なものとなっているため、その影響が大きいと考えられる。mmap方式と他方式との最も際立った違いは、ファイルシステムからのブロック確保の方式にある。間接融合方式では、基本的にはフリーリストから1ブロック取得するだけである。一方、直接融合方式では、フリーリストが空になるたびに、ファイルシステムから複数ブロックを一括確保する。mmap方式では、ページ割当要求に対し、1ブロックずつファイルシステムから確保する必要がある。従って、実験結果から、ファイルシステムからのブロック確保コストの影響を受けること、一括確保の効果が大きいことがわかる。
 次に、ファイルシステムの整合性への影響の実験結果について説明する。
 (実験環境)
 比較に用いるファイルシステムは、ファイルシステムの修復ツールが提供されているExt2とする。そして、直接融合方式、半直接融合方式、間接融合方式(事前確保およびondemand確保)、mmap方式の5つの方式によりメモリ割当を行った場合について比較を行う。当該比較は、メモリ確保を行うプログラムを実行し、512MBの領域を確保した状態で強制終了させた場合について、OS再起動後にファイルシステム修復ツール(e2fsck)が検出するファイルシステムの不整合報告数により行う。
 NVメモリ上のファイルシステムに対するファイルシステム修復ツールの適用は、異常終了後、再起動してからになる。それには、再起動時にNVメモリ領域の内容が保存されている必要があるため、再起動時にメモリが初期化されてしまう実機は使用できない。そこで、QEMU(http://wiki.qemu.org/Main_Page)にNVメインメモリのエミュレーション機能を追加したものを、評価環境として用いる。図15に示すコマンドを実行すると、128MBのDRAMの領域が確保され、また、ファイル「nvmemory.img」のすべてが、NVメモリとして物理アドレス「0x10000000」からの領域にマッピングされた状態で、QEMUが起動する。
 ファイル「nvmemory.img」には、異常終了時の内容が、再起動後にも保持される。異常終了は、QEMUのプロセスを強制終了することで、模擬する。
 (実験結果)
 ファイルシステム修復ツール(e2fsck)が検出したファイルシステムの不整合報告の結果は、図16である。図16より、直接融合方式では、空きブロック数に異常があるという報告が、合計で6つあった。一方、残りの半直接融合方式、間接融合方式(事前確保およびondemand確保)、mmap方式では、不整合の報告はなかった。直接融合方式は、ファイルシステムから直接ブロックを確保し、メインメモリへの割り当てに使用するため、どこからも参照されないが使用中のブロックができる。そのため、ファイルシステムの空きブロック数(Free blocks count)に不整合を引き起こす。実験結果では、その空きブロック数の不整合が、ファイルシステム全体と、複数のブロックグループで異なっているという報告が出ており、直接融合方式に直接起因する不整合であると考えられる。空きブロック数の不整合は、比較的軽微な不整合ではあるが、放置すると、ファイルシステムがメモリリーク状態となってしまうため、修復する必要がある。
 半直接融合方式、間接融合方式(事前確保およびondemand確保)、mmap方式の5つの方式は、メインメモリへの割り当てに使用するために、ファイルシステムから確保したブロックは、すべてファイルから参照される。そのため、行った実験では、不整合を引き起こすことはなかった。しかしながら、これは、どのような場合にも不整合を引き起こさないことを保証するものではない。ファイルシステムに操作を行っている途中での異常終了は、不整合を引き起こす可能性がある。しかしながら、そのような不整合は、通常のファイル操作でも起こりうるものであり、上記の5つの方式によるメモリ割当に起因して起こるわけではない。
 次に、ファイルシステムにおける空き領域管理方式の影響についての検証結果について説明する。
 上記の実験結果より、ファイルシステムからのブロック確保コストの影響が大きいことがわかる。特に、mmap方式では、1ブロックずつ確保するため、ファイルシステムの空き領域管理方式の影響を大きく受ける。そこで、単純な内部構造を持つPRAMFSを対象とし、ファイルシステムにおける空き領域管理方式を、メモリ上の操作に適した構造とすることで、ブロック確保コストを軽減し、その影響を検証する。
 ファイルシステムから1ブロックの確保に必要な操作は、直接融合方式および間接融合方式では、基本的にはフリーリストから要素を1つ取り出すだけである。一方、mmap方式では、ファイルシステムの空き領域管理方式を通してブロック確保を行う。PRAMFSは、空き領域管理にビットマップを採用しているため、ビットマップの検索コストがかかる。シークに時間のかかるHDDでは、ファイル内部のフラグメントの原因となるため、空きブロックをリストで管理する方式は、通常、使用されない。一方、ビットマップは、あるブロックに近い別の空きブロックを見つけやすく、内部フラグメントを抑制できるため、多くのファイルシステムで用いられている。しかしながら、シーク時間を考慮する必要のないNVメモリ上にファイルシステムを構築する場合、検索に時間のかかるビットマップの利点はない。
 ファイルシステムの空き領域管理方式の軽量化が、mmap方式でのメモリ割当コストの軽減につながることを検証するため、PRAMFSの空き領域管理にリストを用いるように変更した。それにより、間接融合方式と同じコストで、ファイルシステムから1ブロックの確保が可能になる。また、ビットマップデータを置く必要がなくなるため、ファイルシステムの管理領域が小さくなり、その分をデータ領域に使用することができるようになる。
 上記と同様に、各方式でメモリ割当を行うプログラムを実行した。当該実行結果は、図17である。図17において、空き領域管理方式にリストを用いるように変更した結果は、「PRAMFS2」として示されている。空き領域管理方式の軽量化により、mmap方式によるメモリ割当コストは58.2%減少している。一方、他方式のコストへの影響は、ほとんど見られない。
 mmap方式のメモリ割当コストが大きく減少したことで、間接融合方式(事前確保)と比較しても46.8%低く、mmap方式は、最もコストの低い方式となった。このような大きな減少の理由を調査するために、Performance Monitoring Counter(PMC)を用いて、実行命令数、キャッシュミスの回数を計測した。また、同じ実験をQEMUでも行い、実行命令数を計測した。当該結果は、図18である。図18において、QEMUによるTSC(Time Stamp Counter)の計測は、実行命令数を表すのに対し、AtomによるTSCの計測は、実行時間を表す。また、図18において、「Instruction Retired」は、実行命令数、「LLC(Last Level Cache) Misses」は、すべてのL2キャッシュミスの回数、「MEM LOAD RETIRED.L2 HIT」は、L1データキャッシュをミスしL2キャッシュにヒットしたロード命令数、「MEM LOAD RETIRED.L2 MISS」は、L2キャッシュをミスしたロード命令数である。
 QEMUにおける実行命令数と、Atomにおける実行命令数は、割り込みの影響があるため完全には一致しないが、近い値となっている。実行命令数では、空き領域管理方式の軽量化により、mmap方式のメモリ割当コストの減少は37.5%となり、実行時間ほどの大きな減少とはなっていない。実行時間の差を広げる原因となったと考えられるのが、キャッシュミスの回数である。図18において、「LLC Misses」、「MEM LOAD RETIRED.L2 MISS」の両方で、大きな差が見られる。「Atom D2700」のL2キャッシュは、コアあたり512KBであり、現在のノートPC用プロセッサと比較しても小さい。従って、空き領域管理方式の軽量化により、アクセスするデータの多くが、Atomのキャッシュにのる効果があったと考えられる。実際に、8MBのL3キャッシュを持つ「Xeon E3-1270」で実験を行ったところ、メモリ割当コストの減少は26.0%となり、キャッシュサイズが影響していることを裏付けている。
 以上の実験から、NVメモリ上に構築するファイルシステムは、HDDとの性質の違いから、異なった内部構造を持つべき場合があり、空き領域管理方式はその1つであることがわかった。
 以上、本実施の形態による情報処理装置1によれば、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができる。
 なお、本実施の形態において、前述のファイル管理情報、ファイル領域管理情報、メモリ管理情報、メモリ領域管理情報は、例えば、1つの情報で表現されてもよい。当該情報を、領域管理情報とする。領域管理情報は、例えば、NVメモリ11が配置された物理アドレス空間が有するすべての物理アドレスを有する。当該1以上の各物理アドレスには、例えば、ファイル識別子や、論理アドレス、プロセス識別子、仮想アドレス、当該物理アドレスにより識別される領域が未使用領域であるか使用領域であるかを示すフラグなどが対応付いている。
 また、本実施の形態において、ファイル管理情報は、例えば、一のファイル識別子と、一の領域識別子と、領域の数を示す情報(以下、適宜、領域数情報)とを有する情報であってもよい。この場合、これら3つの情報は、通常、対応付いている。また、この場合、当該一の領域識別子は、通常、当該一のファイル識別子により識別されるファイルが書き込まれている先頭の領域を識別する。また、領域数情報は、通常、当該先頭の領域から連続して書き込まれている領域の数を示す。
 例えば、当該領域識別子が「0x00000011」であり、領域数情報が「3」であるとする。この場合、当該ファイル管理情報は、領域識別子「0x00000011」、「0x00000012」、「0x00000013」により識別される3つの領域に、ファイルが書き込まれていることを意味する。
 また、上記の場合、ファイル管理情報は、一のファイル識別子と、一の領域識別子と、領域数情報とを有する情報を1以上有する情報であってもよい。
 また、本実施の形態において、メモリ管理部14は、ファイル管理情報が有する1以上のファイル識別子のいずれかを取得するファイル識別子取得手段を備えていてもよい。この場合、ファイル識別子取得手段は、通常、ファイル管理情報が有する1以上のファイル識別子を、予め決められた方法により取得する。また、この場合、ファイル管理情報追記手段143は、通常、未使用領域検出手段142が取得した1以上の領域識別子と、ファイル識別子取得手段が取得した1つのファイル識別子とを対応付け、ファイル管理情報を作成する。
 また、上記各実施の形態において、各処理または各機能は、単一の装置または単一のシステムによって集中処理されることによって実現されてもよいし、あるいは、複数の装置または複数のシステムによって分散処理されることによって実現されてもよい。
 また、上記各実施の形態において、各構成要素は専用のハードウェアにより構成されてもよいし、あるいは、ソフトウェアにより実現可能な構成要素については、プログラムを実行することによって実現されてもよい。例えば、ハードディスクや半導体メモリ等の記録媒体に記録されたソフトウェア・プログラムをCPU等のプログラム実行部が読み出して実行することによって、各構成要素が実現され得る。
 また、上記各実施の形態における情報処理装置を実現するソフトウェアは、例えば、以下のようなプログラムである。つまり、このプログラムは、不揮発性の記録媒体であるNVメモリにアクセス可能なコンピュータを、前記NVメモリに保存されている1以上のファイルを管理するファイルシステム部と、実行中のプロセスからの要求に応じて、前記ファイルシステム部がファイルとして使用し得る前記NVメモリの領域を確保し、当該確保した領域を当該プロセスに割り当てるメモリ管理部として機能させるためのプログラムである。
 なお、上記プログラムにおいて、上記プログラムが実現する機能には、ハードウェアでしか実現できない機能は含まれない。
 また、上記プログラムは、サーバなどからダウンロードされることによって実行されてもよいし、所定の記録媒体(例えば、CD-ROMなどの光ディスクや磁気ディスク、半導体メモリなど)に記録されたプログラムが読み出されることによって実行されてもよい。また、このプログラムは、プログラムプロダクトを構成するプログラムとして用いられてもよい。
 また、上記プログラムを実行するコンピュータは、単数であってもよいし、複数であってもよい。つまり、集中処理を行ってもよいし、あるいは分散処理を行ってもよい。
 また、図19は、前述のプログラムを実行して、前述の実施の形態の情報処理装置等を実現するコンピュータシステム9の概観図である。前述の実施の形態は、コンピュータハードウェア、およびその上で実行されるコンピュータプログラムで実現され得る。
 図19において、コンピュータシステム9は、CD-ROMドライブ9011、FDドライブ9012を含むコンピュータ901と、キーボード902と、マウス903と、モニタ904とを備える。
 図20は、コンピュータシステム9のブロック図である。図20において、コンピュータ901は、CD-ROMドライブ9011、FDドライブ9012に加えて、MPU9013と、ブートアッププログラム等のプログラムを記憶するためのROM9014と、MPU9013に接続され、アプリケーションプログラムの命令を一時的に記憶するとともに一時記憶空間を提供するためのRAM9015と、アプリケーションプログラム、システムプログラム、およびデータを記憶するためのハードディスク9016と、CD-ROMドライブ9011、FDドライブ9012、MPU9013等を相互に接続するバス9017とを備える。ここでは図示しないが、コンピュータ901は、さらに、LANへの接続を提供するネットワークカードを備えていてもよい。
 コンピュータシステム9に、前述の実施の形態の情報処理装置等の機能を実行させるプログラムは、CD-ROM9101、またはFD9102に記憶されて、CD-ROMドライブ9011またはFDドライブ9012に挿入され、さらにハードディスク9016に転送されてもよい。これに代えて、プログラムは、図示しないネットワークを介してコンピュータ901に送信され、ハードディスク9016に記憶されてもよい。プログラムは実行の際にRAM9015にロードされる。プログラムは、CD-ROM9101、FD9102またはネットワークから直接、ロードされてもよい。
 プログラムは、コンピュータ901に、前述の実施の形態の情報処理装置等の機能を実行させるオペレーティングシステム(OS)、またはサードパーティープログラム等は、必ずしも含まなくてもよい。プログラムは、制御された態様で適切な機能(モジュール)を呼び出し、所望の結果が得られるようにする命令の部分のみを含んでいればよい。コンピュータシステム9がどのように動作するかは周知であり、詳細な説明は省略する。
 本発明は、以上の実施の形態に限定されることなく、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
 以上のように、本発明にかかる情報処理装置は、NVメモリをメインメモリおよびストレージとして使用する場合に、システムの異常終了時におけるファイルシステムの不整合を減らすことができるという効果を有し、オペレーティングシステムの一機能等として有用である。
 1 情報処理装置
 11 NVメモリ
 12 受付部
 13 ファイルシステム部
 14 メモリ管理部
 131 ファイル管理情報格納手段
 141 領域識別子格納手段
 142 未使用領域検出手段
 143 ファイル管理情報追記手段
 144 領域識別子取得手段
 145 割当手段

Claims (8)

  1.  不揮発性の記録媒体であるNVメモリと、
     前記NVメモリに保存されている1以上のファイルを管理するファイルシステム部と、
     実行中のプロセスからの要求に応じて、前記ファイルシステム部がファイルとして使用し得る前記NVメモリの領域を確保し、当該確保した領域を当該プロセスに割り当てるメモリ管理部と
     を備える情報処理装置。
  2.  前記ファイルシステム部は、
     1以上のファイルを管理するための情報であり、ファイルを識別するファイル識別子と、当該ファイルに対応する1以上のNVメモリの領域を識別する領域識別子とが対応付いた情報である1以上のファイル管理情報が格納されるファイル管理情報格納手段
     を備え、
     前記メモリ管理部は、
     実行中のプロセスからの要求に応じて、当該プロセスに割り当てる前記NVメモリの領域を確保するために、前記ファイル管理情報を用いて、使用されていない前記NVメモリの領域である未使用領域を検出し、当該未使用領域を識別する1以上の領域識別子を取得する未使用領域検出手段と、
     前記未使用領域検出手段が取得した1以上の領域識別子と、前記ファイル管理情報が有する1以上のファイル識別子のいずれかとが対応付いたファイル管理情報を、前記ファイル管理情報格納手段に追記するファイル管理情報追記手段と
     を備える
     請求項1に記載の情報処理装置。
  3.  前記ファイルシステム部は、
     1以上のファイルを管理するための情報であり、ファイルを識別するファイル識別子と、当該ファイルに対応する1以上のNVメモリの領域を識別する領域識別子とが対応付いた情報であるファイル管理情報が格納されるファイル管理情報格納手段
     を備え、
     前記メモリ管理部は、
     1以上の領域識別子が格納される領域識別子格納手段と、
     前記ファイル管理情報格納手段から、1以上の領域識別子を取得し、当該取得した領域識別子を前記領域識別子格納手段に蓄積する領域識別子取得手段と、
     実行中のプロセスからの要求に応じて、前記領域識別子格納手段に格納されている1以上の領域識別子のうちのいずれかにより識別されるNVメモリの領域を当該プロセスに対して割り当てる割当手段と
     を備える
     請求項1に記載の情報処理装置。
  4.  前記領域識別子取得手段は、
     所定のタイミングで、前記ファイル管理情報格納手段から、すべての領域識別子を取得し、当該取得した領域識別子を前記領域識別子格納手段に蓄積する
     請求項3に記載の情報処理装置。
  5.  前記領域識別子取得手段は、
     実行中のプロセスからの要求に応じて、前記領域識別子格納手段に1以上の領域識別子が格納されているか否かを判断し、格納されていない場合に、前記ファイル管理情報格納手段から、1以上の領域識別子を取得し、当該取得した領域識別子を前記領域識別子格納手段に蓄積する
     請求項3に記載の情報処理装置。
  6.  前記ファイルシステム部は、
     実行中のプロセスからの要求に応じて、当該プロセスが要求したサイズと同サイズのファイルを、前記NVメモリの領域に書き込み、
     前記メモリ管理部は、
     実行中のプロセスからの要求に応じて、前記ファイルシステム部がファイルを書き込んだNVメモリの領域を、当該プロセスに割り当てる
     請求項1に記載の情報処理装置。
  7.  不揮発性の記録媒体であるNVメモリと、ファイルシステム部と、メモリ管理部とを用いて行われる情報処理方法であって、
     前記ファイルシステム部が、
     前記NVメモリに保存されている1以上のファイルを管理するファイルシステムステップと、
     前記メモリ管理部が、
     実行中のプロセスからの要求に応じて、前記ファイルシステム部がファイルとして使用し得る前記NVメモリの領域を確保し、当該確保した領域を当該プロセスに割り当てるメモリ管理ステップと
     を備える情報処理方法。
  8.  不揮発性の記録媒体であるNVメモリにアクセス可能なコンピュータを、
     前記NVメモリに保存されている1以上のファイルを管理するファイルシステム部と、
     実行中のプロセスからの要求に応じて、前記ファイルシステム部がファイルとして使用し得る前記NVメモリの領域を確保し、当該確保した領域を当該プロセスに割り当てるメモリ管理部と
     として機能させるためのプログラム。
PCT/JP2013/078734 2013-02-04 2013-10-23 情報処理装置、情報処理方法、およびプログラム WO2014119063A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/765,366 US10503702B2 (en) 2013-02-04 2013-10-23 Information processing device, information processing method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2013019170A JP5619198B2 (ja) 2013-02-04 2013-02-04 情報処理装置、情報処理方法、およびプログラム
JP2013-019170 2013-02-04

Publications (1)

Publication Number Publication Date
WO2014119063A1 true WO2014119063A1 (ja) 2014-08-07

Family

ID=51261799

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/078734 WO2014119063A1 (ja) 2013-02-04 2013-10-23 情報処理装置、情報処理方法、およびプログラム

Country Status (3)

Country Link
US (1) US10503702B2 (ja)
JP (1) JP5619198B2 (ja)
WO (1) WO2014119063A1 (ja)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933751B (zh) * 2015-12-29 2019-12-24 澜起科技股份有限公司 用于保护动态随机访问存储器的方法和设备
JP7003470B2 (ja) * 2017-07-18 2022-01-20 富士通株式会社 情報処理装置、情報処理方法、及びプログラム

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006222581A (ja) * 2005-02-08 2006-08-24 Canon Inc 画像形成装置及びその制御方法、コンピュータプログラム及び記憶媒体
JP2008009506A (ja) * 2006-06-27 2008-01-17 Sony Corp 情報処理装置及びそのファイルアクセス方法
JP2009533770A (ja) * 2006-04-10 2009-09-17 アップル インコーポレイテッド Nandフラッシュメモリを用いた直接ブート構成

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0778766B2 (ja) * 1992-09-25 1995-08-23 インターナショナル・ビジネス・マシーンズ・コーポレイション ランダム・アクセス可能かつ書換え可能メモリを用いる外部記憶装置におけるプログラム直接実行の制御方法および装置
US5675725A (en) * 1993-07-19 1997-10-07 Cheyenne Advanced Technology Limited Computer backup system operable with open files
JP3753598B2 (ja) * 2000-07-06 2006-03-08 株式会社日立製作所 計算機、計算機システムおよびデータ転送方法
JP2004362464A (ja) * 2003-06-06 2004-12-24 Sony Corp 不揮発メモリを利用したコンピュータシステム
TWI359377B (en) * 2005-04-05 2012-03-01 Ibm System and method for providing execute-in-place f
US7409489B2 (en) * 2005-08-03 2008-08-05 Sandisk Corporation Scheduling of reclaim operations in non-volatile memory
US8645438B2 (en) * 2009-06-30 2014-02-04 Sandisk Technologies Inc. File system and method of file access
US9411517B2 (en) * 2010-08-30 2016-08-09 Vmware, Inc. System software interfaces for space-optimized block devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006222581A (ja) * 2005-02-08 2006-08-24 Canon Inc 画像形成装置及びその制御方法、コンピュータプログラム及び記憶媒体
JP2009533770A (ja) * 2006-04-10 2009-09-17 アップル インコーポレイテッド Nandフラッシュメモリを用いた直接ブート構成
JP2008009506A (ja) * 2006-06-27 2008-01-17 Sony Corp 情報処理装置及びそのファイルアクセス方法

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JU-YOUNG JUNG ET AL.: "Dynamic Co-Management of Persistent RAM Main Memory and Storage Resources", CF '11 PROCEEDINGS OF THE 8TH ACM INTERNATIONAL CONFERENCE ON COMPUTING FRONTIERS, NEW YORK *
KATELIN BAILE ET AL.: "Operating System Implications of Fast, Cheap, Non-Volatile Memory", HOTOS'13 PROCEEDINGS OF THE 13TH USENIX CONFERENCE ON HOT TOPICS IN OPERATING SYSTEMS, 9 May 2011 (2011-05-09), Retrieved from the Internet <URL:https://www.usenix.org/legacy/events/hotosll/tech/slides/bailey.pdf> *
KATELIN BAILEY ET AL.: "Operating System Implications of Fast, Cheap, Non-Volatile Memory", HOTOS'13 PROCEEDINGS OF THE 13TH USENIX CONFERENCE ON HOT TOPICS IN OPERATING SYSTEMS, 9 May 2011 (2011-05-09), Retrieved from the Internet <URL:http://homes.cs.> [retrieved on 20131126] *
SHUICHI OIKAWA: "Unification of Non-Volatile Main Memory and a File System", IPSJ JOURNAL, vol. 54, no. 3, 15 March 2013 (2013-03-15), pages 1153 - 1164 *

Also Published As

Publication number Publication date
JP5619198B2 (ja) 2014-11-05
US20160085771A1 (en) 2016-03-24
US10503702B2 (en) 2019-12-10
JP2014149758A (ja) 2014-08-21

Similar Documents

Publication Publication Date Title
WO2014171223A1 (ja) 情報処理装置、情報処理方法、およびプログラム
US8447918B2 (en) Garbage collection for failure prediction and repartitioning
KR102275563B1 (ko) 호스트-관리 비휘발성 메모리
JP6450598B2 (ja) 情報処理装置、情報処理方法およびプログラム
US9535628B2 (en) Memory system with shared file system
US20150347310A1 (en) Storage Controller and Method for Managing Metadata in a Cache Store
US10949342B2 (en) Persistent memory garbage collection
US20170075614A1 (en) Memory system and host apparatus
US9501344B2 (en) Data dump for a memory in a data processing system
US8892810B2 (en) Semiconductor device and memory protection method
CN107391038B (zh) 资料存储型闪存的数据写入方法、闪存及存储介质
JP2008225620A (ja) メモリ共有システム、方法、及び、プログラム
US10216529B1 (en) Method and system for sharing driver pages
CN115080223A (zh) 内存读写指令的执行方法及计算设备
US8151086B2 (en) Early detection of an access to de-allocated memory
JP5619198B2 (ja) 情報処理装置、情報処理方法、およびプログラム
JP5492731B2 (ja) 仮想計算機のボリューム割当て方法およびその方法を用いた計算機システム
JP6219560B2 (ja) 情報処理装置、情報処理方法、およびプログラム
KR101549569B1 (ko) 가비지 컬렉션 수행 방법 및 그 방법을 이용한 플래시 메모리 장치
KR101950759B1 (ko) 저장 장치의 메모리 컨트롤러가 수행하는 가비지 컬렉션 방법 및 메모리 컨트롤러
US20170039110A1 (en) Computer
CN107562639B (zh) 擦除块读请求处理方法与装置
CN107562654B (zh) Io命令处理方法与装置
US10853257B1 (en) Zero detection within sub-track compression domains
CN111143418B (zh) 一种数据库读取数据方法、装置、设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 13873262

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14765366

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 13873262

Country of ref document: EP

Kind code of ref document: A1