CN114489848B - Task unloading method based on computable storage architecture and computable storage system - Google Patents

Task unloading method based on computable storage architecture and computable storage system Download PDF

Info

Publication number
CN114489848B
CN114489848B CN202210060502.8A CN202210060502A CN114489848B CN 114489848 B CN114489848 B CN 114489848B CN 202210060502 A CN202210060502 A CN 202210060502A CN 114489848 B CN114489848 B CN 114489848B
Authority
CN
China
Prior art keywords
task
command
data
execution result
computable
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.)
Active
Application number
CN202210060502.8A
Other languages
Chinese (zh)
Other versions
CN114489848A (en
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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and 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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN202210060502.8A priority Critical patent/CN114489848B/en
Publication of CN114489848A publication Critical patent/CN114489848A/en
Application granted granted Critical
Publication of CN114489848B publication Critical patent/CN114489848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a task unloading method based on a computable storage architecture and a computable storage system, belonging to the field of computer storage, comprising the following steps: initializing: creating virtual character equipment in a kernel address space of an SSD in-disk system, and mapping the kernel address space to an address space of a user process; maintaining a command queue and a data queue in the character equipment, wherein the command queue and the data queue are respectively used for storing a command structure body and a task execution result; the calculation steps are as follows: in the kernel mode, after receiving a calculation task, storing a command structure body into a command queue; in a user state, reading the command structure body from the command queue according to the offset value of the command structure body in the command queue, analyzing the task type and the parameters from the command structure body to execute the calculation task, and storing the execution result into the data queue; in the kernel mode, the length of the execution result and the offset value in the data queue are returned to the host. The invention can reduce the data copying of the system in the disk and improve the PIS task execution efficiency.

Description

Task unloading method based on computable storage architecture and computable storage system
Technical Field
The invention belongs to the field of computer storage, and in particular relates to a task unloading method based on a computable storage architecture and a computable storage system.
Background
With the development of mobile communication technology and internet of things technology, the total amount of data of human society has exploded and increased in an exponential manner. In the event of failure of the old moore's law, the pring prize acquirer jimsgray proposes "new moore's law: i.e., the global new information amount every 18 months is the sum of all information amounts since the computer had history. Based on IDC (internet data center) data, global total data is 33ZB in 2018, and it is expected that 175ZB will be reached in 2025. How to store such data, and how to process the data, has been a challenge facing today's storage systems.
The current computer architecture is based mainly on von neumann architecture. Under this architecture, the computing system and the storage system are separate, each developing independently. In the early stage of Feng Nuoyi ma architecture, the performance of the processor was low, and data needs to be moved from the memory to the processor for processing, and then transferred back to the memory through the bus after processing. However, over the last 20 years, the performance of the processor has been improved by about 55% per year, the improvement rate of the performance of the memory is only about 10% per year, and after long-term accumulation, the calculation rate of the processor has far exceeded the access rate of the memory, and the memory becomes a bottleneck of a high-performance system, which is a problem of a memory wall of a von neumann structure.
For the problem of "memory wall", researchers have proposed to issue the calculation task to the storage device, reduce the movement of data, i.e. PIS (Processing in Storage), and run a small operating system in the storage device to process the calculation task. However, the basic flow of the existing task offloading method is as follows: the host computer issues a calculation task to the SSD (Solid State Disk or Solid State Drive); storing the related structure body by a kernel mode, after a user mode perceives that a PIS task needs to be processed by a polling mode, copying the related structure body from the kernel mode space to an address space of a user process, and processing by the user process to generate a corresponding execution result; after the kernel mode obtains the execution result of the computing task in a polling mode, the execution result is copied from the address space of the user process to the kernel mode space and then returned to the host. The process has the problems of excessive copying times of system data in the disk, lower execution efficiency of the issued calculation task and CPU resource waste.
Disclosure of Invention
Aiming at the defects and improvement demands of the prior art, the invention provides a task unloading method based on a computable storage architecture and a computable storage system, and aims to reduce data copying of an on-disk system and efficiently issue and return PIS tasks.
To achieve the above object, according to one aspect of the present invention, there is provided a task offloading method based on a computable storage architecture including a host and an SSD; the task unloading method comprises an initialization step and a calculation step which are executed in an on-disk system of the SSD;
the initialization step comprises the following steps: creating a virtual character device in a kernel address space of an in-disk system of the SSD, and mapping the kernel address space occupied by the character device to an address space of a user process; maintaining a command queue and a data queue in the character device; the command queue is used for storing a command structure body from the host, the command structure body is used for describing a calculation task issued by the host, and the packaged information comprises a task type and parameters required for executing the task; the data queue is used for storing the execution result of the calculation task issued by the host;
the calculating step comprises the following steps:
(S1) after receiving a calculation task issued by a host in a kernel state, storing a command structure body describing the calculation task into a command queue;
(S2) in a user state, after obtaining an offset value kernel_cmd_offset of a command structure body in a command queue and a corresponding command ID, reading the command structure body from the command queue according to the offset value kernel_cmd_offset, analyzing the task type and parameters of a calculation task from the command structure body, repackaging the calculation task type and parameters into corresponding commands, executing the commands, and storing an execution result in a data queue;
and (S3) in the kernel state, after the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue are obtained, the length and the offset value usr_data_offset are returned to the host.
The invention creates a virtual character device in the kernel address space of the in-disk system of SSD, and maps the kernel address space occupied by the character device to the address space of the user process, thereby enabling the kernel mode and the user mode to share the address space corresponding to the character device, and when processing the calculation task issued by the host, the related structure and data can be stored in the character device, thereby avoiding data copying when switching between the kernel mode and the user mode, effectively reducing the data interaction between the kernel mode and the user mode, and improving the task execution efficiency.
Further, in step (S2), after storing the command structure describing the calculation task in the command queue, it further includes: transmitting an offset value kernel_cmd_offset of the command structure body in the command queue to a user state;
in step (S3), after storing the execution result in the data queue, the method further includes: the command ID, the length of the execution result, and the offset value usr_data_offset of the execution result in the data queue are sent to the kernel mode.
In the invention, after the kernel mode of the SSD in-disk system stores the command structure body in the command queue, the offset value kernel_cmd_offset of the command structure body in the command queue and the corresponding command ID are sent to the user mode, so that the user mode can be actively informed that PIS tasks need to be processed; after the user-state process finishes executing the computing task, the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue are also sent to the kernel state, so that the kernel state can be actively notified, and the computing task is completed. Compared with the traditional task unloading method, the method has the advantages that the kernel mode and the user mode are communicated in a polling mode, and the kernel mode and the user mode of the SSD in-disc system can be actively communicated, so that a calculation task can be timely processed, and waste of CPU resources is avoided.
Further, in the in-disc system of the SSD, communication is performed between the kernel mode and the user mode through a netlink.
The network link is a modularized communication mechanism supporting a multicast bidirectional asynchronous socket mode, and can be initiated by a kernel.
Further, in the initializing step, the kernel address space occupied by the character device is mapped to the address space of the user process through a mmap mechanism.
The mmap is a method for mapping files in a memory, namely, one file or other objects are mapped to the address space of a process, so that a one-to-one mapping relation between file disk addresses and a section of virtual addresses in the virtual address space of the process is realized.
Further, the command queue and the data queue are annular queues.
The invention organizes the command queue and the data queue by the annular queue, and can reduce the memory space occupied by the virtual character equipment.
Further, the task offloading method based on the computable storage architecture provided by the invention further comprises the following steps: a step of issuing a computing task executed at a host end;
the step of issuing the computing task comprises the following steps: and packaging the task type corresponding to the calculation task and parameters required by executing the task into a command structure body, and then issuing the command structure body to the SSD.
Further, the task offloading method based on the computable storage architecture provided by the invention further comprises the following steps: an execution result reading step executed at the host end;
the execution result reading step includes: if the length of the execution result returned by the SSD is greater than 0, applying for a storage space with a size corresponding to the length at the host end, packaging a corresponding read command according to the length and an offset value usr_data_offset, and then issuing the read command to the SSD.
Further, the task unloading method based on the computable storage architecture provided by the invention further comprises a back transmission step executed in an on-disk system of the SSD;
the returning step comprises the following steps: in the kernel mode, after a read command for reading an execution result of a computing task issued by a host is received, the length of the execution result and the offset value usr_data_offset of the execution result in a data queue are analyzed from the read command, and data with the length of length is read from the position with the offset value usr_data_offset in the data queue and returned to the host so as to store the execution result in an applied storage space in the host.
According to another aspect of the present invention, there is provided a computable storage system comprising: a host and an SSD;
the in-disk system of the SSD includes: an initialization module and a calculation module;
the initialization module is used for executing the initialization step in the task unloading method based on the computable storage architecture;
and the calculating module is used for executing the calculating steps in the task unloading method based on the computable storage architecture.
Further, the operating system of the host includes: a calculation task issuing module and an execution result reading module; and, the in-disk system of the SSD further includes: a backhaul module;
the computing task issuing module is used for executing the computing task issuing step in the task unloading method based on the computing storage architecture;
the execution result reading module is used for executing the execution result reading step in the task unloading method based on the computable storage architecture;
and the back transmission module is used for executing the back transmission step of the task unloading method based on the computable storage architecture.
In general, through the above technical solutions conceived by the present invention, the following beneficial effects can be obtained:
(1) The invention creates a virtual character device in the kernel address space of the in-disk system of the SSD, maps the kernel address space occupied by the character device to the address space of the user process, realizes memory sharing between the kernel mode and the user mode, does not need to copy data between the kernel mode and the user mode when processing the calculation task issued by the host, effectively reduces the data interaction between the kernel mode and the user mode, and improves the task execution efficiency.
(2) In the in-disc system of SSD, the memory space applied by the virtual character equipment is organized in a queue form, and when the PIS tasks are calculated by data issued by the host, the PIS tasks can be processed in parallel.
(3) In the invention, active communication can be carried out between the kernel mode and the user mode in the SSD in-disk system, thereby effectively avoiding the waste of CPU resources; in the preferred scheme, the kernel mode and the user mode communicate through the netlink, and the problem of process blocking cannot be caused because the netlink is a full duplex asynchronous communication means.
Drawings
FIG. 1 is a schematic diagram of a task offloading method based on a computable storage architecture according to an embodiment of the present invention;
fig. 2 is a flowchart of a task offloading method based on a computable storage architecture according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
In the present invention, the terms "first," "second," and the like in the description and in the drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
PIS (processing in Storage), i.e. in-store computing, is to combine computing and storing into one, and to put down the computing task of a part of data intensive applications to the storage device, and to use the computing resources in the storage device to perform processing; with PIS, the host side no longer reads a large amount of data from the hard disk, but only needs to read the final execution result.
In the existing scheme for realizing PIS, when a task is unloaded, the problem of excessive copying times of system data in a disk exists, and the problem of lower execution efficiency of an issued computing task is solved. Memory sharing between a kernel mode and a user mode in an SSD (solid state drive) in-disk system is realized, so that the number of data copying times between the kernel mode and the user mode is effectively reduced, and the execution efficiency of a computing task is improved; on the basis, active communication is carried out between the kernel mode and the user mode, so that the waste of CPU resources is avoided.
The invention relates to a computational storage architecture which is applicable, comprising a host and an SSD, wherein the SSD can be installed in the host or at the far end of the host, and the SSD can be installed only by ensuring that the host and the SSD can normally communicate; without loss of generality, in the following embodiment, the SSD is installed at the remote end of the host, and as an alternative implementation, as shown in fig. 1, the SSD and the SSD communicate through an NVMe protocol, and accordingly, corresponding drivers and NVMe devices are mounted on the host end and the system-in-disk end, and processing logic of a custom NVMe admin command is added in the drivers, so as to support issuing and processing of the NVMe command; the on-disc system runs user program to wait for the host to issue calculation task, and is generally a customized Linux operating system, and based on the Linux operating system, appropriate function clipping is performed, which can provide user programmability and security.
Based on the above-mentioned computable storage architecture, in one embodiment of the present invention, a task offloading method based on the computable storage architecture is provided, including an initialization step performed by a system in an SSD disk; referring to fig. 1 and 2, in this embodiment, the initializing step specifically includes:
creating a virtual character device in a kernel address space of an in-disk system of the SSD, and mapping the kernel address space occupied by the character device to an address space of a user process; maintaining a command queue and a data queue in the character device; the command queue is used for storing a command structure body from the host, the command structure body is used for describing a calculation task issued by the host, and the packaged information comprises a task type and parameters required for executing the task; the data queue is used for storing the execution result of the calculation task issued by the host;
optionally, in this embodiment, the kernel address space occupied by the character device is mapped to the address space of the user process by specifically using the mmap mechanism, so that memory sharing between the kernel mode and the user mode can be effectively implemented; it should be noted that mmap is only an alternative implementation of the present invention, and should not be construed as a unique limitation of the present invention, and in other embodiments of the present invention, kernel space may be mapped to address space of a user process using/proc or other manners;
in this implementation, the command queue and the data queue in the virtual character device are shown as cmd and data in fig. 1, respectively; optionally, in this implementation, the command queue and the data queue are both ring queues; the initial addresses of the command queue in kernel mode and user mode are kernel_cmd_addr and usr_cmd_addr respectively, the initial addresses of the data queue in kernel mode and user mode are kernel_data_addr and usr_data_addr respectively, through memory sharing, in this embodiment, kernel_cmd_addr and usr_cmd_addr point to the same physical address, and kernel_data_addr and usr_data_addr point to the same physical address; the offset of the command structure body in the command queue is kernel_cmd_offset, the memory address of the command structure body can be expressed as kernel_cmd_addr+kernel_cmd_offset, the offset of the execution result in the data queue is usr_data_offset, the memory address of the execution result can be expressed as usr_data_addr+usr_data_offset, and the initial values of the kernel_cmd_offset and the usr_data_offset are both 0; the capacity of the data queue and the size of each queue entry are respectively marked as MAX_OFFSET and BYTES_PER_OFFSET, and the capacity of the command queue is the same as the size of the data queue;
in order to avoid CPU resource waste, in this embodiment, active communication is performed between the kernel mode and the user mode, and as shown in fig. 1, as a preferred implementation manner, in this embodiment, communication is performed between the kernel mode and the user mode through a netlink; the netlink is a modularized communication mechanism supporting a multicast bidirectional asynchronous socket mode, and can be initiated by a kernel, in the embodiment, the kernel mode of the SSD in-disk system and the user mode are communicated through the netlink, so that bidirectional and active communication between the kernel mode and the user mode can be efficiently realized, and the problem of process blocking is avoided; since the kernel mode and the user mode use the netlink to communicate, the initialization step of this embodiment further includes:
creating a netlinksocket in a kernel mode for communicating with a user mode;
creating a netlink socket in a user mode, and binding ports for communication with a kernel mode;
it should be noted that netlink is only an alternative embodiment of the present invention, and should not be construed as a unique limitation of the present invention, and in other embodiments of the present invention, communication between the kernel mode and the user mode may be implemented using the per proc, eBPF protocol, etc.
The embodiment also comprises a step of issuing a computing task executed at the host side;
the step of issuing the computing task comprises the following steps: after the task type corresponding to the calculation task and the parameters required by executing the task are packaged into a command structure body, the command structure body is issued to the SSD; in this embodiment, after the encapsulation of the structure is completed, a custom NVMe admin command in the NVMe protocol is called, and the issuing is performed by using ioctl.
The embodiment further includes a calculation step performed by the in-disk system of the SSD, including:
(S1) after receiving a calculation task issued by a host in a kernel state, storing a command structure body describing the calculation task into a command queue;
specifically, the command structure is stored in the command queue by placing the structure data in the address space pointed by the kernel_cmd_addr+kernel_cmd_offset;
since in this embodiment, the kernel mode and the user mode communicate through the netlink, after storing the command structure describing the computing task in the command queue, the kernel mode further includes:
transmitting an offset value kernel_cmd_offset of the command structure body in the command queue to a user state; the command ID is used to uniquely identify the command, and in this embodiment, is automatically generated by the NVMe protocol;
(S2) in a user state, after obtaining an offset value kernel_cmd_offset of a command structure body in a command queue and a corresponding command ID, reading the command structure body from the command queue according to the offset value kernel_cmd_offset, analyzing the task type and parameters of a calculation task from the command structure body, repackaging the calculation task type and parameters into corresponding commands, executing the commands, and storing an execution result in a data queue;
specifically, the user mode can read the command structure body according to usr_cmd_addr+kernel_cmd_offset in the address space;
after the task execution is finished, the storage address of the execution result is usr_data_addr+usr_data_offset;
in this embodiment, since communication is performed between the kernel mode and the user mode through the netlink, after storing the execution result in the data queue, the method further includes: transmitting the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue to a kernel mode;
in order to facilitate the subsequent processing, in this embodiment, when the length of the result is sent to the kernel mode, 512 byte alignment processing is performed first;
it is easy to understand that after storing the execution result in the data queue, the usr_data_offset is updated, and the updated value is: usr_data_offset= (usr_data_offset+1+length% byte_per_offset)% max_offset;
(S3) in the kernel state, after the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue are obtained, the length and the offset value usr_data_offset are returned to the host;
it is easy to understand that after the length and the offset value usr_data_offset are returned to the host, the kernel_cmd_offset is updated, where the updated value is: kernel_cmd_offset= (kernel_cmd_offset+1)% max_offset.
The embodiment further includes: an execution result reading step executed at the host end;
the execution result reading step includes: if the length of the execution result returned by the SSD is greater than 0, applying for a storage space data_buffer with the corresponding size to the length at the host end, packaging a corresponding read command according to the length and an offset value usr_data_offset, and then issuing the read command to the SSD;
it should be noted that, if the length of the execution result returned by the SSD is length=0, it is noted that the execution result is not generated after the execution of the issued calculation task, and the whole task is ended at this time.
The embodiment further includes: a back-pass step performed in an in-disk system of the SSD;
the returning step comprises the following steps: in the kernel mode, after a read command for reading an execution result of a computing task issued by a host is received, the length of the execution result and the offset value usr_data_offset of the execution result in a data queue are analyzed from the read command, and data with the length of length is read from the position with the offset value usr_data_offset in the data queue and returned to the host so as to store the execution result in an applied storage space in the host.
In general, the embodiment creates a virtual character device in a kernel address space of an on-disk system of an SSD, and maps the kernel address space occupied by the character device to an address space of a user process, so that the kernel mode and the user mode can share the address space corresponding to the character device, and when a computing task issued by a host is processed, related structures and data can be stored in the character device, so that when switching between the kernel mode and the user mode is performed, data copying is not required, data interaction between the kernel mode and the user mode is effectively reduced, and task execution efficiency is improved; and because active communication is carried out between the kernel mode and the user mode through the netlink, the waste of CPU resources is effectively avoided.
The technical solution of this embodiment is further explained below by combining two tasks, namely, a file searching task and data decryption.
The offloading process of the file finding task is as follows:
firstly, obtaining a task type corresponding to a file searching task and an operation required by task execution at a host end, wherein the operation comprises a file name, a file searching option and a searching path, packaging the information by using a structure body, calling a self-defined NVMe admin command, issuing by using ioctl, analyzing at an in-disk system end, and placing structure body data in an address space pointed by kernel_cmd_addr+kernel_cmd_offset;
then, the kernel mode uses netlink communication to send command ID (command_id), kernel_cmd_offset and task type to the user mode, actively informs the user mode program that PIS tasks need to be processed, and the user mode program generates corresponding sub-processes according to the type to process; the sub-process reads the command structure body from the address pointed by usr_cmd_addr+kernel_cmd_offset, analyzes the file name, the file searching options and the searching path from the command structure body, repackages the file name, the file searching options and the searching path into a shell command, then uses the pop to execute the shell command, and uses the fread to write the result into usr_data_addr+usr_data_offset;
calculating the length of a result by a user program, performing 512-byte alignment processing on the length, sending command_id, usr_data_offset and length to a kernel mode through a netlink for processing, and updating usr_data_offset= (usr_data_offset+1+length% BYTES_PER_OFFSET)% MAX_OFFSET;
after the kernel mode receives user mode data, the length and usr_data_offset are returned to the host end as results, and kernel_cmd_offset= (kernel_cmd_offset+1)% MAX_OFFSET is updated;
after the host receives the length and the usr_data_offset, the host applies for a space with a corresponding size by taking the length as a parameter, and then issues a corresponding NVMe admin read command according to the encapsulation of the length and the usr_data_offset;
after receiving the issued command, the in-disc system reads the length data from the kernel_data_addr+usr_data_offset according to usr_data_offset in the kernel state, returns the length data to the host end, and ends the task.
The offloading process of the data decryption task is as follows:
the host side obtains LBA (Logic Block Address) and length of a file corresponding to the decrypted data, encapsulates a customized NVMe admin command, then sends the command to the disk, and after the system side in the disk analyzes the command, places the structure data in an address space pointed by kernel_cmd_addr+kernel_cmd_offset;
then, the kernel mode uses netlink communication to send command ID (command_id), kernel_cmd_offset and task type to the user mode, actively informs the user mode program that PIS tasks need to be processed, and the user mode program generates corresponding sub-processes according to the type to process;
the subprocess issues an NVMe read command, reads data in the SSD to a usr_data_addr+usr_data_offset, calculates the length of decrypted data after the decryption of the data in a user state is completed, writes the decrypted data in a new usr_data_addr+usr_data_offset position after 512 bytes are aligned, and sends command_id, usr_data_offset and length to a kernel state for processing through a netlink;
after the kernel mode receives user mode data, the length and usr_data_offset are returned to the host end as results, and kernel_cmd_offset= (kernel_cmd_offset+1)% MAX_OFFSET is updated;
after the host receives the length and the usr_data_offset, applying for a space with a corresponding size at the host by taking the length as a parameter, and then issuing an NVMe admin read command corresponding to encapsulation of the length and the usr_data_offset;
after receiving the issued command, the in-disc system reads the length data from the kernel_data_addr+usr_data_offset according to usr_data_offset, returns the length data to the host end, and ends the task.
In another embodiment of the present invention, there is provided a computable storage system comprising: a host and an SSD;
the in-disk system of the SSD includes: the device comprises an initialization module, a calculation module and a return module; the operating system of the host computer includes: a calculation task issuing module and an execution result reading module;
the initialization module is used for executing the initialization step in the task unloading method based on the computable storage architecture;
the computing module is used for executing the computing steps in the task unloading method based on the computable storage architecture;
the computing task issuing module is used for executing the computing task issuing step in the task unloading method based on the computing storage architecture;
the execution result reading module is used for executing the execution result reading step in the task unloading method based on the computable storage architecture;
the feedback module is used for executing the feedback step of the task unloading method based on the computable storage architecture;
in this embodiment, the specific implementation of each module may refer to the description in the above method embodiment, and will not be repeated here.
It will be readily appreciated by those skilled in the art that the foregoing description is merely a preferred embodiment of the invention and is not intended to limit the invention, but any modifications, equivalents, improvements or alternatives falling within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A task offloading method based on a computable storage architecture, the computable storage architecture comprising a host and an SSD; the task unloading method is characterized by comprising an initialization step and a calculation step which are executed in an on-disk system of the SSD;
the initializing step comprises the following steps: creating a virtual character device in a kernel address space of an in-disk system of the SSD, and mapping the kernel address space occupied by the character device to an address space of a user process; maintaining a command queue and a data queue in the character device; the command queue is used for storing a command structure body from a host, the command structure body is used for describing a calculation task issued by the host, and the packaged information comprises a task type and parameters required by executing the task; the data queue is used for storing the execution result of the calculation task issued by the host;
the calculating step comprises the following steps:
(S1) after receiving a calculation task issued by a host in a kernel state, storing a command structure body describing the calculation task into the command queue;
(S2) in a user state, after obtaining an offset value kernel_cmd_offset of a command structure body in the command queue and a corresponding command ID, reading the command structure body from the command queue according to the offset value kernel_cmd_offset, analyzing the task type and parameters of a calculation task from the command structure body, repackaging the calculation task type and parameters into corresponding commands, executing the commands, and storing an execution result into the data queue;
and (S3) in the kernel state, after the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue are obtained, returning the length and the offset value usr_data_offset to the host.
2. The task offloading method of claim 1, wherein in the step (S2), after storing the command structure describing the computing task in the command queue, further comprises: transmitting an offset value kernel_cmd_offset of the command structure body in the command queue to a user mode;
and, in the step (S3), after storing the execution result in the data queue, the method further includes: and sending the command ID, the length of the execution result and the offset value usr_data_offset of the execution result in the data queue to a kernel mode.
3. The method for offloading tasks based on a computable storage architecture as recited in claim 2, wherein in an on-disk system of the SSD, the kernel mode and the user mode communicate through a netlink.
4. A method of task offloading based on a computable memory architecture as recited in any one of claims 1 to 3, wherein in the initializing step, the kernel address space occupied by the character device is mapped to the address space of the user process through a mmap mechanism.
5. A method of task offloading based on a computable memory architecture as claimed in any one of claims 1 to 3, wherein the command queue and the data queue are ring queues.
6. A method of task offloading based on a computable storage architecture as recited in any one of claims 1 to 3, further comprising: a step of issuing a computing task executed at a host end;
the step of issuing the calculation task comprises the following steps: and packaging the task type corresponding to the calculation task and parameters required by executing the task into a command structure body, and then issuing the command structure body to the SSD.
7. A method of task offloading based on a computable storage architecture as recited in any one of claims 1 to 3, further comprising: an execution result reading step executed at the host end;
the execution result reading step includes: if the length of the execution result returned by the SSD is greater than 0, applying for a storage space with a size corresponding to the length at the host end, packaging a corresponding read command according to the length and an offset value usr_data_offset, and then issuing the read command to the SSD.
8. The method of task offloading based on a computable storage architecture of claim 7, further comprising a back-pass step performed in an on-disk system of an SSD;
the step of returning includes: in the kernel mode, after a read command for reading an execution result of a computing task issued by a host is received, resolving the length of the execution result and the offset value usr_data_offset of the execution result in the data queue from the read command, and starting reading data with the length from the offset value usr_data_offset in the data queue and returning the data to the host so as to store the execution result in an applied storage space in the host.
9. A computable memory system, comprising: a host and an SSD;
the in-disk system of the SSD includes: an initialization module and a calculation module;
the initialization module is configured to perform the initialization step in the task offloading method based on a computable storage architecture according to any one of claims 1 to 5;
the computing module is configured to perform the computing steps in the task offloading method based on a computable storage architecture according to any one of claims 1 to 5.
10. The computable storage system of claim 9, wherein the operating system of the host comprises: a calculation task issuing module and an execution result reading module; and, the in-disk system of the SSD further includes: a backhaul module;
the computing task issuing module is configured to execute the computing task issuing step in the task offloading method based on the computable storage architecture according to claim 6;
the execution result reading module is configured to perform the execution result reading step in the task offloading method based on a computable storage architecture according to claim 7;
the backhaul module is configured to execute the backhaul step of the task offloading method based on a computable storage architecture as claimed in claim 8.
CN202210060502.8A 2022-01-19 2022-01-19 Task unloading method based on computable storage architecture and computable storage system Active CN114489848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210060502.8A CN114489848B (en) 2022-01-19 2022-01-19 Task unloading method based on computable storage architecture and computable storage system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210060502.8A CN114489848B (en) 2022-01-19 2022-01-19 Task unloading method based on computable storage architecture and computable storage system

Publications (2)

Publication Number Publication Date
CN114489848A CN114489848A (en) 2022-05-13
CN114489848B true CN114489848B (en) 2024-02-02

Family

ID=81471792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210060502.8A Active CN114489848B (en) 2022-01-19 2022-01-19 Task unloading method based on computable storage architecture and computable storage system

Country Status (1)

Country Link
CN (1) CN114489848B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107634950A (en) * 2017-09-19 2018-01-26 重庆大学 A kind of method that unloading SSL/TLS agreements are designed using pipeline hardware
CN111190569A (en) * 2019-12-30 2020-05-22 中国科学技术大学 Homomorphic encryption unloading method based on Intel QAT
CN112416250A (en) * 2020-11-19 2021-02-26 深圳电器公司 NVMe (network video Me) -based command processing method for solid state disk and related equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107634950A (en) * 2017-09-19 2018-01-26 重庆大学 A kind of method that unloading SSL/TLS agreements are designed using pipeline hardware
CN111190569A (en) * 2019-12-30 2020-05-22 中国科学技术大学 Homomorphic encryption unloading method based on Intel QAT
CN112416250A (en) * 2020-11-19 2021-02-26 深圳电器公司 NVMe (network video Me) -based command processing method for solid state disk and related equipment

Also Published As

Publication number Publication date
CN114489848A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US11681441B2 (en) Input/output processing in a distributed storage node with RDMA
US10496548B2 (en) Method and system for user-space storage I/O stack with user-space flash translation layer
CN109791471B (en) Virtualizing non-volatile storage at a peripheral device
US9300578B2 (en) Large receive offload functionality for a system on chip
KR101517258B1 (en) Apparatus, system, and method for cross-system proxy-based task offloading
US9092426B1 (en) Zero-copy direct memory access (DMA) network-attached storage (NAS) file system block writing
EP2284702A1 (en) Operating cell processors over a network
KR101747966B1 (en) Autonomous subsystem architecture
US11740812B2 (en) Data storage device idle time processing
CN111309649B (en) Data transmission and task processing method, device and equipment
US11231852B2 (en) Efficient sharing of non-volatile memory
US11863469B2 (en) Utilizing coherently attached interfaces in a network stack framework
CN112463307A (en) Data transmission method, device, equipment and readable storage medium
US11868306B2 (en) Processing-in-memory concurrent processing system and method
CN115033188B (en) Storage hardware acceleration module system based on ZNS solid state disk
CN105677491B (en) A kind of data transmission method and device
CN109857545A (en) A kind of data transmission method and device
KR102326280B1 (en) Method, apparatus, device and medium for processing data
CN113312182B (en) Cloud computing node, file processing method and device
US11507292B2 (en) System and method to utilize a composite block of data during compression of data blocks of fixed size
CN110383254B (en) Optimizing memory mapping associated with network nodes
CN114489848B (en) Task unloading method based on computable storage architecture and computable storage system
US20140380034A1 (en) System and method for redirecting input/output (i/o) sequences
US9135043B1 (en) Interface for enabling an application in a virtual machine to access high performance devices
CN116486868A (en) Computing high speed nonvolatile memory (NVMe) over high speed link (CXL)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant