WO2015131403A1 - 访问文件的方法和相关设备 - Google Patents
访问文件的方法和相关设备 Download PDFInfo
- Publication number
- WO2015131403A1 WO2015131403A1 PCT/CN2014/073070 CN2014073070W WO2015131403A1 WO 2015131403 A1 WO2015131403 A1 WO 2015131403A1 CN 2014073070 W CN2014073070 W CN 2014073070W WO 2015131403 A1 WO2015131403 A1 WO 2015131403A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- address space
- page table
- memory area
- memory
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 441
- 230000015654 memory Effects 0.000 claims abstract description 1312
- 230000008569 process Effects 0.000 claims abstract description 336
- 238000013507 mapping Methods 0.000 claims abstract description 309
- 230000003936 working memory Effects 0.000 claims description 162
- 230000009286 beneficial effect Effects 0.000 description 39
- 238000010586 diagram Methods 0.000 description 22
- 238000006243 chemical reaction Methods 0.000 description 11
- 238000007726 management method Methods 0.000 description 8
- 230000007246 mechanism Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000008520 organization Effects 0.000 description 5
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000035939 shock Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/109—Address translation for multiple virtual address spaces, e.g. segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1727—Details of free space management performed by the file system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1008—Correctness of operation, e.g. memory ordering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/65—Details of virtual memory and virtual address translation
- G06F2212/657—Virtual address space management
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a method and apparatus for accessing files and a computing node. Background technique
- SCM Storage Class Memory
- the concept of Storage Class Memory (SCM) is now emerging, based on a new generation of non-volatile memory technology.
- the access performance of the new generation of non-volatile memory is basically the same as that of the normal memory model.
- it has the reliability of semiconductor products, such as shock and compression, and can be directly written without erasing old data. It can be used as a new generation storage device to alleviate the huge difference in access speed between processor and storage.
- the SCM-side and some existing conventional random access memory (RAM) can be directly attached to the memory bus and directly face the central processing unit (CPU); In terms of its function, it also extends to existing external storage and can be used as a permanent data storage device.
- NVM Non-Volatile Memory
- DRAM dynamic random access memory
- the embodiment of the invention provides a method for accessing a file and related devices, which are suitable for file access in a file system resident memory scenario.
- a first aspect of the embodiments of the present invention provides a method for accessing a file, where the method for accessing a file is applied to a computing node, where the computing node includes a memory, and the memory includes: a file storage memory area and a process working memory area.
- the working memory area of the process stores a memory page table, and an operating system runs in the working memory area of the process.
- the method for accessing the file includes:
- the operating system receives a file open request carrying a file identifier
- the operating system obtains a first index node of the file represented by the file identifier, where the file is stored in the file storage memory area; and the file storage memory area is obtained based on the first index node a first physical address space in a memory area in which the file is stored;
- the operating system allocates a first virtual address space to the file
- the operating system records the first virtual address mapping relationship by using the memory page table
- the first virtual real address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, where the memory page table includes a kernel memory page table and/or a user process memory. Page table.
- the obtaining, by the first index node, a first physical address space of a memory area in which the file is stored in the file storage memory area including: based on a first file page table recorded in the first index node or a pointer for pointing to the first file page table, obtaining a first physical address space of the memory area in the file storage memory area where the file is stored, wherein the first file page table is used to point to the file storage A memory area of the file is stored in the memory area, and the first physical address space is a single-level or multi-level file page table.
- the using the memory page table to record the first virtual real address mapping relationship includes: adding the memory page table And an entry for recording the first virtual real address mapping relationship, the entry includes the first file page table or a pointer for pointing to the first file page table.
- the total number of the memory page table is Y
- the total number of the first file page table For X if it is The entry includes the first file page table, and the entry is an entry in the Y-X+1-level memory page table in the memory page table, if the entry includes a reference point a pointer of the first file page table, wherein the entry is an entry in a YX-level memory page table in the memory page table, the X is a positive integer, and the Y is greater than the positive of the X Integer.
- the method further includes:
- the operating system records, in the first index node, a first virtual address space and/or a starting address of the first virtual address space, and/or a file corresponding to the operating system in the file
- the first virtual address space and/or the start address of the first virtual address space are recorded among the objects.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the obtaining the first index node of the file represented by the file identifier includes: when it is determined that the file represented by the file identifier is stored in the file storage memory area, obtaining a file represented by the file identifier An index node.
- the method further includes:
- the operating system receives a file read request for requesting to read a file content of the file, wherein the file read request carries a first file in the file read into a memory address space and requested to be read The amount of data of the content, wherein the read-in memory address space is an address space of a first memory area in a working memory area of the user process;
- the operating system obtains a reading from the file storage memory area based on the data amount of the first file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table. Reading the physical address space of the first file content;
- the operating system reads the first file content of the file from the file storage memory area based on the read physical address space;
- the operating system writes the first file content into the first memory area.
- the data amount based on the first file content, the first virtual address space, and the The first virtual real address mapping relationship recorded by the memory page table is obtained by reading the read physical address space of the first file content from the file storage memory area, including:
- the area reads the read physical address space of the first file content, where the first file content offset is obtained from the file read request, or the first file content offset is from Obtained from among the file objects corresponding to the file.
- the tenth possible implementation in the first aspect further includes:
- the operating system receives a file write request requesting to write a file content to the file, wherein the file write request carries a read memory address space and a second file requested to be written into the file The amount of data of the content, wherein the read memory address space is an address space of a second memory area among the working memory areas of the process;
- the operating system obtains a write to the file storage memory area based on the data amount of the second file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table.
- the operating system writes the second file content cached in the second memory area into the third memory area.
- the data quantity based on the second file content, the first virtual address space, and The first virtual real address mapping relationship recorded by the memory page table is obtained by writing a write physical address space of the second file content to the file storage memory area, including:
- the storage of the third memory area The capacity is greater than or equal to the amount of data of the second file content.
- the method further includes: receiving a file close request for requesting to close the file; releasing a first virtual address space allocated for the file; releasing the first virtual address mapping relationship recorded in the memory page table.
- the method further includes: the operating system determining that the file represented by the file identifier is not stored in the file storage memory area, and creating the file in the file storage memory area as the file Allocating a second index node, wherein the second index node records a second file page table or a pointer for pointing to the second file page table, wherein the second file page table is used to point to the file storage a memory area in which the file is stored in the memory area;
- the operating system allocates a second virtual address space to the file
- the operating system records the second virtual real address mapping relationship by using a memory page table
- the second virtual address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where the second physical address space is in the file storage memory area.
- a physical address space storing a memory area of the file, the memory page table including a kernel memory page table and/or a user process memory page table.
- the number of the second file page table has a correspondence with the file type of the file relationship.
- the file storage memory area includes a non-volatile memory area and/or a volatile memory area.
- a second aspect of the present invention provides an apparatus for accessing a file, which may include:
- a receiving unit configured to receive a file open request that carries a file identifier
- An obtaining unit configured to obtain a first index node of the file represented by the file identifier, where the file is stored in a file storage memory area; and the storage unit in the file storage memory area is obtained based on the first index node The first physical address space of the memory area of the file;
- An allocating unit configured to allocate a first virtual address space for the file
- mapping unit configured to record a first virtual real address mapping relationship by using a memory page table
- the first virtual real address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, where the memory page table includes a kernel memory page table and/or a user process memory. Page table.
- the obtaining unit is specifically configured to be based on the first index node, in the aspect that the first index node obtains the first physical address space of the memory area of the file in the file storage memory area a first file page table recorded in the file or a pointer for pointing to the first file page table, to obtain a first physical address space of the memory area in the file storage memory area where the file is stored, where
- the first file page table is a single-level or multi-level file page table.
- the mapping unit is specifically configured to: add, in the memory page table, the first virtual reality An entry of an address mapping relationship, the entry containing the first file page table or a pointer for pointing to the first file page table.
- the total number of the memory page table is Y, the total number of the first file page table If the entry includes the first file page table, the entry is an entry in the Y-X+1-level memory page table in the memory page table, if the entry is Include a pointer for pointing to the first file page table, where the entry is an entry in a YX-level memory page table in the memory page table, the X is a positive integer, and the Y is greater than The positive integer of X.
- the device for accessing the file further includes:
- a recording unit configured to record, in the first index node, a starting address of the first virtual address space and/or the first virtual address space, and/or among file objects corresponding to the file Recording a first virtual address space and/or a starting address of the first virtual address space.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the obtaining unit is specifically configured to: when the file storage memory area is determined to be stored in the file Identifying the file represented by the first index node of the file represented by the file identifier.
- the receiving unit is further configured to receive a file read request for requesting to read a file content of the file, where the file read request carries a space read into a memory address space and requested to be read. a data volume of the first file content in the file, where the read memory address space is an address space of a first memory area in a working memory area of the user process;
- the device for accessing a file further includes: a second mapping unit, configured to map, according to the data amount of the first file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table Obtaining a read physical address space for reading the content of the first file from the file storage memory area;
- a first read/write unit configured to read, according to the read physical address space, a first file content of the file from the file storage memory area; and write the first file content into the first file A memory area.
- the data quantity based on the first file content, the first virtual address space, and the The first virtual real address mapping relationship recorded by the memory page table is obtained by reading a read physical address space of the first file content from the file storage memory area, where the second mapping unit is specifically used to The data amount of the first file content, the first file content offset, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table are obtained from the file storage memory area. Taking the read physical address space of the first file content, where the first file content offset is obtained from the file read request, or the first file content offset is from the Obtained from the file object corresponding to the file.
- the receiving unit is further configured to receive a file write request requesting to write a file content to the file, where the file write request carries a read memory address space and a request write station. a data amount of the second file content in the file, wherein the read memory address space is an address space of a second memory area in the working memory area of the process;
- the device for accessing a file further includes: a third mapping unit, configured to map, according to the data amount of the second file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table Obtaining a write physical address space for writing the content of the second file to the file storage memory area, where the write physical address space is a physical address of a third memory area in the file storage memory area Space
- a second read/write unit configured to write the second file content cached in the second memory area into the third memory area.
- the first virtual real address mapping relationship recorded by the memory page table is obtained by writing a write physical address space of the second file content to the file storage memory area, where the third mapping unit is specifically used. And storing, according to the data amount of the second file content, the second file content offset, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table, to the file storage
- the memory area is written into the write physical address space of the second file content, where the second file content offset is obtained from the file write request, or the second file content offset Obtained from the file object corresponding to the file.
- the storage of the third memory area The capacity is greater than or equal to the amount of data of the second file content.
- the receiving unit is further configured to: receive a file close request for requesting to close the file; the device for accessing the file further includes: a release unit, configured to release a first virtual address space allocated for the file; The first virtual real address mapping relationship recorded in the memory page table.
- the device for accessing a file further includes: a file that is created, the file is created in the file storage memory area, and a second index node is allocated to the file, wherein the second index node records a second a file page table or a pointer for pointing to the second file page table, wherein the second file page table is used to point to a memory area in the file storage memory area where the file is stored;
- the allocating unit is further configured to: allocate a second virtual address space for the file;
- the mapping unit is further configured to: record, by using a memory page table, a second virtual real address mapping relationship; wherein the second virtual real address mapping relationship includes mapping between the second virtual address space and the second physical address space Relationship, wherein the second physical address space is a physical address space of a memory area in which the file is stored in the file storage memory area, and the memory page table includes a kernel memory page table and/or a user process memory page table .
- the fifteenth possible aspect of the second aspect In conjunction with the fourteenth possible implementation of the second aspect, the fifteenth possible aspect of the second aspect In an embodiment, the number of levels of the second file page table and the file type of the file have a corresponding relationship.
- the file storage memory area includes Volatile memory areas and/or volatile memory areas.
- a third aspect of the embodiments of the present invention provides a computing node, which may include:
- At least one bus at least one processor coupled to the bus, and at least one memory coupled to the bus;
- the processor by using the bus, to call a code stored in the memory, to receive a file open request that carries a file identifier, and obtain a first index node of the file represented by the file identifier, where The file is stored in the file storage memory area; based on the first index; the first virtual address space is allocated to the file; the first virtual real address mapping relationship is recorded by using the memory page table; wherein the first virtual real address mapping The relationship includes a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the code is specifically used to obtain, according to the first file page table recorded in the first index node or a pointer for pointing to the first file page table, to obtain a memory area in the file storage memory area where the file is stored.
- a first physical address space wherein the first file page table is used to point to the file storage Storing a memory area of the file in the memory area, where the first physical address space is a physical address space of a memory area in the file storage memory area where the file is stored, where the first file page table is Single or multi-level file page table.
- the processor is configured by using the memory page table to record a first virtual real address mapping relationship
- the bus calls the code stored in the memory to specifically add an entry for recording the first virtual address mapping relationship in the memory page table, where the table entry includes the first file page table or A pointer to the first file page table.
- the total number of the memory page table is Y, the total number of the first file page table If the entry includes the first file page table, the entry is an entry in the Y-X+1-level memory page table in the memory page table, if the entry is Include a pointer for pointing to the first file page table, where the entry is an entry in a YX-level memory page table in the memory page table, the X is a positive integer, and the Y is greater than The positive integer of X.
- the processor calls the code stored in the memory through the bus to further record, in the first index node, the first virtual address space and/or the first virtual
- the start address of the address space, and/or, the first virtual address space and/or the start address of the first virtual address space are recorded among file objects corresponding to the file.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or the user process is virtual.
- the intended address space is in a kernel virtual address space or the user process is virtual.
- the processor calls the code stored in the memory through the bus to further receive a file read request for requesting to read a file content of the file, where the file read request Carrying the data amount of the first file content in the file read into the memory address space and requesting to read, wherein the read memory address space is an address space of the first memory area in the working memory area of the user process Obtaining from the file according to the data amount of the first file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table Reading a physical address space of the first file content; and reading, according to the read physical address space, the first file content of the file from the file storage memory area; The first file content is written into the first memory area.
- the code stored in the memory is specifically used,
- the storage memory area reads the read physical address space of the first file content, where the first file content offset is obtained from the file read request, or the first file content is offset
- the amount is obtained from the file object corresponding to the file.
- the processor by using the bus, to call the code stored in the memory to further receive the request a file write request for writing a file content to the file, wherein the file write request carries a read memory address space and a data amount of a second file content requested to be written into the file, wherein The read memory address space is an address space of a second memory area in the working memory area of the process;
- the storage of the third memory area The capacity is greater than or equal to the amount of data of the second file content.
- the processor by using the bus, to call the code stored in the memory to further receive a file close request for requesting to close the file; Freeing a first virtual address space allocated for the file; releasing the first virtual real address mapping relationship recorded in the memory page table.
- the processor by using the bus, to call the code stored in the memory to further use the
- the file is created in the file storage memory area, and the second index node is allocated to the file, wherein the second index node records a second file page table or a pointer for pointing to the second file page table.
- the second file page table is used to point to a memory area in the file storage memory area where the file is stored
- the second virtual address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where the second physical address space is in the file storage memory area.
- a physical address space storing a memory area of the file, the memory page table including a kernel memory page table and/or a user process memory page table.
- the step of the second file page table has a correspondence with the file type of the file relationship.
- the file storage memory area includes Volatile memory areas and/or volatile memory areas.
- a fourth aspect of the embodiments of the present invention provides a method for accessing a file, including:
- the first virtual real address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, where the memory page table includes a kernel memory page table and/or a user process memory. Page table.
- the obtaining, by the first index node, a first physical address space of a memory area in which the file is stored in the file storage memory area including: based on a first file page table recorded in the first index node or a pointer for pointing to the first file page table, obtaining a first physical address space of the memory area in the file storage memory area where the file is stored, wherein the first file page table is used to point to the file storage A memory area of the file is stored in the memory area, and the first physical address space is a single-level or multi-level file page table.
- the using the memory page table to record the first virtual real address mapping relationship includes: adding the memory page table And an entry for recording the first virtual real address mapping relationship, the entry includes the first file page table or a pointer for pointing to the first file page table.
- the total number of the memory page table is Y, the total number of the first file page table If the entry includes the first file page table, the entry is an entry in the Y-X+1-level memory page table in the memory page table, if the entry is Include a pointer for pointing to the first file page table, where the entry is an entry in a YX-level memory page table in the memory page table, the X is a positive integer, and the Y is greater than The positive integer of X.
- the method further includes:
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the obtaining the first index node of the file represented by the file identifier includes: when it is determined that the file represented by the file identifier is stored in the file storage memory area, obtaining a file represented by the file identifier An index node.
- the method further includes:
- the read-in memory address space is an address space of a first memory area in a working memory area of the user process
- the ninth possible implementation of the fourth aspect In the manner, the first virtual address mapping relationship based on the data amount of the first file content, the first virtual address space, and the memory page table record is obtained from the file storage memory area.
- the physical address space for reading the content of the first file includes:
- the area reads the read physical address space of the first file content, where the first file content offset is obtained from the file read request, or the first file content offset is from Obtained from among the file objects corresponding to the file.
- the file write request carries a read memory address space and a data amount of a second file content requested to be written into the file
- the read memory address space is an address space of a second memory area in the working memory area of the process
- the data quantity based on the second file content, the first virtual address space, and The first virtual real address mapping relationship recorded by the memory page table is obtained by writing a write physical address space of the second file content to the file storage memory area, including: Obtaining a storage memory to the file based on the data amount of the second file content, the second file content offset, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table Writing a physical address space of the second file content, wherein the second file content offset is obtained from the file write request, or the second file content offset is from Obtained from among the file objects corresponding to the file.
- the storage of the third memory area The capacity is greater than or equal to the amount of data of the second file content.
- the method further includes: receiving a file close request for requesting to close the file; releasing a first virtual address space allocated for the file; releasing the first virtual address mapping relationship recorded in the memory page table.
- the file that is created the file is created in the file storage memory area, Document allocation a second index node, wherein the second index page records a second file page table or a pointer for pointing to the second file page table, wherein the second file page table is used to point to the file storage memory area a memory area in which the file is stored;
- the second virtual address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where the second physical address space is in the file storage memory area.
- a physical address space storing a memory area of the file, the memory page table including a kernel memory page table and/or a user process memory page table.
- the step of the second file page table has a correspondence with the file type of the file relationship.
- the file storage memory area includes Volatile memory areas and/or volatile memory areas.
- a fifth aspect of the present invention provides a computer storage medium, characterized in that
- the computer storage medium stores a program that, when executed, includes the steps of any of the methods as provided by the above method embodiments.
- the operating system after receiving the file open request carrying the file identifier, the operating system obtains the first index node of the file represented by the file identifier, and is based on the first physical address space;
- the above file allocates the first virtual address space; a virtual real address mapping relationship; wherein the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, and the memory page table includes a kernel memory page to record the first virtual real address mapping
- the relationship may be considered to be a certain degree to the first physical address space of the memory area in which the file is stored in the file storage memory area, and is packaged into a physical address space corresponding to a certain memory area in the working memory area of the process, which is beneficial to
- the kernel or the user process accesses the file in the file storage memory area in a manner similar to the working memory area of the access process, which is convenient for the kernel or the user process to access the file system of the resident kernel file with the access performance of the ordinary memory data.
- FIG. 1 is a schematic flowchart of a method for accessing a file according to an embodiment of the present invention
- FIG. 2 is a schematic flowchart of another method for accessing a file according to an embodiment of the present invention
- FIG. 2b is a schematic diagram of a memory of a computing node according to an embodiment of the present invention
- FIG. 2 is a schematic diagram of another memory of a computing node according to an embodiment of the present disclosure
- FIG. 2 is a schematic diagram of another file storage memory area according to an embodiment of the present invention.
- FIG. 2 is a schematic diagram of a relationship between a file page table and a memory page according to an embodiment of the present invention
- FIG. 3 is a schematic flowchart of another method for accessing a file according to an embodiment of the present invention
- FIG. 5 is a schematic flowchart of another method for accessing a file according to an embodiment of the present invention
- FIG. 6 is a schematic diagram of another method for accessing a file according to an embodiment of the present invention
- FIG. 7 is a schematic flowchart diagram of another method for accessing a file according to an embodiment of the present invention
- FIG. 8 is a schematic flowchart of another method for accessing a file according to an embodiment of the present invention
- FIG. 9 is a schematic diagram of an apparatus for accessing a file according to an embodiment of the present invention
- 9-b is a schematic diagram of another apparatus for accessing a file according to an embodiment of the present invention.
- 9-c is a schematic diagram of another apparatus for accessing a file according to an embodiment of the present invention.
- FIG. 9-d is a schematic diagram of another apparatus for accessing a file according to an embodiment of the present invention.
- 9-e is a schematic diagram of another apparatus for accessing a file according to an embodiment of the present invention.
- FIG. 10 is a schematic diagram of a computing node according to an embodiment of the present invention.
- FIG. 11 is a schematic diagram of another computing node according to an embodiment of the present invention. detailed description
- the embodiment of the invention provides a method for accessing a file and related devices, which are suitable for file access in a resident system of a file system.
- An embodiment of the method for accessing a file wherein the method for accessing a file is applied to a computing node, wherein the computing node may include a memory, and the memory includes: a file storage memory area and a process working memory area, The working memory area of the process stores a kernel memory page table. The working memory area of the above process runs an operating system.
- the method for accessing the file may include: the operating system receives a file open request carrying the file identifier; and the operating system obtains the file identifier.
- Document a first index node, wherein the file is stored in a file storage memory area; the operating system is based on the upper physical address space; the operating system allocates a first virtual address space for the file; and the operating system records the first virtual address by using the memory page table
- the first virtual address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, where, for example, the process working memory area may include a kernel process working memory.
- the area and user process working memory area wherein the kernel memory page table can be stored in the kernel process working memory area, and the user process memory page table can be stored in the working process memory area of the user process.
- the above kernel process runs an operating system in the working memory area.
- FIG. 1 is a schematic flowchart of a method for accessing a file according to an embodiment of the present invention.
- a method for accessing a file provided by an embodiment of the present invention may include the following content:
- the operating system receives a file open request that carries a file identifier.
- the file open request for receiving the file identifier may include: receiving a file open request for carrying the file identifier from the user process.
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the operating system obtains a first index node of the file represented by the file identifier, and is based on the upper physical address space.
- the above file is stored in the file storage memory area.
- the file of the first cable that obtains the file indicated by the file identifier is obtained, and the first index node of the file represented by the file identifier is obtained.
- the file represented by the file identifier is stored in the file storage memory area, and in this scenario, the step of determining whether the file indicated by the file identifier is stored in the file storage memory area may be omitted.
- the memory may include: a process working memory area (where the process working memory area may include a user process working memory area and a kernel process working memory area) and a file storage memory area.
- the process working memory area refers to a physical memory area for storing data structures and variables included in the working environment when the process is running.
- the data structure and the variable may include at least one of the following information: a heap, a stack, a memory mapped area, a variable of the program corresponding to the process, a character, an array, and the like when the process runs.
- the user process working memory area may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area may refer to a physical memory area for storing data structures and variables included in the working environment of the kernel process runtime.
- the foregoing data structure and variables stored in the working memory area of the kernel process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array of the kernel process. data.
- the file storage memory area may be a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system may be stored. It can further store information such as superblocks (if any) of the file system.
- the file storage memory area may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area includes a non-volatile storage medium and/or Loss storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process The memory area (such as the kernel process working memory area, the user process working memory area) and the file storage memory area do not overlap each other.
- the index node of the file may include information that can obtain a physical address space of a memory area in the file storage memory area where the file is stored.
- a first file page table FPT, File Page Table
- a pointer for pointing to a first file page table may be recorded in the first index node of the above file, and the first file page table is a single-level or multi-level file page.
- the first physical address space is a physical address space of a memory area in which the file is stored in the file storage memory area.
- the first index node may also be a space or a starting address of the first physical address space, and the like.
- the first index node of the file may further include information such as metadata of the file.
- the operating system allocates a first virtual address space to the file.
- the file may be allocated a first virtual address space of a preset size (for example, the size of the first virtual address space may be less than or equal to the maximum virtual address space of the system divided by the maximum number of files simultaneously supported by the system. Number).
- the first virtual address space corresponding to the file type may be allocated to the file.
- the virtual address space corresponding to the directory file and the virtual address space corresponding to the data file may not be equal.
- the size of the virtual address space corresponding to the directory file may be smaller than the size of the virtual address space corresponding to the data file, for example, the virtual address corresponding to the directory file.
- the size of the space is 1MB, 2MB, 10MB or 30MB.
- the virtual address space corresponding to the data file is 100MB, 500MB, 1GB, 10GB, 100GB or 2TB.
- the operating system records the first virtual real address mapping relationship by using a memory page table.
- the first virtual real address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the operating system After receiving the file open request carrying the file identifier, the operating system obtains the first index node of the file represented by the file identifier, and obtains the file storage memory area to store the file according to the first index node.
- the first virtual address space is recorded by the memory page table; wherein the first virtual address mapping relationship is the first virtual address space and the first physical address space, and the kernel memory page table is utilized.
- the above file access scheme is suitable for high-performance file access in the file system resident memory scenario.
- the virtual address space is allocated for the file when the file is requested to be opened, it is advantageous to reduce the invalid occupation and address conflict possibility of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- a file open request for carrying a file identifier from a user process if a file open request for carrying a file identifier from a user process is received, a file object corresponding to the file and the user process may be created, and the first virtual reality may be recorded in the memory page table. After the address mapping relationship, the file description of the above file is fed back to the user process.
- the recording the first virtual real address mapping relationship by using the memory page table may include: adding an entry for recording the first virtual real address mapping relationship in the memory page table (may be one or more An entry, wherein the entry includes the first file page table or a pointer for pointing to the first file page table.
- the total number of levels of the memory page table is Y
- the total number of levels of the first file page table is X.
- the table entry may be in the memory page table.
- the entry in the Y-X+1-level memory page table if the table entry includes a pointer for pointing to the first file page table, the table entry may be the YX-level memory page in the foregoing memory page table.
- the entry (possibly one or more entries) added to the memory page table for recording the first virtual address mapping relationship may also be any level in the memory page table.
- the recording the first virtual real address mapping relationship by using the memory page table may include: adding an entry for recording the first virtual real address mapping relationship in the memory page table (may be one or more (Table entry), where the entry includes the first physical address space or the entry may include a start address and/or an end address of the first physical address space, for example, the entry may be among the lowest level of the memory page table
- the entry of the table may be an entry in any level of the memory page table.
- the first virtual address space, the start address of the first virtual address space, and the end address of the first virtual address space may be further recorded in the first index node. At least one, and/or, at least one of the first virtual address space, the start address of the first virtual address space, and the end address of the first virtual address space may be recorded among the file objects corresponding to the file One.
- the first virtual address space is a continuous or non-contiguous virtual address space. In some embodiments of the present invention, the first virtual address space is in a kernel virtual address space or the first virtual address space is in a user process virtual address space.
- the file after the file is opened, the file can be read/written and the like.
- the method of accessing a file may further include: an operating system receiving a file read request for requesting to read a file content of the file, wherein the file read request carries a read-in memory address space and requesting to read The data amount of the first file content in the above file (in addition, the file read request may further carry the file descriptor of the file), wherein the read-in memory address space is the first among the working process memory areas of the user process.
- the first virtual address mapping relationship based on the data amount of the first file content, the first virtual address space, and the memory page table record is obtained from the file storage memory area.
- the reading the physical address space of the content of the first file may include: a data amount based on the content of the first file, a first file content offset, the first virtual address space, and
- the first virtual real address mapping relationship recorded by the memory page table is obtained by reading a read physical address space of the first file content from the file storage memory area, wherein the first file content offset is read from the file Obtained in the request, or the first file content offset is obtained from the file object corresponding to the file.
- the default file content offset may be used as a first file content offset
- a start address of the first virtual address space to obtain a starting read virtual address for reading the content of the first file; and using the initial read virtual address and the first virtual real address mapping Relationship, obtaining a starting physical address for reading the content of the first file from the file storage memory area; and reading the physical address of the first physical file and the content of the first file, and reading from the file storage memory area
- the physical address space of the first file content is read.
- the default file content offset may be As a first file content offset
- a start read virtual address for reading the first file content is obtained; and based on the initial read virtual address and the first file content
- the amount of data is obtained by reading the read virtual address space of the first file content; using the read virtual address space and the first virtual real address mapping relationship to obtain reading of the first file content from the file storage memory area Physical address space.
- the method for accessing a file may further include: receiving a file write request requesting to write a file content to the file, wherein the file write request carries a read memory address space and requests to write the file
- the data amount of the second file content (in addition, the file write request may further carry the file descriptor of the file), wherein the read memory address space is the second memory area in the process working memory area An address space; based on the data amount of the content of the second file, the first virtual address space, and the first virtual address mapping relationship recorded by the memory page table, obtaining the content of writing the second file to the file storage memory area Write the physical address space, wherein the write physical address space is a physical address space of a third memory area in the file storage memory area; and writing the second file content cached in the second memory area to Among the above third memory areas.
- the foregoing is written into the file storage memory area.
- the writing of the physical address space of the second file content may include: the first virtual address based on the data amount of the second file content, the second file content offset, the first virtual address space, and the memory page table record Mapping the relationship, obtaining a write physical address space for writing the content of the second file to the file storage memory area, wherein the second file content offset is obtained from the file write request, or the second file The content offset is obtained from the file object corresponding to the above file.
- the default file content offset may be used as a second file content offset
- a start address of the first virtual address space to obtain a start write virtual address for writing the content of the second file to the file; using the above-mentioned initial write virtual address and the first
- the virtual real address mapping relationship obtains a starting physical address for writing the content of the second file to the file from the file storage memory area; and based on the data amount of the initial writing physical address and the second file content, Writing a physical address space of the content of the second file to the above file of the file storage memory area.
- the default file content offset may be As the second file content offset
- the virtual address is written to the beginning of the second file content in the file; the virtual address and the second file are written based on the start
- the amount of data of the content is obtained by writing the write virtual address space to the content of the second file in the file of the file storage memory area; and using the write virtual address space and the first virtual physical write address space.
- the storage capacity of the third memory area may be greater than or equal to the data volume of the second file content.
- the memory area corresponding to the third memory area and the first physical address space has an intersection or no intersection. It can be understood that, in a normal case, if the memory area corresponding to the third memory area and the first physical address space have an intersection, it may indicate that the original file is replaced by the content of the second file.
- Some or all of the contents of the file (if the intersection of the third memory area and the memory area corresponding to the first physical address space is smaller than the third memory area, indicating that a new memory area is allocated for the second file content, that is, storing the above file The memory area has changed, and the memory area for storing the above files has been expanded.) If the memory area corresponding to the third memory area and the first physical address space does not intersect, it may indicate that the second file content is added in the file, and the third memory area allocates a new memory area for the second file content, that is, The memory area in which the above file is stored has changed, and the memory area in which the above file is stored is expanded.
- the new first file page table is such that the updated first file page table points to the memory area in the file storage memory area where the above file is currently stored.
- the first virtual address mapping relationship recorded in the foregoing memory page table may be updated to a third virtual real address mapping relationship, where the third virtual real address mapping relationship includes the first virtual address space and the third physical address.
- the mapping relationship between the spaces, the third physical address space is a physical address space of a memory area in the file storage memory area where the file is currently stored.
- the memory page table records a pointer to the first file page table (for example, the starting physical address of the first file page table recorded in the memory page table)
- the updated first file page table starts If the physical address has not changed, the pointer to the first file page table may not be modified in the memory page table.
- the first file page table is updated without modifying the memory page table, and the virtual real address mapping relationship can be reconstructed, which greatly reduces the mapping operation.
- the method for accessing a file may further include: the operating system receiving a file close request for requesting to close the file; releasing the first virtual address space allocated for the file; releasing the record in the memory page table The first virtual address mapping relationship described above. Further, if the file object corresponding to the file is created, the file object corresponding to the file may be further released.
- the file after receiving the file open request carrying the file identifier, when it is determined that the file indicated by the file identifier is not stored in the file storage memory area, the file is created in the file storage memory area. , assign a second index node to the above file.
- the second index page may record a second file page table or a pointer for pointing to the second file page table (the pointer for pointing to the second file page table may be the starting physical address of the second file page table) ;), the second article above Allocating a second virtual address space; using a memory page table to record a second virtual address mapping relationship; wherein, the second virtual real address mapping relationship may include a mapping relationship between the second virtual address space and the second physical address space, where The second physical address space is a physical address space of the memory area in which the file is stored in the file storage memory area, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the number of the second file page table has a corresponding relationship with the file type of the file, where the file type of the file is determined by, for example, a file type flag of the file carried in the file open request.
- the file type of the above file can also be determined by other means.
- the file after receiving the file open request carrying the file identifier, when it is determined that the file indicated by the file identifier is not stored in the file storage memory area, the file is created in the file storage memory area. Assigning a third index node to the above file, at this time, the file page table of the file or the empty file page table of the file may not be created first (where, if the empty file page table of the file is created, the third index node may be The empty file page table or the pointer for pointing to the empty file page table is included.
- the memory area for storing the file may be expanded (for example, from 10 MB to 1000 MB).
- the file page table of the above file is updated so that the updated file page table points to the memory area in which the above file is stored after the expansion.
- the file page table is similar or identical to the data structure of the memory page table.
- the execution body of the foregoing operation may be an operating system (specifically, a kernel file system in an operating system).
- the memory page table includes a kernel memory page table and/or a user process memory page table. Because the kernel memory page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the file storage memory area is stored to some extent.
- the first physical address space of the memory area storing the file is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is convenient for the kernel or the user process to access the file in a manner similar to the working area of the access process.
- Storing files in the memory area which is beneficial to the kernel or user process to access the file system of the resident kernel file by approximating the access performance of ordinary memory data, which is beneficial to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario.
- the virtual address space is allocated for the file when the file is requested to be opened, this is advantageous for reducing the invalid occupation and address conflict possibility of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- the memory management unit (MMU, Memory Management Unit) can transparently convert the virtual address and physical address of the file, which helps to speed up file access and even achieve zero overhead.
- a file page table with a data structure similar to or the same as the memory page table is used to point to a memory page in which the file content is stored in the file storage memory area
- the data structure of the file page table and the memory page table are similar or identical, it is advantageous to implement Zero conversion of the page table data structure, and when the memory page storing the file content changes, it may not be necessary to perform the operation of reconstructing the mapping relationship between the file physical address space and the virtual address space for the file page table, and by updating the file page table,
- the pointer to the updated file page table is inserted into the table entry of the file page table, thereby completing the mapping of the physical address of the file and the virtual address, which is beneficial for reconstructing the physical address of the file within a constant time independent of the file size. Mapping to virtual addresses.
- the file system in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, and can not only be good. Protects the file and does not require an additional write protection mechanism to facilitate the system.
- the size of the file is only affected by the system virtual address.
- the size of the space, as well as the number of files that are supported by the operating system at the same time, are not limited by the file system itself, so the file size is not limited by the file system itself.
- the file system adopts a method similar to the memory management, and the storage medium is accessed through the virtual address, and the MMU can be used to convert the virtual address and the physical address, and the kernel can be changed relatively less, which is convenient for the file system. Migrate to an existing operating system.
- the following is an example of a specific application scenario.
- FIG. 2-a is a schematic flowchart diagram of another method for accessing a file according to another embodiment of the present invention.
- Another method for accessing a file provided by another embodiment of the present invention may include the following:
- the operating system receives a file open request carrying a file identifier from a user process (hereinafter referred to as user process A).
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the operating system creates a file object corresponding to the file represented by the file identifier (hereinafter referred to as file F1), and allocates a file descriptor for the file F1. Among them, the file object of the file F1 can be found based on the file descriptor of the file F1.
- the operating system determines whether a file F1 is stored in the file storage memory area.
- step 204 is performed.
- the operating system can feed back the file open failure instruction to user process A.
- the operating system obtains the first index node of the file F1, wherein the file is stored in the file storage memory area, and the first index node of the file F1 is also stored in the file storage memory area.
- Figure 2-b shows a memory diagram of a compute node, a compute node.
- the memory may include a user process working memory area S1, a kernel process working memory area S2, and a file storage memory area S3.
- the user process working memory area S1 may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area S2 can be a physical memory area for storing data structures and variables included in the working environment of the kernel process.
- the foregoing data structure and variables stored in the working memory area of the kernel process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array of the kernel process. data.
- the file storage memory area S3 may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area S3 includes a non-volatile storage medium and/or Volatile storage medium).
- the process working memory area (such as the kernel process working memory area S2 and the user process working memory area S1) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process working memory area (such as the kernel process working memory area S2, the user process working memory area S 1 ) and the file storage memory area do not overlap each other.
- the user process work memory area S1 and the kernel process work memory area S2 may be located in the DRAM, and the file storage memory area S3 may be located in the NVM.
- the file storage memory area S3 may refer to a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system can be stored. , can further store the super block (if any) of the file system and so on.
- the file storage memory area S3 may include a super block, an inode area for storing a file index node, and a file data area for storing files.
- a pointer for pointing to the first file page table may be recorded in the first index node of the file F1 (the pointer for pointing to the first file page table may include the start of the first file page table)
- the first file page table is used to point to a memory area in the file storage memory area S3 where the file F1 is stored, and the first physical address space is a physics of the memory area in which the file is stored in the file storage memory area. Address space.
- the first file page table described above is a single-level or multi-level file page table.
- a memory page for storing a single file is organized by a file page table having a data structure similar or equivalent to a memory page table, and the file page table may be a one-level or multi-level file page table.
- Each entry in each level file page table in the non-lowest level file page table records the starting physical address of a file page table at the next level.
- Each entry of the lowest level file page table stores the starting physical address of a memory page of the file.
- Figure 2-e shows that the first file page table is a three-level file page table, which is a PUD, PMD, and PTE level, wherein each entry in the PUD records a PMD.
- the starting physical address, and each entry of each PMD records the starting physical address of a PTE, and each entry of the PTE records the starting physics of a memory page (where the memory page stores the file content of the file F1) address. Understandably, not every file needs to use a three-level file page table. Even if a three-level page table is used, it does not necessarily have a fixed format. For example, not every file needs to use 1024 PTEs.
- the size of the file changes dynamically to adjust the file page table organization. For example, a pointer to a first level file page table PUD of a three-level file page table (e.g., a starting physical address of the PUD;) may be recorded in the first index node.
- Each file corresponds to an inode.
- the first index node includes a pointer (Pointer) for pointing to the file page table, and the pointer specifically stores the highest level file page table (PUD) of the file F1. The starting physical address of the physical memory page.
- Pointer pointer
- PID file page table
- the first index node of the file F1 may further include the metadata of the file F1, and the metadata of the file F1 includes the attribute information of the file F1 (such as file size, file type, file modification time, file creation time, etc.)
- the file page table of each file is stored in the file data area of the file storage memory area. Due to the byte-addressable nature of the file storage memory area and the linked list-based organization of the file page table, the file page table does not need to be placed in a fixed area. Just store it as a normal file in the file data area.
- the operating system obtains, according to the first index node, a first physical address space of a memory area in which the file F1 is stored in the file storage memory area. Since the first index node includes a pointer for pointing to the first file page table of the file F1, a pointer for pointing to the first file page table of the file F1 can be obtained based on the first index node, and is obtained for pointing to the file.
- the pointer of the first file page table of F1 can obtain the first file page table of the file F1, and further can obtain the first memory area of the file F1 stored in the file storage memory area based on the first file page table of the file F1. Physical address space.
- the operating system allocates a first virtual address space to the file.
- the file may be allocated a first virtual address space of a preset size (for example, the size of the first virtual address space may be less than or equal to the maximum virtual address space of the system divided by the maximum number of files simultaneously supported by the system. Number).
- the first virtual address space corresponding to the file type may be allocated to the file.
- the virtual address space corresponding to the directory file and the virtual address space corresponding to the data file may not be equal.
- the size of the virtual address space corresponding to the directory file may be smaller than the size of the virtual address space corresponding to the data file, for example, the virtual address corresponding to the directory file.
- the size of the space is 1MB, 2MB, 10MB or 30MB.
- the virtual address space corresponding to the data file is 100MB, 500MB, 1GB, 10GB, 100GB or 2TB.
- the operating system records the first virtual address mapping relationship by using a memory page table.
- the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the recording the first virtual real address mapping relationship by using the memory page table may include: adding an entry for recording the first virtual real address mapping relationship in the memory page table (may be one or a plurality of entries), wherein the table entry includes a pointer for pointing to the first file page table (the pointer for pointing to the first file page table may include a starting physical address of the first file page table). For example, the total number of stages of the memory page table is Y, and the total number of levels of the first file page table is X. If the table item includes the first file page table, the table entry may be the foregoing memory page table.
- the entry in the Y-X+1-level memory page table in the table if the table entry includes a pointer for pointing to the first file page table, the table entry may be the YX level in the foregoing memory page table
- an entry (possibly one or more entries) added to the memory page table for recording the first virtual address mapping relationship may also be any level of the memory page table in the memory page table. The entry in the table.
- the first virtual address space, the start address of the first virtual address space, and the end address of the first virtual address space may be further recorded in the first index node. At least one, and/or, at least one of the first virtual address space, the start address of the first virtual address space, and the end address of the first virtual address space may be recorded among the file objects corresponding to the file One.
- the first virtual address space is a continuous or non-contiguous virtual address space. In some embodiments of the present invention, the first virtual address space is in a kernel virtual address space or the first virtual address space is in a user process virtual address space.
- the operating system feeds back to the user process A a file description symbol of the file F1.
- User process A can initiate a read and write operation on file F1 based on the file description symbol of file F1. It can be seen that, in the foregoing technical solution of the embodiment, after receiving the file open request carrying the file identifier; determining whether the file represented by the file identifier is stored in the file storage memory area; if the file storage memory area is And storing the foregoing file, obtaining a first index node of the file, and obtaining, according to the first index node, a first physical address space of a memory area in which the file is stored in the file storage memory area; a virtual address space; the first virtual address mapping relationship is recorded by the memory page table; wherein the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, wherein the memory is
- the page table includes a kernel memory page table and/or a user process memory page table.
- the kernel virtual page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the first physical address space of the memory area storing the file in the file storage memory area is to some extent.
- the physical address space corresponding to a certain memory area in the working memory area of the process which is beneficial for the kernel or the user process to implement the kernel or the user process to access the file system of the resident kernel file with the access performance of the ordinary memory data. , is conducive to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario. And because it is in the request When the file is opened, the virtual address space is allocated to the file, which is beneficial to reduce the invalid occupation and address conflict of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- the MMU transparently completes the conversion between the virtual address and the physical address of the file, which facilitates faster file access and even zero overhead.
- a file page table with a data structure similar to or the same as the memory page table is used to point to a memory page in which the file content is stored in the file storage memory area
- the data structure of the file page table and the memory page table are similar or identical, it is advantageous to implement Zero conversion of the page table data structure, and when the memory page storing the file content changes, it may not be necessary to perform the operation of reconstructing the mapping relationship between the file physical address space and the virtual address space for the file page table, and by updating the file page table,
- the pointer to the updated file page table is inserted into the table entry of the file page table, thereby completing the mapping of the physical address of the file and the virtual address, which is beneficial for reconstructing the physical address of the file within a constant time independent of the file size. Mapping to virtual addresses.
- the file system in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, and can not only be good. Protects the file and does not require an additional write protection mechanism to facilitate the system.
- the size of the file is only affected by the size of the system virtual address space and the number of files simultaneously opened by the operating system, which are not limitations of the file system itself, and thus the file size. It is not subject to the design of the file system itself.
- FIG. 3 is a schematic flowchart diagram of another method for accessing a file according to another embodiment of the present invention.
- Another method for accessing a file provided by another embodiment of the present invention may include The following content:
- the operating system receives a file open request carrying a file identifier from a user process (hereinafter referred to as user process A).
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the operating system creates a file represented by the file identifier (the file is hereinafter referred to as a file)
- file descriptor is assigned to file F1.
- the file object of the file F1 can be found based on the file descriptor of the file F1.
- the operating system determines whether the file F1 is stored in the file storage memory area.
- step 304 If yes, go to step 304.
- the operating system obtains the first index node of the file F1, wherein the file is stored in the file storage memory area, and the first index node of the file F1 is also stored in the file storage memory area.
- FIG. 2-b exemplifies a memory diagram of a computing node.
- the memory of the computing node may include a user process working memory area S1, a kernel process working memory area S2, and a file storage memory area S3. Wait.
- the user process working memory area S1 may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area S2 may refer to a physical memory area for storing contents such as data structures and variables included in the working environment of the kernel process.
- the above data structures and variables stored in the working memory area may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array, etc. of the kernel process.
- the file storage memory area S3 may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area S3 includes a non-volatile storage medium and/or Volatile storage medium).
- the process working memory area (such as the kernel process working memory area S2 and the user process working memory area S1) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process working memory area (such as the kernel process working memory area S2, the user process working memory area S 1 ) and the file storage memory area do not overlap each other.
- the user process work memory area S1 and the kernel process work memory area S2 may be located in the DRAM, and the file storage memory area S3 may be located in the NVM.
- the file storage memory area S3 may refer to a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system can be stored. , can further store the super block (if any) of the file system and so on.
- the file storage memory area S3 may include a super block, an inode area for storing a file index node, and a file data area for storing files.
- the super block can store a pointer for pointing to the index node.
- the super block can store a pointer for pointing to all index nodes, and can also store a pointer for an index node pointing to the root file.
- a pointer for pointing to the first file page table may be recorded in the first index node of the file F1 (the pointer for pointing to the first file page table may include the start of the first file page table) a physical address), wherein the first file page table is used to point to a memory area in the file storage memory area S3 where the file F1 is stored, and the first physical address space is a physical area of the memory area in which the file is stored in the file storage memory area. Address space.
- the first file page table described above is a single-level or multi-level file page table.
- a memory page for storing a single file is organized by a file page table whose data structure is similar or equivalent to a memory page table, and the file page table may be a one-level or multi-level file page table.
- Each entry of each level file page table in the non-lowest level file page table records the starting physical address of a file page table of the next level.
- each entry of the lowest level file page table stores the start of a memory page of the file. Physical address.
- Figure 2-e shows that the first file page table is a three-level file page table, which is a PUD, PMD, and PTE level, wherein each entry in the PUD records a PMD.
- the starting physical address, and each entry of each PMD records the starting physical address of a PTE, and each entry of the PTE records the starting physics of a memory page (where the memory page stores the file content of the file F1) address. Understandably, not every file needs to use a three-level file page table. Even if a three-level page table is used, it does not necessarily have a fixed format. For example, not every file needs to use 1024 PTEs.
- the size of the file changes dynamically to adjust the file page table organization. For example, a pointer to a first level file page table PUD of a three-level file page table (such as a starting physical address of a PUD;) may be recorded in the first index node.
- Each file corresponds to an inode.
- the first index node includes a pointer (Pointer) for pointing to the file page table, and the pointer specifically stores the highest level file page table (PUD) of the file F1. The starting physical address of the physical memory page.
- Pointer pointer
- PID file page table
- the first index node of the file F1 may further include the metadata of the file F1, and the metadata of the file F1 includes the attribute information of the file F1 (such as file size, file type, file modification time, file creation time, etc.)
- the file page table of each file is stored in the file data area of the file storage memory area. Due to the byte-addressable nature of the file storage memory area and the linked list-based organization of the file page table, the file page table does not need to be placed in a fixed area. Just store it as a normal file in the file data area.
- the operating system obtains, according to the first index node, a first physical address space of a memory area in which the file F1 is stored in the file storage memory area.
- the first index node includes a pointer for pointing to the first file page table of the file F1
- a pointer for pointing to the first file page table of the file F1 can be obtained based on the first index node, and is obtained for pointing to the file.
- the pointer of the first file page table of F1 can obtain the first file page table of the file F1, and further can obtain the first memory area of the file F1 stored in the file storage memory area based on the first file page table of the file F1. Physical address space.
- the operating system allocates a first virtual address space to the file.
- a first virtual address of a preset size may be allocated to the file.
- Space for example, the size of the first virtual address space may be less than or equal to the maximum virtual address space of the system divided by the maximum number of files that the system supports simultaneously opening.
- the first virtual address space corresponding to the file type may be allocated to the file.
- the virtual address space corresponding to the directory file and the virtual address space corresponding to the data file may not be equal.
- the size of the virtual address space corresponding to the directory file may be smaller than the size of the virtual address space corresponding to the data file, for example, the virtual address corresponding to the directory file.
- the size of the space is 1MB, 2MB, 10MB or 30MB.
- the virtual address space corresponding to the data file is 100MB, 500MB, 1GB, 10GB, 100GB or 2TB.
- the operating system records the first virtual address mapping relationship by using the memory page table, and the process proceeds to step 311.
- the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the recording the first virtual real address mapping relationship by using the memory page table may include: adding an entry for recording the first virtual real address mapping relationship in the memory page table (may be one or a plurality of entries), wherein the table entry includes a pointer for pointing to the first file page table (the pointer for pointing to the first file page table may include a starting physical address of the first file page table). For example, the total number of stages of the memory page table is Y, and the total number of levels of the first file page table is X. If the table item includes the first file page table, the table entry may be the foregoing memory page table.
- the entry in the Y-X+1-level memory page table in the table if the table entry includes a pointer for pointing to the first file page table, the table entry may be the YX level in the foregoing memory page table An entry in the memory page table, wherein the X is a positive integer, and the Y is a positive integer greater than the X.
- the entry (possibly one or more entries) added to the memory page table for recording the first virtual address mapping relationship may also be any level in the memory page table.
- the first virtual address space, the start address of the first virtual address space, and the end address of the first virtual address space may be further recorded in the first index node. At least one, and/or, the first virtual address space, the start address of the first virtual address space, and the first virtual may be recorded in a file object corresponding to the file At least one of the end addresses of the address space.
- the first virtual address space is a continuous or non-contiguous virtual address space. In some embodiments of the present invention, the first virtual address space is in a kernel virtual address space or the first virtual address space is in a user process virtual address space.
- the operating system creates a file F1 in the file storage memory area, and allocates a second index node to the created file F1, wherein the second index node of the file F1 is also stored in the file storage memory area.
- a pointer for pointing to the second file page table may be recorded in the second index node of the file F1, wherein the second file page table is used to point to the file F1 stored in the file storage memory area.
- the second physical address space of the memory area, the second file page table is a single-level or multi-level file page table.
- a memory page for storing a single file is organized by a file page table having a data structure similar to or equivalent to a memory page table, and the second file page table may be a one-level or multi-level file page table.
- Each entry in the non-minimum level file page table records the starting physical address of a file page table at the next level.
- Each entry of the lowest level file page table stores the starting physical address of a memory page of the file.
- Each file corresponds to an inode.
- the second index node includes a pointer (Pointer) for pointing to the file page table, and the pointer specifically stores the physical memory page of the highest level file page table of the file F1. The starting physical address.
- Pointer pointer
- the second index node of the file F1 may further include the metadata of the file F1, and the metadata of the file F1 includes the attribute information of the file F1 (such as file size, file type, file modification time, file creation time, etc.)
- the file page table of each file is stored in the file data area of the file storage memory area. Due to the byte-addressable nature of the file storage memory area and the linked list-based organization of the file page table, the second file page table does not need to be placed in a fixed area, as long as it is stored as a general file in the file data area. can.
- the operating system allocates a second virtual address space for the file F1.
- a second virtual address space of a preset size may be allocated to the file (for example, the size of the second virtual address space may be less than or equal to the maximum virtual address space of the system divided by The system supports the maximum number of files opened at the same time).
- the second virtual address space corresponding to the file type may be allocated to the file.
- the virtual address space corresponding to the directory file and the virtual address space corresponding to the data file may not be equal.
- the size of the virtual address space corresponding to the directory file may be smaller than the size of the virtual address space corresponding to the data file, for example, the virtual address corresponding to the directory file.
- the size of the space is 1MB, 2MB, 10MB or 30MB.
- the virtual address space corresponding to the data file is 100MB, 500MB, 1GB, 10GB, 100GB or 2TB.
- the operating system records the second virtual real address mapping relationship by using the memory page table, and the process proceeds to step 311.
- the second virtual real address mapping relationship is a mapping relationship between the second virtual address space and the second physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the recording the second virtual real address mapping relationship by using the memory page table may include: adding an entry for recording the second virtual real address mapping relationship in the memory page table (may be one or a plurality of entries), wherein the entry includes a pointer for pointing to the second file page table.
- the total number of levels of the memory page table is Y
- the total number of levels of the second file page table is X. If the table item includes the second file page table, the table entry may be the foregoing memory page table.
- the entry in the Y-X+1-level memory page table in the table if the table entry includes a pointer for pointing to the second file page table, the entry may be the YX level in the memory page table An entry in the memory page table, wherein the X is a positive integer, and the Y is a positive integer greater than the X.
- the entry (possibly one or more entries) added to the memory page table for recording the second virtual real address mapping relationship may also be any level in the memory page table.
- the second virtual address space, the start address of the second virtual address space, and the end address of the second virtual address space may be further recorded in the second index node. At least one, and/or, at least one of the second virtual address space, the start address of the second virtual address space, and the end address of the second virtual address space may be recorded among the file objects corresponding to the file One.
- the second virtual address space is continuous or non-contiguous Virtual address space. In some embodiments of the present invention, the second virtual address space is in a kernel virtual address space or the second virtual address space is in a user process virtual address space.
- the operating system feeds back the file description symbol of the file F1 to the user process A.
- User process A can initiate a read and write operation on file F1 based on the file description symbol of file F1. It can be seen that, in the foregoing technical solution of the embodiment, after receiving the file open request carrying the file identifier, determining whether the file represented by the file identifier is stored in the file storage memory area; if the file storage memory area is And storing the foregoing file, obtaining a first index node of the file, and obtaining, according to the first index node, a first physical address space of a memory area in which the file is stored in the file storage memory area; a virtual address space; the first virtual address mapping relationship is recorded by the memory page table; wherein the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, wherein the memory is
- the page table includes a kernel memory page table and/or a user process memory page table.
- the kernel virtual page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the first physical address space of the memory area storing the file in the file storage memory area is to some extent.
- the physical address space corresponding to a certain memory area in the working memory area of the process, which is convenient for the kernel or the user process to access the file system of the resident kernel by the access performance of the normal kernel data or the user process to approximate the normal memory data.
- Files which are beneficial to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario.
- the virtual address space is allocated for the file when the file is requested to be opened, this is advantageous for reducing the inefficient occupation and address conflict of the system virtual address space, and is advantageous for improving the utilization efficiency of the system virtual address space.
- the MMU transparently completes the conversion between the virtual address and the physical address of the file, which facilitates faster file access and even zero overhead.
- the file page table is used to point to the file.
- the memory page storing the contents of the file in the memory area because the data structure of the file page table and the memory page table are similar or identical, is beneficial to realize zero conversion of the page table data structure, and may also be changed when the memory page of the file content is changed.
- the operation of rebuilding the physical address space of the file and the virtual address space is not performed on the file page table, and the pointer for pointing to the updated file page table is inserted into the table of the file page table by updating the file page table, thereby completing the reconstruction.
- the mapping between the physical address of the file and the virtual address This method is useful for reconstructing the mapping between the physical address of the file and the virtual address within a constant time independent of the file size.
- the file system in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, and can not only be good. Protects the file and does not require an additional write protection mechanism to facilitate the system.
- the size of the file is only affected by the size of the system virtual address space and the number of files simultaneously opened by the operating system, which are not limitations of the file system itself, and thus the file size. It is not subject to the design of the file system itself.
- FIG. 4 is a schematic flowchart of another method for accessing a file according to another embodiment of the present invention.
- the method for accessing the file shown in FIG. 4 can be implemented after the technical solution shown in FIG. 2-a or FIG. 3 is executed.
- Another method for accessing a file provided by another embodiment of the present invention may include the following contents:
- the operating system receives a file read request sent by the user process A for requesting to read the file content of the file F1.
- the file read request carries a data amount of the first file content in the file F1 read into the memory address space and requested to be read.
- the above file read request may also carry a file descriptor of the above file.
- the read-in memory address space is an address space of a first memory area in a working memory area of the user process.
- the operating system finds the first index node or file of the file F1 based on the file descriptor. Fl file object.
- the start address of the first virtual address space is obtained based on the file object of the first index node or file F1.
- the operating system obtains a starting read virtual address for reading the content of the first file according to the first file content offset and the starting address of the first virtual address space.
- the operating system obtains a starting physical address for reading the content of the first file from the file storage memory area based on the foregoing initial read virtual address and the first virtual real address mapping relationship.
- the operating system obtains a read physical address space for reading the content of the first file from the file storage memory area based on the initial read physical address and the data amount of the first file content.
- the operating system reads the first file content of the file from the file storage memory area based on the read physical address space.
- the first file content is written into the first memory area based on the read into the memory address space.
- the file storage memory area is to some extent.
- the first physical address space of the memory area in which the file is stored is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is beneficial for the kernel or user process when the file content is read.
- FIG. 5 is a schematic flowchart of another method for accessing a file according to another embodiment of the present invention.
- the method for accessing the file shown in FIG. 5 can be implemented after the technical solution shown in FIG. 2-a or FIG. 3 is executed.
- Another method for accessing a file provided by another embodiment of the present invention may include the following contents:
- the operating system receives a file read request sent by the user process A for requesting to read the first file content of the file F1.
- the file read request carries the amount of data of the first file content in the file F1 read into the memory address space and requested to be read.
- the above file read request may also carry a file descriptor of the above file.
- the read-in memory address space is an address space of a first memory area in a working memory area of the user process.
- the operating system searches for the first index node of the file F1 or the file object of the file F1 based on the file descriptor; and obtains a starting address of the first virtual address space based on the first index node or the file object of the file F1.
- the operating system obtains a starting read virtual address for reading the content of the first file according to the first file content offset and the starting address of the first virtual address space.
- the operating system obtains a read virtual address space for reading the content of the first file based on the data volume of the initial read virtual address and the first file content.
- the operating system may obtain a read physical address space for reading the content of the first file from the file storage memory area based on the read virtual address space and the first virtual address mapping relationship.
- the operating system reads the first file content of the file from the file storage memory area based on the read physical address space.
- the first file content is written into the first memory area based on the read into the memory address space.
- the file storage memory area is to some extent.
- the first physical address space of the memory area in which the file is stored is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is beneficial for the kernel or user process when the file content is read.
- FIG. 6 is a schematic flowchart diagram of another method for accessing a file according to another embodiment of the present invention.
- the method for accessing the file shown in FIG. 6 can be implemented after the technical solution shown in FIG. 2-a or FIG. 3 is executed.
- Another method for accessing a file provided by another embodiment of the present invention may include the following content: A file write request for the piece of content, wherein the file write request carries a read memory address space and a data amount of the second file content requested to be written into the file.
- the above file write request may also carry a file descriptor of the above file.
- the read memory address space is an address space of a second memory area in a working memory area of the user process.
- the operating system may find the first index node of the file F1 or the file object of the file F1 based on the file descriptor.
- the operating system obtains the starting address of the first virtual address space based on the file object of the first index node or file F1.
- the operating system may obtain, according to the second file content offset and the start address of the first virtual address space, a starting write virtual address for writing the content of the second file to the file F1.
- the operating system may obtain, according to the foregoing initial write virtual address and the first virtual real address mapping relationship, a starting write physical address for writing the content of the second file into the file F1 of the file storage memory area.
- the operating system may obtain a write physical address space for writing the content of the second file into the file F1 of the file storage memory area based on the initial write physical address and the data amount of the second file content.
- the operating system reads the second file content from the second memory area based on the read memory address space, and the operating system writes the read second file content based on the written physical address space. Go to the third memory area above.
- the file storage memory area is to some extent.
- the first physical address space of the memory area in which the file is stored is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is beneficial for the kernel or user process when the file content is written.
- FIG. 7 is a schematic flowchart diagram of another method for accessing a file according to another embodiment of the present invention.
- the method for accessing the file shown in FIG. 7 can be implemented after the technical solution shown in FIG. 2-a or FIG. 3 is executed.
- Another method for accessing a file provided by another embodiment of the present invention may include the following: a file write request for a piece of content, wherein the file write request carries a read memory address space and requests to write to the file. The amount of data in the second file content.
- the above file write request may also carry a file descriptor of the above file.
- the read memory address space is an address space of a second memory area in a working memory area of the user process.
- the operating system may find the first index node of the file F1 or the file object of the file F1 based on the file descriptor.
- the start address of the first virtual address space is obtained based on the file object of the first index node or file F1.
- the operating system may obtain, according to the second file content offset and the start address of the first virtual address space, a starting write virtual address for writing the content of the second file to the file F1.
- the operating system may obtain a write virtual address space in which the content of the second file is written into the file F1 based on the data amount of the initial write virtual address and the content of the second file.
- the operating system may obtain a write physical address space for writing the content of the second file into the file F1 of the file storage memory area based on the mapping relationship between the write virtual address space and the first virtual real address.
- the operating system reads the second file content from the second memory area based on the read memory address space, and the operating system writes the read second file content based on the written physical address space. Go to the third memory area above.
- the file storage memory area is to some extent.
- the first physical address space of the memory area in which the file is stored is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is beneficial for the kernel or user process when the file content is written.
- Access the file in a way similar to the working memory area of the access process The file in the memory area is stored, which is beneficial to the kernel or the user process to access the file system of the resident kernel file with the access performance of the ordinary memory data, which is beneficial to greatly improve the file access performance.
- FIG. 8 is a schematic flowchart diagram of another method for accessing a file according to another embodiment of the present invention.
- the method for accessing the file shown in FIG. 8 can be implemented after the technical solution shown in any one of FIG. 2-a or FIG. 3 to FIG. 7 is executed.
- Another method for accessing a file provided by another embodiment of the present invention may include the following content:
- the operating system receives a request sent by the user process A to close the file close request of the file F1, where the file close request may further carry the file descriptor of the file.
- the operating system releases the first virtual address space or the second virtual address space allocated for the file.
- the operating system releases the first virtual real address mapping relationship or the second virtual real address mapping relationship recorded in the foregoing memory page table.
- the operating system releases the file object corresponding to the file F1 and the like.
- the kernel memory page table and/or the user process memory page table are used to record the first virtual address mapping relationship, it can be considered that the first physical address space of the memory area in which the file is stored in the file storage memory area is to some extent. , is packaged into a physical address space corresponding to a memory area in the working memory area of the process, which is beneficial for the kernel or the user to access the file system of the resident kernel by implementing the access performance of the kernel or the user process to approximate normal memory data. Files, which are beneficial to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario.
- the virtual address space is allocated for the file when the file is requested to be opened, and the virtual address space is allocated for the file when the file is closed, this is advantageous for reducing the possibility of invalid occupation and address conflict of the system virtual address space. It is beneficial to improve the utilization efficiency of the system virtual address space.
- any method for accessing a file described in each of the foregoing embodiments may be applied to a computing node, where the computing node may include a memory, and the memory includes: a file storage memory area and a process worker As a memory area, wherein the working memory area of the above process stores a memory page table, and an operating system runs in the working memory area of the above process.
- the working memory area of the process may include a kernel process working memory area and a user process working memory area, wherein the kernel memory page table may be stored in a kernel process working memory area, and the user process memory page table may be stored in the user process working.
- the memory area such as the kernel process working memory area, runs an operating system.
- an embodiment of the present invention provides an apparatus 900 for accessing a file, which may include:
- the receiving unit 901 is configured to receive a file open request that carries a file identifier.
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the obtaining unit 902 is configured to obtain a first index node of the file represented by the file identifier, where the file is stored in a file storage memory area, and obtain the memory that stores the file in the file storage memory area based on the first index node.
- the first physical address space of the zone is configured to obtain a first index node of the file represented by the file identifier, where the file is stored in a file storage memory area, and obtain the memory that stores the file in the file storage memory area based on the first index node.
- the allocating unit 903 is configured to allocate a first virtual address space for the file.
- the file may be allocated a first virtual address space of a preset size (for example, the size of the first virtual address space may be less than or equal to the maximum virtual address space of the system divided by the maximum number of files simultaneously supported by the system. Number).
- the first virtual address space corresponding to the file type may be allocated to the file.
- the virtual address space corresponding to the directory file and the virtual address space corresponding to the data file may not be equal.
- the size of the virtual address space corresponding to the directory file may be smaller than the size of the virtual address space corresponding to the data file, for example, the virtual address corresponding to the directory file.
- the size of the space is 1MB, 2MB, 10MB or 30MB.
- the virtual address space corresponding to the data file is 100MB, 500MB, 1GB, 10GB, 100GB or 2TB. and many more.
- the mapping unit 904 is configured to record the first virtual address mapping relationship by using the memory page table.
- the first virtual real address mapping relationship includes a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the index node of the file may include information that can obtain a physical address space of a memory area in the file storage memory area where the file is stored. For example, a first file page table or a pointer for pointing to the first file page table may be recorded in the first index node of the file, where the first file page table is used to point to the memory in the file storage memory area where the file is stored.
- the first file page table is a single-level or multi-level file page table, wherein the first physical address space is a physical address space of a memory area in which the file is stored in the file storage memory area.
- the first index node may directly store the first physical address space of the memory area in which the file is stored in the file storage memory area or the start address of the first physical address space.
- the first index node of the file may further include information such as metadata of the file.
- the acquiring unit 902 may be specifically configured to use, according to the foregoing, the foregoing first index node to obtain the first physical address space of the memory area in which the file is stored in the file storage memory area.
- a first file page table recorded in the first index node or used to point to the first physical address space wherein the first file page table is used to point to a memory area in the file storage memory area where the file is stored
- the foregoing A physical address space is a physical address space of a memory area in which the file is stored in the file storage memory area
- the first file page table is a single-level or multi-level file page table.
- the memory may include: a process working memory area (where the process working memory area may include a user process working memory area and a kernel process working memory area) and a file storage memory area.
- the process working memory area refers to a physical memory area for storing data structures and variables included in the working environment when the process is running.
- the data structure and the variable may include at least one of the following information: a heap, a stack, a memory mapped area, a variable of a program corresponding to the process, a character, an array, and the like when the process runs.
- the user process working memory area may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area may refer to a physical memory area for storing data structures and variables included in the working environment of the kernel process runtime.
- the foregoing data structure and variables stored in the working memory area of the kernel process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array of the kernel process. data.
- the file storage memory area may be a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system may be stored. It can further store information such as superblocks (if any) of the file system.
- the file storage memory area may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area includes a non-volatile storage medium and/or Loss storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) and the file storage memory area do not overlap each other.
- the mapping unit 904 may be specifically configured to: add, in the memory page table, an entry for recording the first virtual address mapping relationship, where the foregoing table includes the first file page table or used in the foregoing Pointer to the first file page table above.
- the total number of levels of the memory page table is Y
- the total number of levels of the first file page table is X. If the entry includes the first file page table, the entry is The entry in the Y-X+1-level memory page table in the foregoing memory page table, if the entry includes a pointer for pointing to the first file page table, the entry is the first in the memory page table. The entry in the YX-level memory page table, The above X is a positive integer, and the above Y is a positive integer greater than the above X.
- the apparatus 900 for accessing a file further includes: a recording unit 905, configured to record the first virtual address space and/or the first virtual medium in the first index node The start address of the address space, and/or, the first virtual address space and/or the start address of the first virtual address space are recorded in a file object corresponding to the file.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the obtaining unit 902 may be specifically configured to: when it is determined that the file represented by the file identifier is stored in the file storage memory area, obtain a first index node of the file represented by the file identifier.
- the receiving unit 901 is further configured to: receive a file read request for requesting to read a file content of the file, where the file read request carries a read-in memory address space and request to read And the amount of data of the first file content in the file is obtained, where the read-in memory address space is an address space of a first memory area in a working memory area of the user process;
- the apparatus 900 for accessing the file further includes:
- the second mapping unit 906 is configured to read the foregoing information from the file storage memory area based on the data amount of the first file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table. Reading the physical address space of a file content;
- the first read/write unit 907 is configured to read the first file content of the file from the file storage memory area based on the read physical address space; and write the first file content into the first memory area.
- the first virtual real address mapping relationship based on the data amount of the first file content, the first virtual address space, and the memory page table record is obtained from the file storage memory area.
- the second mapping unit 906 may be specifically configured to: based on the data amount of the first file content, the first file content offset, the first virtual address space, and The above first virtual real address mapping of the above memory page table record And obtaining a read physical address space for reading the content of the first file from the file storage memory area, wherein the first file content offset is obtained from the file read request, or the first file content The offset is obtained from the file object corresponding to the above file.
- the default file content offset may be used as a first file content offset
- a start address of the first virtual address space to obtain a starting read virtual address for reading the content of the first file; and using the initial read virtual address and the first virtual real address mapping Relationship, obtaining a starting physical address for reading the content of the first file from the file storage memory area; and reading the physical address of the first physical file and the content of the first file, and reading from the file storage memory area
- the physical address space of the first file content is read.
- the default file content offset may be As a first file content offset
- a start read virtual address for reading the first file content is obtained; and based on the initial read virtual address and the first file content
- the amount of data is obtained by reading the read virtual address space of the first file content; using the read virtual address space and the first virtual real address mapping relationship to obtain reading of the first file content from the file storage memory area Physical address space.
- the receiving unit 901 is further configured to: receive a file write request for writing a file content to the file, where the file write request carries a read memory address space and request to write The data amount of the second file content in the file, wherein the read memory address space is an address space of the second memory area in the working memory area of the process;
- the apparatus 900 for accessing the file further includes:
- the third mapping unit 908 is configured to write the foregoing to the file storage memory area based on the data amount of the second file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table. Writing a physical address space of the second file content, where the write physical address space is a physical address space of a third memory area in the file storage memory area;
- the second read/write unit 909 is configured to write the second file content cached in the second memory area into the third memory area.
- the first virtual address mapping relationship based on the data amount of the second file content, the first virtual address space, and the memory page table record is obtained by writing to the file storage memory area.
- the third mapping unit 908 may be specifically configured to: based on the data amount of the second file content, the second file content offset, and the first virtual address space, in the aspect of writing the physical address space of the second file content.
- the default file content offset may be used as a second file content offset
- a start address of the first virtual address space to obtain a start write virtual address for writing the content of the second file to the file; using the above-mentioned initial write virtual address and the first
- the virtual real address mapping relationship obtains a starting physical address for writing the content of the second file to the file from the file storage memory area; and based on the data amount of the initial writing physical address and the second file content, Writing a physical address space of the content of the second file to the above file of the file storage memory area.
- the default file content offset may be As the second file content offset
- the virtual address is written to the beginning of the second file content in the file; the virtual address and the second file are written based on the start
- the amount of data of the content is obtained by writing the write virtual address space to the content of the second file in the file of the file storage memory area; and using the write virtual address space and the first virtual physical write address space.
- the storage capacity of the third memory area may be greater than or equal to the data volume of the second file content.
- the memory area corresponding to the third memory area and the first physical address space has an intersection or no intersection. It can be understood that, in a normal case, if the memory area corresponding to the third memory area and the first physical address space have an intersection, it may indicate that the original file is replaced by the content of the second file.
- Some or all of the contents of the file (if the intersection of the third memory area and the memory area corresponding to the first physical address space is smaller than the third memory area, indicating that a new memory area is allocated for the second file content, that is, storing the above file The memory area has changed, and the memory area for storing the above files has been expanded.) If the memory area corresponding to the third memory area and the first physical address space does not intersect, it may indicate that the second file content is added in the file, and the third memory area allocates a new memory area for the second file content, that is, The memory area in which the above file is stored has changed, and the memory area in which the above file is stored is expanded.
- the unit 904 may update the first file page table such that the updated first file page table points to a memory area in the file storage memory area where the file is currently stored.
- the mapping unit 904 may update the first virtual real address mapping relationship recorded in the memory page table to a third virtual real address mapping relationship, where the third virtual real address mapping relationship includes the first virtual address space and the foregoing A mapping relationship between the three physical address spaces, where the third physical address space is a physical address space of a memory area in which the file is currently stored in the file storage memory area.
- the memory page table records a pointer to the first file page table (for example, the starting physical address of the first file page table recorded in the memory page table)
- the start of the first file page table after the update If the physical address has not changed, it is also possible to not modify the pointer in the memory page table that points to the first file page table.
- the first file page table is updated without modifying the memory page table, and the virtual address mapping relationship can be reconstructed, which greatly reduces the mapping operation.
- the receiving unit 901 is further configured to receive a file close request for requesting to close the file.
- the apparatus 900 for accessing a file may further include: a releasing unit 910, configured to release a first virtual address space allocated for the file; and release the first virtual address mapping relationship recorded in the memory page table.
- the apparatus 900 for accessing a file may further include: a file that is created, the file is created in the file storage memory area, and the second index node is allocated to the file, wherein the second index node Recording a second file page table or a pointer for pointing to the second file page table, wherein the second file page table is used to point to the file storage memory area The memory area where the above files are stored.
- the allocating unit 903 is further configured to allocate a second virtual address space for the file.
- the mapping unit 904 is further configured to record the second virtual real address mapping relationship by using the memory page table.
- the second virtual address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where the second physical address space is a memory in which the file is stored in the file storage memory area.
- the physical address space of the area, the above memory page table includes a kernel memory page table and/or a user process memory page table.
- the number of levels of the second file page table has a correspondence with the file type of the file.
- the file storage memory area includes a non-volatile memory area and/or a volatile memory area.
- the device 900 for accessing the file may: after receiving the file open request carrying the file identifier; obtaining the first index node of the file represented by the file identifier, and based on the first The index node obtains a first physical address space of the memory area in which the file is stored in the file storage memory area; allocates a first virtual address space for the file; and records a first virtual address mapping relationship by using a memory page table; wherein, the first The virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, wherein the memory page table includes a kernel memory page table and/or a user process memory page table.
- the kernel virtual page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the first physical address space of the memory area storing the file in the file storage memory area is to some extent. , the physical address space corresponding to a certain memory area in the working memory area of the process, which is beneficial for the kernel or the user process to implement the kernel or the user process to access the file system of the resident kernel file with the access performance of the ordinary memory data. This is beneficial for greatly improving file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario. And because it is in please When the file is opened, the virtual address space is allocated to the file, which is beneficial to reduce the invalid occupation and address conflict of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- the MMU transparently completes the conversion between the virtual address and the physical address of the file, which facilitates faster file access and even zero overhead.
- a file page table with a data structure similar to or the same as the memory page table is used to point to a memory page in which the file content is stored in the file storage memory area
- the data structure of the file page table and the memory page table are similar or identical, it is advantageous to implement Zero conversion of the page table data structure, and when the memory page storing the file content changes, it may not be necessary to perform the operation of reconstructing the mapping relationship between the file physical address space and the virtual address space for the file page table, and by updating the file page table,
- the pointer to the updated file page table is inserted into the table entry of the file page table, thereby completing the mapping of the physical address of the file and the virtual address, which is beneficial for reconstructing the physical address of the file within a constant time independent of the file size. Mapping to virtual addresses.
- the file system in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, and can not only be good. Protects the file and does not require an additional write protection mechanism to facilitate the system.
- the size of the file is only affected by the size of the system virtual address space and the number of files simultaneously opened by the operating system, which are not limitations of the file system itself, and thus the file size. It is not subject to the design of the file system itself.
- FIG. 10 is a schematic diagram of a computing node 1000 according to an embodiment of the present invention.
- the computing node 1000 may include at least one bus 1001, at least one processor 1002 connected to the bus 1001, and At least one memory 1003 coupled to bus 1001.
- the memory 1003 may include a memory, and may also include external storage.
- the foregoing memory may include: a file storage memory area and a process working memory area, wherein the working memory area of the above process stores a memory page table, and an operating system runs in the working memory area of the process.
- the working memory area of the process may include a kernel process working memory area and a user process working memory area, wherein the kernel memory page table may be stored in a kernel process working memory area, and the user process memory page table may be stored in the user process working memory area.
- the processor 1002 calls, by using the bus 1001, the code stored in the memory 1003 to receive a file open request that carries the file identifier; and obtains a first index node of the file represented by the file identifier, where the file is stored in the file storage.
- the first virtual address space is allocated by using the memory page table to record the first virtual address mapping relationship; wherein the first virtual real address mapping relationship includes the first virtual address space and The mapping relationship between the first physical address spaces, wherein the memory page table comprises a kernel memory page table and/or a user process memory page table.
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the processor 1002 calls the memory 1003 through the bus 1001 in terms of obtaining the first physical address space of the memory area of the file stored in the file storage memory area based on the first index node.
- the stored code is specifically used to obtain a memory area in which the file is stored in the file storage memory area based on the first file page table recorded in the first index node or the pointer used to point to the first file page table. a first physical address space, wherein the first text is
- the process working memory area refers to a physical memory area for storing data structures and variables included in the working environment when the process is running.
- the data structure and the variable may include at least one of the following information: a heap, a stack, a memory mapped area, a variable of a program corresponding to the process, a character, an array, and the like when the process runs.
- the user process working memory area may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area may refer to a physical memory area for storing data structures and variables included in the working environment of the kernel process runtime.
- the foregoing data structure and variables stored in the working memory area of the kernel process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array of the kernel process. data.
- the file storage memory area may be a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system may be stored. It can further store information such as superblocks (if any) of the file system.
- the file storage memory area may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area includes a non-volatile storage medium and/or Loss storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) and the file storage memory area do not overlap each other.
- the processor 1002 calls the code stored in the memory 1003 through the bus 1001 to specifically add to the memory page table.
- An entry for recording the first virtual address mapping relationship, the foregoing entry The first file page table or the pointer for pointing to the first file page table described above is included.
- the total number of levels of the memory page table is Y
- the total number of levels of the first file page table is X. If the entry includes the first file page table, the entry is The entry in the Y-X+1-level memory page table in the foregoing memory page table, if the entry includes a pointer for pointing to the first file page table, the entry is the first in the memory page table In the entry in the YX-level memory page table, the above X is a positive integer, and the above Y is a positive integer greater than the above X.
- the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to further record the first virtual address space and/or the first virtual address in the first index node.
- the start address of the space, and/or, the first virtual address space and/or the start address of the first virtual address space are recorded in a file object corresponding to the file.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to obtain the file identifier.
- the first inode of the file in the aspect of obtaining the first index node of the file represented by the file identifier, the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to obtain the file identifier.
- the first inode of the file in the aspect of obtaining the first index node of the file represented by the file identifier, the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to obtain the file identifier.
- the first inode of the file in the aspect of obtaining the first index node of the file represented by the file identifier
- the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to further receive a file read request for requesting to read the file content of the file, wherein the file is read.
- the request carries the data amount of the first file content in the file read into the memory address space and requested to be read, wherein the read memory address space is an address space of the first memory area in the working memory area of the user process.
- the reading physicality of reading the content of the first file from the file storage memory area An address space; the first file content of the file is read from the file storage memory area based on the read physical address space; and the first file content is written into the first memory area.
- the amount of data based on the content of the first file is obtained by reading the physical address space of the first file content from the file storage memory area, and the processor 1002 passes the bus 1001. Calling the code stored in the memory 1003 to specifically use,
- the default file content offset may be used as a first file content offset
- a start address of the first virtual address space to obtain a starting read virtual address for reading the content of the first file; and using the initial read virtual address and the first virtual real address mapping Relationship, obtaining a starting physical address for reading the content of the first file from the file storage memory area; and reading the physical address of the first physical file and the content of the first file, and reading from the file storage memory area
- the physical address space of the first file content is read.
- the default file content offset may be As a first file content offset
- a start read virtual address for reading the first file content is obtained; and based on the initial read virtual address and the first file content
- the amount of data is obtained by reading the read virtual address space of the first file content; using the read virtual address space and the first virtual real address mapping relationship to obtain reading of the first file content from the file storage memory area Physical address space.
- the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to further receive a file write request requesting to write the file content into the file, wherein the file is written.
- the incoming request carries a read memory address space and a data amount of the second file content requested to be written into the file, wherein the read memory address space is an address space of the second memory area in the working memory area of the process. ;
- the amount of data based on the content of the second file, the first virtual address space, and the memory page table Recording the first virtual real address mapping relationship, and obtaining a write physical address space for writing the content of the second file to the file storage memory area, where the write physical address space is the third among the file storage memory areas
- the physical address space of the memory area
- the first virtual address mapping relationship based on the data amount of the second file content, the first virtual address space, and the memory page table record is obtained by writing to the file storage memory area.
- the processor 1002 calls the code stored in the memory 1003 through the bus 1001 to specifically use,
- the default file content offset may be used as a second file content offset
- a start address of the first virtual address space to obtain a start write virtual address for writing the content of the second file to the file; using the above-mentioned initial write virtual address and the first a virtual real address mapping relationship, obtaining a starting physical address for writing the content of the second file to the file from the file storage memory area; and writing a physical address based on the initial writing physical address and the second content space.
- the default file content offset may be As the second file content offset
- the virtual address is written to the beginning of the second file content in the file; the virtual address and the second file are written based on the start
- the amount of data of the content is obtained by writing the write virtual address space of the content of the second file to the file in the file storage memory area; using the above-mentioned write virtual address space and the first virtual place Write to the physical address space.
- the storage capacity of the third memory area may be greater than or equal to the data volume of the second file content.
- the memory area corresponding to the third memory area and the first physical address space has an intersection or no intersection. It can be understood that, in a normal case, if the memory area corresponding to the third memory area and the first physical address space have an intersection, it may indicate that part or all of the original file contents in the file are replaced by the content of the second file ( If the intersection of the memory area corresponding to the third memory area and the first physical address space is smaller than the third memory area, indicating that a new memory area is allocated for the second file content, that is, the memory area storing the file changes, and the foregoing The memory area of the file has been expanded).
- the memory area corresponding to the third memory area and the first physical address space may indicate that the second file content is added in the file, and the third memory area allocates a new memory area for the second file content, that is, The memory area in which the above file is stored has changed, and the memory area in which the above file is stored is expanded.
- the device 1002 may update the first file page table such that the updated first file page table points to a memory area in the file storage memory area where the above file is currently stored.
- the processor 1002 may update the first virtual real address mapping relationship recorded in the memory page table to a third virtual real address mapping relationship, where the third virtual real address mapping relationship includes the first virtual address space and the foregoing A mapping relationship between the three physical address spaces, where the third physical address space is a physical address space of a memory area in which the file is currently stored in the file storage memory area.
- the memory page table records a pointer to the first file page table (for example, the starting physical address of the first file page table recorded in the memory page table;) if the updated first file page table starts The physical address does not change, and the pointer to the first file page table is not modified in the memory page table.
- the first file page table is updated without modifying the memory page table, and the virtual real address mapping relationship can be reconstructed, which greatly reduces the mapping operation.
- the processor 1002 calls the code stored in the memory 1003 via the bus 1001 to further receive a file close request for requesting to close the file; releasing the first virtual address allocated for the file. Space; releasing the first virtual address mapping relationship recorded in the foregoing memory page table.
- the processor 1002 calls the memory 1003 to identify the file represented by the memory 1001, creates the file in the file storage memory area, and allocates a second index node to the file.
- a second file page table or a pointer for pointing to the second file page table is recorded in the second index node, wherein the second file page table is used to point to a memory area in the file storage memory area where the file is stored;
- the file is allocated a second virtual address space;
- the second virtual real address mapping relationship is recorded by using the memory page table, wherein the second virtual real address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where , the second thing above
- the file is created in the file storage memory area.
- the processor 1002 may not first create a file page table of the file or create an empty file page table of the file (wherein, if the empty file page table of the file is created, the third index The node may include the above empty file page table or a pointer for pointing to the empty file page table.
- the processor 1002 may expand the memory area where the file is stored (eg, from The 10MB is expanded to 1000 MB.
- the processor 1002 updates the file page table of the above file so that the updated file page table points to the memory area in which the file is stored after the expansion.
- the number of levels of the second file page table has a correspondence with the file type of the file.
- the file storage memory area includes a non-volatile memory area and/or a volatile memory area.
- the computing node 1000 can be a device with a memory such as a server, a personal computer, a network element, a mobile terminal, or the like. It can be seen that, in the foregoing technical solution of the embodiment, after receiving the file open request carrying the file identifier, the processor obtains the first index node of the file represented by the file identifier, and is based on a physical address space; The file is allocated a first virtual address space; the first virtual address mapping relationship is recorded by the memory page table; wherein the first virtual real address mapping relationship is a mapping relationship between the first virtual address space and the first physical address space, where
- the above memory page table includes a kernel memory page table and/or a user process memory page table.
- the kernel virtual page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the first physical address space of the memory area storing the file in the file storage memory area is to some extent.
- the physical address space corresponding to a certain memory area in the working memory area of the process is packaged, which is convenient for the kernel or the user process to access the file system of the resident kernel file according to the access performance of the similar accessor process to approximate the normal memory data. It is beneficial to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario.
- the virtual address space is allocated for the file when the file is requested to be opened, this is advantageous for reducing the invalid occupation and address conflict possibility of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- the MMU transparently completes the conversion between the virtual address and the physical address of the file, which facilitates faster file access and even zero overhead.
- a file page table with a data structure similar to or the same as the memory page table is used to point to a memory page in which the file content is stored in the file storage memory area
- the data structure of the file page table and the memory page table are similar or identical, it is advantageous to implement Zero conversion of the page table data structure, and when the memory page storing the file content changes, it may not be necessary to perform the operation of reconstructing the mapping relationship between the file physical address space and the virtual address space for the file page table, and by updating the file page table, Inserting a pointer to the updated file page table into the table of the file page table, thereby completing the mapping of the physical address of the file and the virtual address.
- the method is advantageous for reconstructing the mapping between the physical address of the file and the virtual address within a constant time independent of the file size.
- the file system in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, and can not only be good. Protects the file and does not require an additional write protection mechanism to facilitate the system.
- the size of the file is only affected by the size of the system virtual address space and the number of files simultaneously opened by the operating system, which are not limitations of the file system itself, and thus the file size. It is not subject to the design of the file system itself.
- the file system adopts a method similar to the memory management, and the storage medium is accessed through the virtual address, and the MMU can be used to convert the virtual address and the physical address, and the kernel can be changed relatively less, which is convenient for the file system. Migrate to an existing operating system.
- FIG. 11 is a structural block diagram of a computing node 1100 according to another embodiment of the present invention.
- the computing node 1100 can include: at least one processor 1101, at least one network interface 1104 or other user interface 1103, a memory 1105, and at least one communication bus 1102. Communication bus 1102 is used to implement connection communication between these components.
- the computing node 1100 optionally includes a user interface 1103, including: a display (eg, a touch screen, an LCD, a CRT, a Holographic or a Projector, etc.), a pointing device (eg, a mouse, a trackball) ) a touch panel or touch screen, etc.), a camera and/or a sound pickup device, and the like.
- the memory 1102 can include, for example, a read only memory and a random access memory, and
- 1101 provides instructions and data.
- a portion of the memory 1102 also includes non-volatile memory (NVRAM) and the like.
- NVRAM non-volatile memory
- the memory 1102 can include a memory, it can also include external memory.
- the foregoing memory may include: a file storage memory area and a process working memory area, wherein the working memory area of the above process stores a memory page table, and an operating system runs in the working memory area of the foregoing process.
- the working memory area of the process may include a kernel process working memory area and a user process working memory area, wherein the kernel memory page table may be stored in a kernel process working memory area, and the user process memory page table may be stored in the user process working memory area. . .
- the memory 1105 stores the following elements, executable modules or data structures, or a subset thereof, or their extension set:
- Operating system 11051 which contains various system programs for implementing various basic services and handling hardware-based tasks.
- the application module 11052 includes various applications for implementing various application services.
- the processor 1101 receives a file open request carrying a file identifier by calling a program or an instruction stored in the memory 1105, and obtains a first index node of the file indicated by the file identifier, where the file is stored in the file.
- the first virtual address space is allocated by using the memory page table to record the first virtual address mapping relationship; wherein the first virtual real address mapping relationship includes the first virtual address space and The mapping relationship between the first physical address spaces, wherein the memory page table comprises a kernel memory page table and/or a user process memory page table.
- the file open request may carry a file storage path (that is, a storage path of a file that is requested to be opened), where the file identifier may be included in the file storage path, and of course, in the file open request. It is also possible to carry a file identification and may not carry a file storage path.
- the file opening request may further carry a file type flag bit, where the file type flag bit may indicate a file type of the file represented by the file identifier (the file type may be a directory file or a data file).
- the processor 1101 by calling the first physical address space of the memory area storing the file in the file storage memory area based on the first index node, by calling a program or an instruction stored in the memory 1105,
- the processor 1101 is specifically configured to obtain, according to the first file page table recorded in the first index node or the pointer for pointing to the first file page table, the memory area in the file storage memory area where the file is stored. a physical address space, wherein the first file page
- the first file page table described above is a single-level or multi-level file page table.
- the process working memory area refers to the number of working environments used to store the running time of the process.
- the physical memory area according to the structure and variables.
- the data structure and the variable may include at least one of the following information: a heap, a stack, a memory mapped area, a variable of a program corresponding to the process, a character, an array, and the like when the process runs.
- the user process working memory area may refer to a physical memory area for storing contents such as data structures and variables included in the working environment when the user process runs.
- the foregoing data structure and variables stored in the working memory area of the user process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the user process, a character, an array, and the like when the user process runs. data.
- the kernel process working memory area may refer to a physical memory area for storing data structures and variables included in the working environment of the kernel process runtime.
- the foregoing data structure and variables stored in the working memory area of the kernel process may include, for example, at least one of the following: a heap, a stack, a memory mapped area, a variable of a program corresponding to the kernel process, characters, and an array of the kernel process. data.
- the file storage memory area may be a physical memory area for storing a file system, and the file storage memory area may store various information of the file system itself, for example, an index node and a file in the file storage memory area where the file system may be stored. It can further store information such as superblocks (if any) of the file system.
- the file storage memory area may include a non-volatile memory area and/or a volatile memory area (ie, the storage medium of the file storage memory area includes a non-volatile storage medium and/or Loss storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) may include a non-volatile memory area and/or a volatile memory area (ie, a storage medium of the working memory area of the process includes non-volatile Storage medium and/or volatile storage medium).
- the process working memory area (such as the kernel process working memory area, the user process working memory area) and the file storage memory area do not overlap each other.
- the processor 1101 in the above-described aspect of recording the first virtual real address mapping relationship by using the memory page table, by calling a program or instruction stored in the memory 1105, the processor 1101 is specifically used to add a table for the memory page. Recording an entry of the first virtual real address mapping relationship, where the entry includes the first file page table or a pointer for pointing to the first file page table.
- the total number of levels of the memory page table is Y
- the total number of levels of the first file page table is X.
- the entry is The entry in the Y-X+1-level memory page table in the foregoing memory page table, if the entry includes a pointer for pointing to the first file page table, the entry is the first in the memory page table
- the above X is a positive integer
- the above Y is a positive integer greater than the above X.
- the processor 1101 is further configured to record the first virtual address space and/or the first virtual address space in the first index node by using a program or an instruction stored in the memory 1105.
- the start address, and/or, the first virtual address space and/or the start address of the first virtual address space are recorded in a file object corresponding to the file.
- the first virtual address space is a continuous or non-contiguous virtual address space.
- the first virtual address space is in a kernel virtual address space or a user process virtual address space.
- the processor 1101 in the aspect of obtaining the first index node of the file represented by the file identifier, by calling a program or instruction stored in the memory 1105, the processor 1101 specifically identifies the file represented by the file identifier. The first index node.
- the processor 1101 is further configured to receive a file read request for requesting to read a file content of the file by calling a program or an instruction stored in the memory 1105, where the file read request is Carrying the data amount of the first file content in the above file read into the memory address space and requesting to read, wherein the read memory address space is an address space of the first memory area in the working memory area of the user process; The data amount of the first file content, the first virtual address space, and the first virtual real address mapping relationship recorded by the memory page table, to obtain a read physical address space for reading the first file content from the file storage memory area. And reading the first file content of the file from the file storage memory area based on the reading the physical address space; and writing the first file content into the first memory area.
- the first virtual real address mapping relationship based on the data amount of the first file content, the first virtual address space, and the memory page table record is obtained from the foregoing
- the above-mentioned file storage memory area reads the aspect of reading the physical address space of the first file content, and the processor 1101 is specifically used to call the program or instruction stored in the memory 1105.
- the default file content offset may be used as a first file content offset
- a start address of the first virtual address space to obtain a starting read virtual address for reading the content of the first file; and using the initial read virtual address and the first virtual real address mapping Relationship, obtaining a starting physical address for reading the content of the first file from the file storage memory area; and reading the physical address of the first physical file and the content of the first file, and reading from the file storage memory area
- the physical address space of the first file content is read.
- the default file content offset may be As a first file content offset
- a start read virtual address for reading the first file content is obtained; and based on the initial read virtual address and the first file content
- the amount of data is obtained by reading the read virtual address space of the first file content; using the read virtual address space and the first virtual real address mapping relationship to obtain reading of the first file content from the file storage memory area Physical address space.
- the processor 1101 is further configured to receive a file write request requesting to write a file content to the file by using a program or an instruction stored in the memory 1105, where the file write request is performed. Carrying a read memory address space and a data amount of the second file content requested to be written into the file, wherein the read memory address space is an address space of a second memory area in the process working memory area;
- the first virtual address mapping relationship based on the data amount of the second file content, the first virtual address space, and the memory page table record is obtained by writing to the file storage memory area.
- the processor 1101 is specifically configured to use, by calling a program or an instruction stored in the memory 1105, in the aspect of writing the physical address space of the content of the second file.
- the default file content offset may be used as a second file content offset
- a start address of the first virtual address space to obtain a start write virtual address for writing the content of the second file to the file; using the above-mentioned initial write virtual address and the first
- the virtual real address mapping relationship obtains a starting physical address for writing the content of the second file to the file from the file storage memory area; and based on the data amount of the initial writing physical address and the second file content, Writing a physical address space of the content of the second file to the above file of the file storage memory area.
- the default file content offset may be As the second file content offset
- the virtual address is written to the beginning of the second file content in the file; the virtual address and the second file are written based on the start
- the amount of data of the content is obtained by writing the write virtual address space of the content of the second file to the file in the file storage memory area; using the above-mentioned write virtual address space and the first virtual place Write to the physical address space.
- the storage capacity of the third memory area may be greater than or equal to the data volume of the second file content.
- the memory area corresponding to the third memory area and the first physical address space has an intersection or no intersection. It can be understood that, in a normal case, if the memory area corresponding to the third memory area and the first physical address space have an intersection, it may indicate that part or all of the original file contents in the file are replaced by the content of the second file ( If the intersection of the memory area corresponding to the third memory area and the first physical address space is smaller than the third memory area, indicating that a new memory area is allocated for the second file content, that is, the memory area storing the file changes, and the foregoing The memory area of the file has been expanded).
- the memory area corresponding to the third memory area and the first physical address space may indicate that the second file content is added in the file, and the third memory area allocates a new memory area for the second file content, that is, The memory area in which the above file is stored has changed, and the memory area in which the above file is stored is expanded.
- the device 1101 may update the first file page table such that the updated first file page table points to a memory area in the file storage memory area where the above file is currently stored.
- the processor 1101 may update the first virtual address mapping relationship recorded in the memory page table to a third virtual address mapping relationship, where the third virtual address mapping relationship includes the first virtual address space and the foregoing A mapping relationship between the three physical address spaces, where the third physical address space is a physical address space of a memory area in which the file is currently stored in the file storage memory area.
- the memory page table records a pointer to the first file page table (for example, the starting physical address of the first file page table recorded in the memory page table)
- the updated first file page table starts The physical address has not changed, and the pointer to the first file page table may not be modified in the memory page table.
- the first file page table is updated without modifying the memory page table, and the virtual real address mapping relationship can be reconstructed, which greatly reduces the mapping operation.
- the processor 1101 is further configured to receive a file close request for requesting to close the file by calling a program or an instruction stored in the memory 1105; releasing a first virtual address space allocated for the file; The first virtual address mapping relationship recorded in the foregoing memory page table is released.
- processing is performed by calling a program or instruction stored in the memory 1105.
- a file the file is created in the file storage memory area, and the second index node is allocated to the file, wherein the second file node records a second file page table or a pointer to the second file page table.
- the second file page table is used to point to the memory area of the file storage memory area for storing the file; the second virtual address space is allocated to the file; and the second virtual address mapping relationship is recorded by using the memory page table;
- the second virtual address mapping relationship includes a mapping relationship between the second virtual address space and the second physical address space, where the second physical address is empty.
- the file after receiving the file open request carrying the file identifier, when it is determined that the file indicated by the file identifier is not stored in the file storage memory area, the file is created in the file storage memory area.
- the third index node is allocated to the above file, and the processor 1101 may not first create a file page table of the file or create an empty file page table of the file (wherein, if the empty file page table of the file is created, the third index)
- the node may include the above empty file page table or a pointer for pointing to the empty file page table.
- the processor 1101 may expand the memory area where the file is stored (eg, from The 10MB is expanded to 1100 MB.
- the processor 1101 updates the file page table of the above file so that the updated file page table points to the memory area where the file is stored after the expansion.
- the number of levels of the second file page table has a correspondence with the file type of the file.
- the file storage memory area includes a non-volatile memory area and/or a volatile memory area.
- the processor after receiving the file open request carrying the file identifier, the processor obtains the first index node of the file represented by the file identifier, and is based on a physical address space; a first virtual address space is allocated to the file; the first virtual address mapping relationship is recorded by the memory page table; wherein the first virtual address mapping relationship is the first virtual address space and the first physical address space
- a mapping relationship between the foregoing memory page table includes a kernel memory page table and/or a user process memory page table. Because the kernel virtual page table and/or the user process memory page table are used to record the first virtual real address mapping relationship, it can be considered that the first physical address space of the memory area storing the file in the file storage memory area is to some extent.
- the physical address space corresponding to a certain memory area in the working memory area of the process is packaged, which is convenient for the kernel or the user process to access the file system of the resident kernel file according to the access performance of the similar accessor process to approximate the normal memory data. It is beneficial to greatly improve file access performance. It can be seen that the above file access scheme is more suitable for high-performance file access in the file system resident memory scenario. Moreover, since the virtual address space is allocated for the file when the file is requested to be opened, this is advantageous for reducing the invalid occupation and address conflict possibility of the system virtual address space, and is beneficial to improving the utilization efficiency of the system virtual address space.
- the MMU transparently completes the conversion between the virtual address and the physical address of the file, which facilitates faster file access and even zero overhead.
- a file page table with a data structure similar to or the same as the memory page table is used to point to a memory page in which the file content is stored in the file storage memory area
- the data structure of the file page table and the memory page table are similar or identical, it is advantageous to implement Zero conversion of the page table data structure, and when the memory page storing the file content changes, it may not be necessary to perform the operation of reconstructing the mapping relationship between the file physical address space and the virtual address space for the file page table, and by updating the file page table,
- the pointer to the updated file page table is inserted into the table entry of the file page table, thereby completing the mapping of the physical address of the file and the virtual address, which is beneficial for reconstructing the physical address of the file within a constant time independent of the file size. Mapping to virtual addresses.
- the file system is The file in the file storage memory area is protected by the system virtual address and the MMU, which greatly reduces the possibility of being mistakenly written, not only can protect the file well, and does not require an additional write protection mechanism, which is beneficial to the system.
- the size of the file is only affected by the size of the system virtual address space and the number of files simultaneously opened by the operating system, which are not limitations of the file system itself, and thus the file size. It is not subject to the design of the file system itself.
- the file system adopts a method similar to the memory management, and the storage medium is accessed through the virtual address, and the MMU can be used to convert the virtual address and the physical address, and the kernel can be changed relatively less, which is convenient for the file system. Migrate to an existing operating system.
- the computing node of each embodiment of the present invention may be a device having a memory such as a server, a personal computer, a network element, a mobile terminal, or the like.
- the embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and the program includes some or all of the steps of the at least one method for accessing the file described in the foregoing method embodiments.
- the disclosed apparatus may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the unit is only a logical function division.
- there may be another division manner for example, multiple units or components may be combined or may be Integration into another system, or some features can be ignored, or not executed.
- the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the instructions include a plurality of instructions for causing a computer device (which may be a personal computer, server or network device, etc., and in particular a processor in a computer device) to perform all or part of the steps of the methods of the various embodiments of the present invention.
- the foregoing storage medium may include: a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), and the like. The medium of the code.
Abstract
Description
Claims
Priority Applications (6)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2014/073070 WO2015131403A1 (zh) | 2014-03-07 | 2014-03-07 | 访问文件的方法和相关设备 |
CN201480000730.XA CN105378687B (zh) | 2014-03-07 | 2014-03-07 | 访问文件的方法和相关设备 |
EP14884527.4A EP3115903B1 (en) | 2014-03-07 | 2014-03-07 | File accessing method and related device |
JP2016572867A JP6385468B2 (ja) | 2014-03-07 | 2014-03-07 | ファイルアクセス方法及び関係するデバイス |
KR1020167025615A KR102061079B1 (ko) | 2014-03-07 | 2014-03-07 | 파일 액세스 방법 및 관련 기기 |
US15/257,928 US10452562B2 (en) | 2014-03-07 | 2016-09-07 | File access method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2014/073070 WO2015131403A1 (zh) | 2014-03-07 | 2014-03-07 | 访问文件的方法和相关设备 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US15/257,928 Continuation US10452562B2 (en) | 2014-03-07 | 2016-09-07 | File access method and related device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015131403A1 true WO2015131403A1 (zh) | 2015-09-11 |
Family
ID=54054406
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2014/073070 WO2015131403A1 (zh) | 2014-03-07 | 2014-03-07 | 访问文件的方法和相关设备 |
Country Status (6)
Country | Link |
---|---|
US (1) | US10452562B2 (zh) |
EP (1) | EP3115903B1 (zh) |
JP (1) | JP6385468B2 (zh) |
KR (1) | KR102061079B1 (zh) |
CN (1) | CN105378687B (zh) |
WO (1) | WO2015131403A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110018998A (zh) * | 2019-04-12 | 2019-07-16 | 深信服科技股份有限公司 | 一种文件管理方法、系统及电子设备和存储介质 |
WO2020057394A1 (zh) * | 2018-09-19 | 2020-03-26 | 华为技术有限公司 | 监控样本进程的内存访问行为的方法和装置 |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3173931B1 (en) * | 2014-09-01 | 2018-08-29 | Huawei Technologies Co., Ltd. | File access method, device and storage system |
US10339065B2 (en) * | 2016-12-01 | 2019-07-02 | Ampere Computing Llc | Optimizing memory mapping(s) associated with network nodes |
CN107493329A (zh) * | 2017-08-15 | 2017-12-19 | 诸葛晴凤 | 一种分布式内存文件系统的远程文件访问方法 |
US11119939B2 (en) * | 2017-08-21 | 2021-09-14 | Alibaba Group Holding Limited | Methods and systems for memory management of kernel and user spaces |
US11042394B2 (en) | 2017-10-13 | 2021-06-22 | Electronics And Telecommunications Research Institute | Method for processing input and output on multi kernel system and apparatus for the same |
CN113835898B (zh) * | 2017-11-29 | 2024-03-01 | 北京忆芯科技有限公司 | 存储器分配器 |
WO2019127135A1 (zh) * | 2017-12-27 | 2019-07-04 | 华为技术有限公司 | 文件页表管理技术 |
CN114089916B (zh) * | 2018-01-12 | 2022-12-20 | 珠海极海半导体有限公司 | 数据采集系统和温湿度传感器系统 |
US20190227957A1 (en) * | 2018-01-24 | 2019-07-25 | Vmware, Inc. | Method for using deallocated memory for caching in an i/o filtering framework |
US10261693B1 (en) * | 2018-01-31 | 2019-04-16 | EMC IP Holding Company LLC | Storage system with decoupling and reordering of logical and physical capacity removal |
CN111143072B (zh) * | 2019-12-29 | 2023-09-08 | 浪潮(北京)电子信息产业有限公司 | 用户态程序内存分配方法、系统及相关组件 |
CN112148229B (zh) * | 2020-10-12 | 2024-01-30 | 北京计算机技术及应用研究所 | 一种飞腾服务器平台下的加速非易失性内存读写效率的方法 |
CN114996024A (zh) * | 2022-07-29 | 2022-09-02 | 阿里巴巴(中国)有限公司 | 内存带宽监测方法、服务器和计算机可读存储介质 |
CN117708000A (zh) * | 2024-02-05 | 2024-03-15 | 成都佰维存储科技有限公司 | 数据的随机写入方法、装置、电子设备及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101876918A (zh) * | 2009-11-27 | 2010-11-03 | 北京航空航天大学 | 虚拟机客户操作系统同步任务感知方法 |
CN102207896A (zh) * | 2010-03-31 | 2011-10-05 | 微软公司 | 虚拟机崩溃文件生成技术 |
US20130097354A1 (en) * | 2011-10-13 | 2013-04-18 | International Business Machines Corporation | Protecting memory of a virtual guest |
CN103218312A (zh) * | 2013-03-28 | 2013-07-24 | 中国科学院上海微系统与信息技术研究所 | 文件访问方法及系统 |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4742447A (en) * | 1986-01-16 | 1988-05-03 | International Business Machines Corporation | Method to control I/O accesses in a multi-tasking virtual memory virtual machine type data processing system |
US7506095B2 (en) * | 2006-04-04 | 2009-03-17 | International Business Machines Corporation | System and method for providing execute-in-place functionality |
US7797508B2 (en) * | 2007-07-31 | 2010-09-14 | International Business Machines Corporation | Fair memory resource control for mapped memory |
US20090113111A1 (en) * | 2007-10-30 | 2009-04-30 | Vmware, Inc. | Secure identification of execution contexts |
US8630987B2 (en) * | 2008-07-16 | 2014-01-14 | Cleversafe, Inc. | System and method for accessing a data object stored in a distributed storage network |
US8819011B2 (en) * | 2008-07-16 | 2014-08-26 | Cleversafe, Inc. | Command line interpreter for accessing a data object stored in a distributed storage network |
KR101038167B1 (ko) * | 2008-09-09 | 2011-05-31 | 가부시끼가이샤 도시바 | 프로세서로부터 메모리로의 액세스를 관리하는 메모리 관리 장치를 포함하는 정보 처리 장치 및 메모리 관리 방법 |
JP2012173870A (ja) * | 2011-02-18 | 2012-09-10 | Toshiba Corp | 半導体装置及びメモリ保護方法 |
CN102184145B (zh) | 2011-05-13 | 2013-04-17 | 杭州华三通信技术有限公司 | 重启数据不丢失方法及装置 |
JP2013109404A (ja) * | 2011-11-17 | 2013-06-06 | Toshiba Corp | 情報処理装置 |
US9612973B2 (en) * | 2013-11-09 | 2017-04-04 | Microsoft Technology Licensing, Llc | Using shared virtual memory resources for performing memory-mapping |
-
2014
- 2014-03-07 CN CN201480000730.XA patent/CN105378687B/zh active Active
- 2014-03-07 KR KR1020167025615A patent/KR102061079B1/ko active IP Right Grant
- 2014-03-07 WO PCT/CN2014/073070 patent/WO2015131403A1/zh active Application Filing
- 2014-03-07 JP JP2016572867A patent/JP6385468B2/ja active Active
- 2014-03-07 EP EP14884527.4A patent/EP3115903B1/en active Active
-
2016
- 2016-09-07 US US15/257,928 patent/US10452562B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101876918A (zh) * | 2009-11-27 | 2010-11-03 | 北京航空航天大学 | 虚拟机客户操作系统同步任务感知方法 |
CN102207896A (zh) * | 2010-03-31 | 2011-10-05 | 微软公司 | 虚拟机崩溃文件生成技术 |
US20130097354A1 (en) * | 2011-10-13 | 2013-04-18 | International Business Machines Corporation | Protecting memory of a virtual guest |
CN103218312A (zh) * | 2013-03-28 | 2013-07-24 | 中国科学院上海微系统与信息技术研究所 | 文件访问方法及系统 |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020057394A1 (zh) * | 2018-09-19 | 2020-03-26 | 华为技术有限公司 | 监控样本进程的内存访问行为的方法和装置 |
CN110928737A (zh) * | 2018-09-19 | 2020-03-27 | 华为技术有限公司 | 监控样本进程的内存访问行为的方法和装置 |
CN110928737B (zh) * | 2018-09-19 | 2021-05-18 | 华为技术有限公司 | 监控样本进程的内存访问行为的方法和装置 |
US11467977B2 (en) | 2018-09-19 | 2022-10-11 | Huawei Technologies Co., Ltd. | Method and apparatus for monitoring memory access behavior of sample process |
CN110018998A (zh) * | 2019-04-12 | 2019-07-16 | 深信服科技股份有限公司 | 一种文件管理方法、系统及电子设备和存储介质 |
CN110018998B (zh) * | 2019-04-12 | 2023-05-12 | 深信服科技股份有限公司 | 一种文件管理方法、系统及电子设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
EP3115903A1 (en) | 2017-01-11 |
EP3115903B1 (en) | 2020-04-15 |
JP2017507448A (ja) | 2017-03-16 |
CN105378687B (zh) | 2018-12-25 |
CN105378687A (zh) | 2016-03-02 |
KR102061079B1 (ko) | 2019-12-31 |
EP3115903A4 (en) | 2017-03-08 |
KR20160123370A (ko) | 2016-10-25 |
US10452562B2 (en) | 2019-10-22 |
JP6385468B2 (ja) | 2018-09-05 |
US20160378680A1 (en) | 2016-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015131403A1 (zh) | 访问文件的方法和相关设备 | |
US10067684B2 (en) | File access method and apparatus, and storage device | |
US11640353B2 (en) | Memory system, data storage device, user device and data management method thereof | |
US11042487B2 (en) | Memory system and method for controlling nonvolatile memory | |
US10157143B2 (en) | File access method and apparatus, and storage system | |
US10061711B2 (en) | File access method and apparatus, and storage system | |
WO2016082191A1 (zh) | 访问文件的方法和装置 | |
US20150324281A1 (en) | System and method of implementing an object storage device on a computer main memory system | |
CN108595349B (zh) | 大容量存储设备的地址转换方法与装置 | |
WO2019127135A1 (zh) | 文件页表管理技术 | |
US20090100213A1 (en) | Systems and Methods for Managing Memory Core Surface | |
US10120812B2 (en) | Manipulation of virtual memory page table entries to form virtually-contiguous memory corresponding to non-contiguous real memory allocations | |
CN107179929B (zh) | 一种write_same函数的优化实现方法及装置 | |
CN107155306B (zh) | 文件页面管理单元、处理设备和文件页面管理方法 | |
WO2020024151A1 (zh) | 信息处理方法及装置、设备、系统 | |
Oikawa | Adapting byte addressable memory storage to user-level file system services | |
KR20210043001A (ko) | 하이브리드 메모리 시스템 인터페이스 | |
KR101825013B1 (ko) | 비휘발성 메모리에 영구 보존 데이터를 저장할 수 있는 시스템에서의 데이터 관리 방법 | |
CN117130955A (zh) | 用于管理相关联的存储器的方法和系统 | |
Zhang et al. | Research on persistent memory file system optimization | |
KR20140085643A (ko) | 데이터 저장 장치 및 그것의 동작 방법 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14884527 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2016572867 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 20167025615 Country of ref document: KR Kind code of ref document: A |
|
REEP | Request for entry into the european phase |
Ref document number: 2014884527 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2014884527 Country of ref document: EP |