[go: up one dir, main page]

CN106095817A - Extensible file system based on micro-kernel and file access method - Google Patents

Extensible file system based on micro-kernel and file access method Download PDF

Info

Publication number
CN106095817A
CN106095817A CN201610378856.1A CN201610378856A CN106095817A CN 106095817 A CN106095817 A CN 106095817A CN 201610378856 A CN201610378856 A CN 201610378856A CN 106095817 A CN106095817 A CN 106095817A
Authority
CN
China
Prior art keywords
file
service
service process
request
directory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610378856.1A
Other languages
Chinese (zh)
Inventor
钱振江
汤力
张雪伍
周蕾
王剑
乐德广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changshu Institute of Technology
Original Assignee
Changshu Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changshu Institute of Technology filed Critical Changshu Institute of Technology
Priority to CN201610378856.1A priority Critical patent/CN106095817A/en
Publication of CN106095817A publication Critical patent/CN106095817A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种基于微内核的可扩展文件系统,包括用于读写磁盘的磁盘服务;用于在用户进程与文件服务进程之间拷贝文件数据,帮助磁盘服务执行内核态的特权IO指令的系统服务;目录服务进程:工作于单个处理核,管理全局的元数据,设置块缓存用于保存文件属性信息inode和目录信息dentry,接收用户进程的所有文件处理请求,执行目录遍历,处理所述文件处理请求中的操作元数据的请求,并将读写文件的请求路由至文件服务进程;多个文件服务进程:用于处理读写文件的请求,设置有缓存池用于缓存数据文件块。本发明还公开了一种基于微内核的可扩展文件系统的文件访问方法。本发明可避免大部分锁竞争开销,实现文件服务进程的负载均衡与弹性扩展。

The invention discloses an extensible file system based on a microkernel, including disk services for reading and writing disks; for copying file data between user processes and file service processes, and helping disk services execute privileged IO instructions in kernel mode system services; directory service process: work on a single processing core, manage global metadata, set block cache to save file attribute information inode and directory information dentry, receive all file processing requests from user processes, execute directory traversal, and process all Describe the request for operating metadata in the file processing request, and route the request for reading and writing files to the file service process; multiple file service processes: used to process requests for reading and writing files, and set a cache pool for caching data file blocks . The invention also discloses a file access method of the extensible file system based on the microkernel. The invention can avoid most lock competition overheads, and realize load balancing and elastic expansion of file service processes.

Description

基于微内核的可扩展文件系统及文件访问方法Extensible file system and file access method based on microkernel

技术领域technical field

本发明涉及一种文件系统及文件访问方法,尤其是涉及一种基于微内核的可扩展文件系统及文件访问方法,属于数据存储访问技术领域。The invention relates to a file system and a file access method, in particular to a microkernel-based scalable file system and a file access method, belonging to the technical field of data storage access.

背景技术Background technique

对于网络服务器或大型的多核工作站,文件系统的并行性能至关重要。特别是随着云计算时代分布式存储系统的广泛应用,在多核的云存储系统中,对于每个核上的块(chunk)服务进程,块读写效率成为关键要素,这是因为通常需要在短时间内处理对大量文件的读写工作。For web servers or large multi-core workstations, file system parallelism is critical. Especially with the widespread application of distributed storage systems in the era of cloud computing, in a multi-core cloud storage system, for the chunk service process on each core, the efficiency of chunk read and write becomes a key factor, because it is usually necessary to Handle reading and writing of a large number of files in a short period of time.

目前传统的文件系统在核数较少时可以很好地工作,但由于存在锁竞争开销,其性能会随着并行代码流的数量增加而大幅度降低。其锁竞争开销主要来自于以下两部分:The current traditional file system can work well when the number of cores is small, but due to the lock contention overhead, its performance will be greatly degraded as the number of parallel code streams increases. Its lock competition overhead mainly comes from the following two parts:

(1)元数据。当多个目录查询代码流并行时,对文件系统的元数据(包括目录信息dentry、文件属性信息inode、超级块列表、块位图)中的目录信息dentry的缓存数据结构dcache和文件属性信息inode的缓存数据结构icache的访问会成为瓶颈。dcache按照树型结构,组织了系统中所有目录的基本信息,由锁对象dcache_lock保护;icache缓存了系统中所有被引用到的文件属性信息inode节点,由锁对象inode_lock保护。当创建或打开一个文件时,系统会解析文件路径名,并按顺序分解为多个dentry与inode,并在dcache和icache中检索它们。该过程需要获取这些数据结构上的全局自旋锁以及每个dentry与inode上的互斥锁。(1) Metadata. When multiple directory query code flows are in parallel, the cache data structure dcache and file attribute information inode of the directory information dentry in the metadata of the file system (including directory information dentry, file attribute information inode, super block list, and block bitmap) The access to the cache data structure icache will become a bottleneck. According to the tree structure, dcache organizes the basic information of all directories in the system and is protected by the lock object dcache_lock; icache caches all referenced file attribute information inode nodes in the system and is protected by the lock object inode_lock. When creating or opening a file, the system will parse the file path name, decompose it into multiple dentry and inode in sequence, and retrieve them in dcache and icache. This process requires acquiring global spinlocks on these data structures and mutexes on each dentry and inode.

(2)块缓存。当并行读写文件时,对文件系统中共享的块缓存也存在极大的竞争开销。除了全局锁,每个块缓存项由一个状态值控制(相当于互斥锁),以避免块被同时写,这使得写操作较多的程序扩展性更差。(2) Block cache. There is also significant contention overhead for the shared block cache in the file system when reading and writing files in parallel. In addition to the global lock, each block cache entry is controlled by a state value (equivalent to a mutex) to prevent blocks from being written at the same time, which makes programs with more write operations less scalable.

同时,多个文件服务进程间的负载不均衡或用户请求量与服务进程的服务能力不匹配也会造成计算资源的使用不合理,从而导致文件系统整体性能的下降。At the same time, the unbalanced load between multiple file service processes or the mismatch between the amount of user requests and the service capabilities of the service processes will also cause unreasonable use of computing resources, resulting in a decline in the overall performance of the file system.

发明内容Contents of the invention

本发明提供了一种基于微内核的并行且能够扩展至多核平台的文件系统以及基于该系统的文件访问方法,通过对文件系统的数据对象和操作的划分,避免大部分锁竞争开销。采用主从服务结构,实现文件服务进程的负载均衡与弹性扩展。The invention provides a microkernel-based parallel file system that can be extended to a multi-core platform and a file access method based on the system. By dividing data objects and operations of the file system, most lock competition overheads are avoided. The master-slave service structure is adopted to realize the load balancing and elastic expansion of the file service process.

本发明技术方案如下:一种基于微内核的可扩展文件系统,包括:The technical scheme of the present invention is as follows: a microkernel-based scalable file system, comprising:

磁盘服务:用于将磁盘上的数据加载至内存或将内存数据写回磁盘;Disk service: used to load data on disk to memory or write memory data back to disk;

系统任务:用于在用户进程与文件服务进程之间拷贝文件数据,并在磁盘服务需要访问磁盘时帮助其执行内核态的特权IO指令;System task: used to copy file data between the user process and the file service process, and to help the disk service execute kernel-mode privileged IO instructions when it needs to access the disk;

目录服务进程:工作于单个处理核,管理全局的元数据,设置块缓存用于保存文件属性信息inode和目录信息dentry,接收用户进程的所有文件处理请求,执行目录遍历,处理所述文件处理请求中的操作元数据的请求,并将读写文件的请求路由至文件服务进程;Directory service process: work on a single processing core, manage global metadata, set block cache to save file attribute information inode and directory information dentry, receive all file processing requests from user processes, perform directory traversal, and process the file processing requests Requests for operating metadata in the file, and routing requests for reading and writing files to the file service process;

多个文件服务进程:用于处理读写文件的请求,设置有缓存池用于缓存数据文件块,所述数据文件块包括数据块以及中间块。A plurality of file service processes: for processing requests for reading and writing files, and setting up a cache pool for caching data file blocks, and the data file blocks include data blocks and intermediate blocks.

进一步的,所述目录服务进程路由时根据读写数据量估计每个文件服务进程的负载值,并选取负载值最低的文件服务进程作为路由目标,所述目录服务进程在路由一个读写请求时增加相应文件服务进程的负载值,所述文件服务进程在取得一个排队的请求后并即将处理时减去相应负载值。Further, when the directory service process routes, it estimates the load value of each file service process according to the amount of read and write data, and selects the file service process with the lowest load value as the routing target. When the directory service process routes a read and write request The load value of the corresponding file service process is increased, and the file service process subtracts the corresponding load value when it obtains a queued request and is about to process it.

进一步的,所述目录服务进程监控文件服务进程的平均负载并调整文件服务进程数量。Further, the directory service process monitors the average load of the file service process and adjusts the number of file service processes.

所述元数据包括目录信息dentry、文件属性信息inode、超级块列表和块位图。The metadata includes directory information dentry, file attribute information inode, super block list and block bitmap.

所述操作元数据的请求包括打开文件、关闭文件、创建文件、创建文件夹、进入文件夹和改变文件属性。The request for manipulating metadata includes opening a file, closing a file, creating a file, creating a folder, entering a folder, and changing file attributes.

一种基于微内核的可扩展文件系统的文件访问方法,包括步骤:用户进程向目录服务进程发送文件访问请求,所述文件访问请求的参数包括文件描述符ID,缓冲区地址和文件请求的字节数;目录服务进程在用户进程的文件描述符表中检索inode指针,同时在路由表中检索目标文件服务进程;目标文件服务进程检索到文件inode并分析块映射图,从缓存中逐块读取与请求文件相关的间接块和数据块,在哈希表中没找到的块由磁盘服务加载;目标文件服务进程请求系统任务从文件服务进程的地址空间中拷贝数据至用户进程的缓冲区。A file access method based on a microkernel-based extensible file system, comprising steps: a user process sends a file access request to a directory service process, and the parameters of the file access request include a file descriptor ID, a buffer address and a file request word The number of nodes; the directory service process retrieves the inode pointer in the file descriptor table of the user process, and at the same time retrieves the target file service process in the routing table; the target file service process retrieves the file inode and analyzes the block map, and reads block by block from the cache Get the indirect blocks and data blocks related to the requested file, and the blocks not found in the hash table are loaded by the disk service; the target file service process requests the system task to copy data from the address space of the file service process to the buffer of the user process.

进一步的,所述目录服务在路由表中检索目标文件服务进程时根据读写数据量估计每个文件服务进程的负载值,并选取负载值最低的文件服务进程作为路由目标,所述目录服务进程在路由一个读写请求时增加相应文件服务进程的负载值,所述文件服务进程在取得一个排队的请求后并即将处理时减去相应负载值。Further, the directory service estimates the load value of each file service process according to the amount of read and write data when retrieving the target file service process in the routing table, and selects the file service process with the lowest load value as the routing target, and the directory service process When routing a read and write request, the load value of the corresponding file service process is increased, and the file service process subtracts the corresponding load value after obtaining a queued request and is about to process it.

本发明所提供的技术方案的优点在于:The advantage of the technical solution provided by the present invention is:

(1)目录服务进程进行串行化目录操作,可以避免对元数据加锁,并移除缓存一致性协议所带来的开销。(1) The directory service process performs serial directory operations, which can avoid locking metadata and remove the overhead caused by the cache consistency protocol.

(2)对于一个已打开文件的读写请求,由目录服务进程路由至特定的文件服务进程进行处理,从而保证了不同文件服务进程操作的文件集合不相交。多个文件服务进程的分布的块缓存各自保存了不同的数据内容,所以它们之间是互相独立的,并且数据结构无需加锁。当多个用户进程试图访问同一个文件块时,读写过程均会由单个文件服务进程串行地执行,因而,每个块缓存上的互斥锁也可移除。(2) For a read and write request of an opened file, the directory service process routes it to a specific file service process for processing, thereby ensuring that the sets of files operated by different file service processes are disjoint. The distributed block caches of multiple file service processes each store different data content, so they are independent of each other, and the data structure does not need to be locked. When multiple user processes try to access the same file block, the reading and writing process will be performed serially by a single file serving process, so the mutex on each block cache can also be removed.

(3)目录服务进程作为主服务进程,利用一个全局视图平衡文件服务进程(从服务进程)的负载,并动态地调节服务的规模以匹配用户进程的请求负荷。(3) The directory service process, as the main service process, uses a global view to balance the load of the file service process (slave service process), and dynamically adjusts the scale of the service to match the request load of the user process.

(4)文件系统的功能被分解并运行于特定的处理核,同时将高竞争度的数据结构分离,从而使每个服务进程的工作集几乎不相交,这样可以避免文件系统的大部分锁。(4) The functions of the file system are decomposed and run on specific processing cores, and at the same time, the highly competitive data structures are separated, so that the working sets of each service process are almost disjoint, which can avoid most locks of the file system.

附图说明Description of drawings

图1为基于微内核的可扩展文件系统的架构示意图;Figure 1 is a schematic diagram of the architecture of a microkernel-based scalable file system;

图2为基于微内核的可扩展文件系统的交互时序图。Fig. 2 is an interaction sequence diagram of the microkernel-based scalable file system.

具体实施方式detailed description

下面结合实施例对本发明作进一步说明,但不作为对本发明的限定。The present invention will be further described below in conjunction with the examples, but not as a limitation of the present invention.

如图1所示,本实施例所涉及的基于微内核的可扩展文件系统,包括:As shown in Figure 1, the microkernel-based scalable file system involved in this embodiment includes:

磁盘服务:一个采用直接内存访问方式的块设备驱动,用于将磁盘上的数据加载至内存或将内存数据写回磁盘;Disk service: a block device driver that uses direct memory access to load data on the disk into memory or write memory data back to disk;

系统任务:运行于内核态,用于在用户进程与文件服务进程之间拷贝文件数据,并在磁盘服务需要访问磁盘时帮助其执行内核态的特权IO指令;System tasks: run in the kernel mode, used to copy file data between the user process and the file service process, and help the disk service execute privileged IO instructions in the kernel mode when it needs to access the disk;

目录服务进程与多个文件服务进程:通过与系统任务和磁盘服务进行交互来访问磁盘中的目录或文件数据,以及为用户进程提供文件服务。在主从结构中,目录服务进程可以视为本发明的主服务进程,而文件服务进程为从服务进程。Directory service process and multiple file service processes: access directory or file data in the disk by interacting with system tasks and disk services, and provide file services for user processes. In the master-slave structure, the directory service process can be regarded as the master service process of the present invention, and the file service process is the slave service process.

目录服务进程工作于单个处理核,管理内存中的元数据(包括目录信息dentry、文件属性信息inode、超级块列表、块位图),它作为访问入口向用户提供一组统一的接口,所有来自用户进程的请求都发往目录服务进程。其中操作元数据的请求,如打开文件、关闭文件、创建文件、创建文件夹、进入文件夹、改变文件属性等,由目录服务进程直接处理,而读写普通文件的请求则被路由至文件服务进程进行处理。The directory service process works on a single processing core and manages metadata in memory (including directory information dentry, file attribute information inode, super block list, block bitmap), and it provides a set of unified interfaces to users as an access entry. Requests from user processes are sent to the directory service process. Among them, requests for manipulating metadata, such as opening files, closing files, creating files, creating folders, entering folders, changing file attributes, etc., are directly processed by the directory service process, while requests for reading and writing ordinary files are routed to file services process is processed.

目录服务进程的路由策略操作依据一张哈希路由表完成,该表记录了由文件属性信息inode映射至文件服务进程的路由项。当用户进程请求打开一个新文件时,目录服务进程会为其选择多个文件服务进程中的一个文件服务进程,并创建一个新的路由项。随后访问该文件的请求都将被路由至该文件服务进程。当没有进程引用该文件时,其路由项才会被删除。这样的路由方式使得文件在其打开期间,其缓存的文件块始终存放于固定的文件服务进程。这期间其它文件服务进程不可能对该文件进行操作,从而保证了缓存数据与磁盘数据之间的一致性。为了避免不必要的路由操作,用户进程也缓存了路由项,使大部分文件请求可以不经过路由过程而被直接发送至文件服务进程。The routing policy operation of the directory service process is completed according to a hash routing table, which records the routing items mapped from the file attribute information inode to the file service process. When a user process requests to open a new file, the directory service process will select a file service process among multiple file service processes for it, and create a new routing item. Subsequent requests to access the file will be routed to the file serving process. When no process references the file, its routing entry will be deleted. Such a routing method makes the cached file blocks always be stored in a fixed file service process during the file opening period. During this period, it is impossible for other file service processes to operate on the file, thereby ensuring the consistency between cached data and disk data. In order to avoid unnecessary routing operations, the user process also caches routing items, so that most file requests can be directly sent to the file service process without going through the routing process.

部分竞争度较低的元数据虽然由目录服务进程维护,但也需要被文件服务进程访问。这些元数据包括超级块列表、块位图、icache,存储于目录服务进程,并被每个文件服务进程共享,这样可以使各文件服务进程都能方便快速地访问它们。系统任务在各个文件服务进程启动完成后,通过内存页映射的方式将这些元数据共享。Although some metadata with low contention is maintained by the directory service process, it also needs to be accessed by the file service process. These metadata include superblock list, block bitmap, and icache, which are stored in the directory service process and shared by each file service process, so that each file service process can access them conveniently and quickly. After each file service process is started, the system task shares these metadata through memory page mapping.

由于目录服务进程和文件服务进程无差别地访问所有的块数据,所以超级块列表和块位图都需要加锁同步。icache维护了当前所有进程引用到的inode索引节点,文件服务进程在读取一个文件前,需要检索一个inode的块映射图,其数据结构不需要加锁,这是因为在某个时刻,各服务进程操作的对象不相交:(1)文件服务进程只会访问一个inode的块映射图,而目录服务进程不访问inode的块映射图;(2)由于文件服务进程间的隔离性,一个inode在某一时刻只会被唯一的文件服务进程访问。Since the directory service process and the file service process access all block data indiscriminately, both the super block list and the block bitmap need to be locked and synchronized. icache maintains the inode index nodes referenced by all current processes. Before the file service process reads a file, it needs to retrieve an inode block map, and its data structure does not need to be locked. This is because at a certain moment, each service The objects operated by the process are disjoint: (1) the file service process will only access the block map of an inode, but the directory service process will not access the block map of the inode; (2) due to the isolation between the file service processes, an inode in It will only be accessed by the only file serving process at a time.

对于本发明提出的基于微内核的可扩展文件系统的负载均衡问题,如果一部分文件服务进程的工作量过载或空闲,那么整体性能会由于处理器的物理核没有得到合理利用而变得很差。文件服务进程必须能够弹性扩展,即服务整体可以随着用户请求的负荷动态地伸缩。本发明中目录服务进程为一个新打开的文件创建静态路由项时实施负载均衡策略。对于每个文件读写请求,利用读写的数据量来衡量负载。这是因为读写过程的时长与数据量近似成正比。文件服务进程使用环形缓冲来存储未处理的请求,并按顺序处理这些消息,因而这些未完成任务的总负载反映了一个文件服务进程当前的工作负载。目录服务进程在路由时首先估计每个文件服务进程的负载值,并选取负载值最低的作为路由目标。目录服务进程在路由一个读写请求时增加相应负载值,而文件服务进程在取得一个排队的请求后并即将处理时减去相应负载值。For the load balancing problem of the microkernel-based scalable file system proposed by the present invention, if the workload of some file service processes is overloaded or idle, the overall performance will become poor because the physical cores of the processor are not properly utilized. The file service process must be able to expand elastically, that is, the service as a whole can be dynamically scaled according to the load requested by users. In the present invention, the directory service process implements a load balancing strategy when creating a static routing item for a newly opened file. For each file read and write request, use the amount of data read and written to measure the load. This is because the duration of the read and write process is approximately proportional to the amount of data. The file serving process uses a ring buffer to store outstanding requests and processes these messages sequentially, so the total load of these outstanding tasks reflects the current workload of a file serving process. When routing, the directory service process first estimates the load value of each file service process, and selects the one with the lowest load value as the routing target. The directory service process increases the corresponding load value when routing a read and write request, and the file service process subtracts the corresponding load value after obtaining a queued request and is about to process it.

目录服务进程还负责监控所有文件服务进程的平均负载,并定期调整文件服务进程的数量。当整体负载偏高时,它将请求微内核分配额外的核来运行新的文件服务进程。新的文件服务进程在初始化和更新状态之后才能开始工作。相反地,当整体负载过低时,一些文件服务进程会被终止,以回收其使用的处理器的物理核资源。在终止前,未处理的请求将被传送回目录服务进程,并重新路由,而其缓存的脏块(dirty block)将被重写回磁盘以确保数据的一致性。The directory service process is also responsible for monitoring the average load of all file service processes and periodically adjusting the number of file service processes. When the overall load is high, it will request the microkernel to allocate additional cores to run new file-serving processes. A new file serving process cannot start working until it has initialized and updated its state. Conversely, when the overall load is too low, some file serving processes will be terminated to reclaim the physical core resources of the processors they use. Before termination, outstanding requests are sent back to the directory service process and rerouted, while its cached dirty blocks are rewritten back to disk to ensure data consistency.

请结合图2,本发明提出的基于微内核的可扩展文件系统的各个服务进程的交互过程是这样的:Please refer to Fig. 2, the interactive process of each service process of the microkernel-based scalable file system proposed by the present invention is as follows:

1.目录服务进程←→文件服务进程1. Directory service process ←→ file service process

在读文件之前,文件服务进程必须获得的元数据包括inode项以及文件描述符信息。用户进程发送的请求中包括了文件描述符ID,缓冲区地址和字节数,请求会被首先发送至目录服务进程的紧急缓冲区中,使其能被优先路由。然后,目录服务进程在用户进程的文件描述符表中检索inode指针,同时目标文件服务进程在路由表中被找到。最后,目录服务进程会将inode号和文件描述符传递该文件服务进程。Before reading a file, the metadata that the file service process must obtain includes inode items and file descriptor information. The request sent by the user process includes the file descriptor ID, the buffer address and the number of bytes, and the request will be sent to the emergency buffer of the directory service process first, so that it can be routed preferentially. Then, the directory service process retrieves the inode pointer in the file descriptor table of the user process, and at the same time the target file service process is found in the routing table. Finally, the directory service process will pass the inode number and file descriptor to the file service process.

2.文件服务进程←→磁盘服务2. File service process ←→ disk service

接收到路由请求后,文件服务进程检索到文件inode并分析块映射图。接着,文件相关的间接块和数据块将被逐块从缓存中读取。如果一个块在哈希表中没找到,那么它将会由磁盘服务加载。脏块的写回策略包括两种:(1)定期写回;(2)当空闲缓存块不够时,使用最近最少使用(Least Recently Used,LRU)策略写回脏块。After receiving the routing request, the file service process retrieves the file inode and analyzes the block map. Next, the indirect blocks and data blocks associated with the file are read from the cache block by block. If a block is not found in the hash table, it will be loaded by the disk service. There are two write-back strategies for dirty blocks: (1) periodic write-back; (2) when there are not enough free cache blocks, use the Least Recently Used (LRU) strategy to write back dirty blocks.

考虑到在文件服务进程的多个工作线程内部存在一个同步问题,在线程加载一个未缓存的块并为其建立新的哈希表项的期间可能会发生数据的不一致。在哈希表建立前,线程会阻塞并等待磁盘服务为其读取块内容。如果随后调度的线程也试图读取相同的块,那么由于该块缓存尚未更新,会导致它再次请求磁盘并建立多余的哈希项。本发明的解决方法是:如果后来的线程试图读取相同块时,将被挂起。当块数据加载完毕后,挂起的线程才被唤醒,并直接从缓存中读取。目录服务进程在读取dentry和inode时也采用类似的方法。Considering that there is a synchronization problem within the multiple worker threads of the file serving process, data inconsistencies may occur during the time a thread loads an uncached block and builds a new hash table entry for it. Before the hash table is built, the thread blocks and waits for the disk service to read the block content for it. If a subsequently scheduled thread also tries to read the same block, it will request disk again and create redundant hash entries since the block cache has not been updated. The solution of the present invention is: if subsequent threads attempt to read the same block, they will be suspended. When the block data is loaded, the suspended thread is woken up and reads directly from the cache. The directory service process also uses a similar method when reading dentry and inode.

3.磁盘服务←→系统任务3. Disk Service ←→ System Task

系统任务为磁盘服务提供了三个接口函数:接口函数1,根据一个端口号执行单次I/O指令;接口函数2,根据多个端口号执行一组I/O指令;接口函数3,开/关中断以及设置中断处理的策略。The system task provides three interface functions for the disk service: interface function 1, execute a single I/O command according to a port number; interface function 2, execute a group of I/O commands according to multiple port numbers; interface function 3, open /Close interrupts and set interrupt handling strategies.

磁盘服务利用上述接口执行直接内存访问操作。当磁盘中断发生时,系统注册的处理函数只是简单地通知磁盘服务。The disk service utilizes the above interface to perform direct memory access operations. When a disk interrupt occurs, the handler function registered by the system simply notifies the disk service.

4.文件服务进程←→系统任务4. File service process ←→ system task

一旦文件服务进程成功读取到块,它会请求系统任务从文件服务进程的地址空间中拷贝数据至用户进程的缓冲区中。Once the file serving process has successfully read the block, it will request the system task to copy the data from the address space of the file serving process to the buffer of the user process.

Claims (7)

1. an extensible file system based on micro-kernel, it is characterised in that including:
Disk service: for the data on disk being loaded onto internal memory or internal storage data being write back disk;
System task: for copied files data between consumer process and file service process, and need to visit at disk service It is helped to perform the franchise I/O instruction of kernel state when asking disk;
Directory service process: work in single process core, the metadata of the management overall situation, block is set and caches for preserving file attribute Information inode and directory information dentry, the All Files receiving consumer process processes request, performs directory traversal, processes institute State the request of operation metadata in document processing request, and the request of reading and writing of files is routed to file service process;
Multiple file service processes: for processing the request of reading and writing of files, be provided with cache pool for data cached blocks of files, institute State data file block and include data block and intermediate mass.
Extensible file system based on micro-kernel the most according to claim 1, it is characterised in that described directory service is entered Estimate the load value of each file service process during journey route according to read-write data volume, and choose the file service that load value is minimum Process is as route target, and described directory service process increases the negative of corresponding document service processes when routeing a read-write requests Load value, described file service process deducts respective load value after obtaining a request queued up and when will process.
Extensible file system based on micro-kernel the most according to claim 1, it is characterised in that described directory service is entered The average load of range monitoring file service process also adjusts file service number of processes.
Extensible file system based on micro-kernel the most according to claim 1, it is characterised in that described metadata includes Directory information dentry, file attribute information inode, superblock list and bitmap block.
Extensible file system based on micro-kernel the most according to claim 1, it is characterised in that described operation metadata Request include opening file, close closed file, create file, create file, enter file and change file attributes.
6. the file access method of an extensible file system based on micro-kernel, it is characterised in that include step: Yong Hujin Journey sends file access request to directory service process, and the parameter of described file access request includes filec descriptor ID, buffering Regional address and the byte number of file request;Directory service process retrieves inode pointer in the filec descriptor table of consumer process, Searched targets file service process the most in the routing table;File destination service processes retrieves file inode and analysis block reflects Penetrating figure, from caching, block-by-block reads the indirect block relevant to demand file and data block, and the block not found in Hash table is by magnetic Dish service loads;File destination service processes Request System task copy from the address space of file service process data to The relief area of family process.
The file access method of extensible file system based on micro-kernel the most according to claim 6, it is characterised in that Estimate that each file service is entered according to read-write data volume during described directory service searched targets file service process in the routing table The load value of journey, and choose the minimum file service process of load value as route target, described directory service process is in route Increasing the load value of corresponding document service processes during one read-write requests, described file service process is obtaining asking of a queuing Respective load value is deducted after asking and when will process.
CN201610378856.1A 2016-06-01 2016-06-01 Extensible file system based on micro-kernel and file access method Pending CN106095817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610378856.1A CN106095817A (en) 2016-06-01 2016-06-01 Extensible file system based on micro-kernel and file access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610378856.1A CN106095817A (en) 2016-06-01 2016-06-01 Extensible file system based on micro-kernel and file access method

Publications (1)

Publication Number Publication Date
CN106095817A true CN106095817A (en) 2016-11-09

Family

ID=57230704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610378856.1A Pending CN106095817A (en) 2016-06-01 2016-06-01 Extensible file system based on micro-kernel and file access method

Country Status (1)

Country Link
CN (1) CN106095817A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368362A (en) * 2017-06-29 2017-11-21 上海阅文信息技术有限公司 A kind of multithreading/multi-process for disk read-write data is without lock processing method and system
CN109669784A (en) * 2017-10-13 2019-04-23 华为技术有限公司 A kind of method and system of interprocess communication
CN111431805A (en) * 2020-03-27 2020-07-17 上海天好信息技术股份有限公司 Internet of things multi-channel signal multiplexing synchronization strategy method
CN111881085A (en) * 2020-06-21 2020-11-03 苏州浪潮智能科技有限公司 Method and system for optimizing read-write bandwidth performance
CN112558858A (en) * 2019-09-10 2021-03-26 无锡江南计算技术研究所 Method for acquiring access characteristics of super-large-scale application external memory based on dynamic IO perception
CN113626190A (en) * 2021-08-04 2021-11-09 电子科技大学 Load balancing method in microkernel operating system facing multi-kernel environment
CN113821483A (en) * 2021-09-23 2021-12-21 瑞芯微电子股份有限公司 File operation method, medium and electronic device
CN114942727A (en) * 2022-05-30 2022-08-26 上海交通大学 Microkernel file system scalable page cache system and method
CN115086328A (en) * 2022-04-30 2022-09-20 济南浪潮数据技术有限公司 Metadata service business processing method, device, equipment and medium
CN115826849A (en) * 2022-10-12 2023-03-21 中国航空工业集团公司洛阳电光设备研究所 An Airborne Recording Device File System
CN117436079A (en) * 2023-12-20 2024-01-23 麒麟软件有限公司 Integrity protection method and system for Linux system
CN118964048A (en) * 2024-10-16 2024-11-15 联想凌拓科技有限公司 A data access method, device, equipment, computer storage medium and computer program product

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710345A (en) * 2009-12-22 2010-05-19 成都市华为赛门铁克科技有限公司 Method and device for storing and reading documents and access system
US20120254535A1 (en) * 2010-12-13 2012-10-04 International Business Machines Corporation Instant data restoration

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101710345A (en) * 2009-12-22 2010-05-19 成都市华为赛门铁克科技有限公司 Method and device for storing and reading documents and access system
US20120254535A1 (en) * 2010-12-13 2012-10-04 International Business Machines Corporation Instant data restoration

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
景香博: "VTOS:多核微内核系统设计与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
钱振江等: "微内核架构文件系统的形式化设计与验证方法研究", 《小型微型计算机系统》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368362B (en) * 2017-06-29 2020-10-30 上海阅文信息技术有限公司 Multithreading/multiprocessing lock-free processing method and system for disk read-write data
CN107368362A (en) * 2017-06-29 2017-11-21 上海阅文信息技术有限公司 A kind of multithreading/multi-process for disk read-write data is without lock processing method and system
CN109669784A (en) * 2017-10-13 2019-04-23 华为技术有限公司 A kind of method and system of interprocess communication
US11892953B2 (en) 2017-10-13 2024-02-06 Huawei Technologies Co., Ltd. Interprocess communication method and interprocess communications system
CN112558858B (en) * 2019-09-10 2022-11-15 无锡江南计算技术研究所 Method for acquiring access characteristics of super-large-scale application external memory based on dynamic IO perception
CN112558858A (en) * 2019-09-10 2021-03-26 无锡江南计算技术研究所 Method for acquiring access characteristics of super-large-scale application external memory based on dynamic IO perception
CN111431805A (en) * 2020-03-27 2020-07-17 上海天好信息技术股份有限公司 Internet of things multi-channel signal multiplexing synchronization strategy method
CN111431805B (en) * 2020-03-27 2021-01-12 上海天好信息技术股份有限公司 Internet of things multi-channel signal multiplexing synchronization strategy method
CN111881085B (en) * 2020-06-21 2022-12-09 苏州浪潮智能科技有限公司 A method and system for optimizing read and write bandwidth performance
CN111881085A (en) * 2020-06-21 2020-11-03 苏州浪潮智能科技有限公司 Method and system for optimizing read-write bandwidth performance
CN113626190A (en) * 2021-08-04 2021-11-09 电子科技大学 Load balancing method in microkernel operating system facing multi-kernel environment
CN113821483A (en) * 2021-09-23 2021-12-21 瑞芯微电子股份有限公司 File operation method, medium and electronic device
CN115086328A (en) * 2022-04-30 2022-09-20 济南浪潮数据技术有限公司 Metadata service business processing method, device, equipment and medium
CN114942727A (en) * 2022-05-30 2022-08-26 上海交通大学 Microkernel file system scalable page cache system and method
CN115826849A (en) * 2022-10-12 2023-03-21 中国航空工业集团公司洛阳电光设备研究所 An Airborne Recording Device File System
CN115826849B (en) * 2022-10-12 2025-02-25 中国航空工业集团公司洛阳电光设备研究所 An airborne recording device file system
CN117436079A (en) * 2023-12-20 2024-01-23 麒麟软件有限公司 Integrity protection method and system for Linux system
CN117436079B (en) * 2023-12-20 2024-04-05 麒麟软件有限公司 Integrity protection method and system for Linux system
CN118964048A (en) * 2024-10-16 2024-11-15 联想凌拓科技有限公司 A data access method, device, equipment, computer storage medium and computer program product

Similar Documents

Publication Publication Date Title
CN106095817A (en) Extensible file system based on micro-kernel and file access method
US10013185B2 (en) Mapping systems and methods of an accelerated application-oriented middleware layer
US7831772B2 (en) System and methodology providing multiple heterogeneous buffer caches
US9189413B2 (en) Read-copy update implementation for non-cache-coherent systems
US7831977B2 (en) Shared file system cache in a virtual machine or LPAR environment
EP3676724B1 (en) Directly mapped buffer cache on non-volatile memory
US20160267132A1 (en) Abstraction layer between a database query engine and a distributed file system
US20160196163A1 (en) Using databases for both transactions and analysis
US20150067283A1 (en) Image Deduplication of Guest Virtual Machines
US11914556B2 (en) Lazy virtual filesystem instantiation and caching
US20130290636A1 (en) Managing memory
US11567680B2 (en) Method and system for dynamic storage scaling
US20190132415A1 (en) Active data management by flexible routing system and methods of an accelerated application-oriented middleware layer
CN114631089A (en) Persistent store file repository for direct mapped persistent store database
Cruz et al. A scalable file based data store for forensic analysis
US10055139B1 (en) Optimized layout in a two tier storage
US11221777B2 (en) Storage system indexed using persistent metadata structures
EP3696688B1 (en) Locking based on categorical memory allocation
US10628391B1 (en) Method and system for reducing metadata overhead in a two-tier storage architecture
US11860785B2 (en) Method and system for efficient communication and command system for deferred operation
US11914637B2 (en) Image scaling cloud database
US11940994B2 (en) Mechanisms for maintaining chains without locks
US11657046B1 (en) Performant dropping of snapshots by converter branch pruning
US20250021525A1 (en) Lock on read techniques for improved file system performance
Bikonda Retina: Cross-Layered Key-Value Store using Computational Storage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161109