User Space File Access via Virtual Address Mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional file access methods require switching from user space to kernel space for file access, resulting in increased software running overheads and reduced file access speed due to the need for frequent system calls.
Innovation Solution
A method that allows direct file access in user space by allocating a continuous second virtual address space and establishing a mapping relationship between this space and the physical address space where the file is stored, enabling access without frequent system calls.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If file access is performed through kernel space using system calls, then file access security and stability are ensured, but file access speed decreases and software running overheads increase
Solution Approach 1:
The patent segments the address space into user space and kernel space, with the file system mounted in a specific region of user space (first virtual address space). This allows file access operations to be performed directly in user space without requiring transitions to kernel space, thereby improving file access speed while maintaining security through the isolated file system region.
Solution Approach 2:
The patent introduces a file page table as an intermediary data structure that maps virtual addresses in user space to physical addresses in the file system. This page table acts as a mediator that enables direct user space access to files while maintaining the security and stability normally provided by kernel space management.
2Reliability
If file access is performed through kernel space using system calls, then system control and security are maintained, but software running overheads increase
Solution Approach 1:
The patent enables user space processes to access files directly without requiring kernel space intervention for each file operation. The file system is mounted in user space with its own virtual address space and page table, allowing processes to perform file read/write operations autonomously, thereby eliminating the overhead of repeated system calls and context switches.
Solution Approach 2:
The patent performs preliminary setup by mounting the file system in a specific region of user space and establishing the virtual address space mapping before file access operations begin. This preliminary configuration allows subsequent file operations to proceed directly in user space without repeated kernel space transitions, reducing software running overheads.
3Productivity
If direct file access in user space is implemented, then file access speed improves and overheads reduce, but address space management complexity increases
Solution Approach 1:
The patent applies local quality by creating a dedicated first virtual address space region in user space specifically for file system operations, separate from other user space applications. This localized file system region with its own page table (first page table) simplifies address space management by confining file access operations to a specific, pre-configured area rather than requiring complex global address management.
4Loss of energy
If direct file access in user space is implemented, then software running overheads reduce, but address mapping complexity increases
Solution Approach 1:
The patent implements a nested address mapping structure where the first virtual address space (user space) maps to the first physical address space (file system), and within this structure, a second virtual address space is allocated for continuous file access. This nested mapping approach allows complex address translation to be organized in hierarchical layers, simplifying the overall management of address mappings while enabling direct user space file access.
Data Source
Figure 1-a
Figure 1-b
Figure 2
AI summary
Embodiments of the present invention provide a file access method and apparatus, and a storage system. The method includes: receiving a file access request including a file identifier; accessing first physical address space according to first virtual address space and a first mapping relationship between the first virtual address space and the first physical address space storing a file system; obtaining, from the first physical address space, an index node of an object file indicated by the file identifier; obtaining a file page table according to information that is about the file page table of the object file and included in the index node, where the file page table records second physical address space of the object file; allocating second virtual address space to the object file; establishing a second mapping relationship between the second physical address space and the second virtual address space; and accessing the object file in the second physical address space according to the second virtual address space and the second mapping relationship. Therefore, software running overheads for file access can be effectively reduced, and a file access speed can be improved.