WO2020118650A1 - Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message - Google Patents

Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message Download PDF

Info

Publication number
WO2020118650A1
WO2020118650A1 PCT/CN2018/121054 CN2018121054W WO2020118650A1 WO 2020118650 A1 WO2020118650 A1 WO 2020118650A1 CN 2018121054 W CN2018121054 W CN 2018121054W WO 2020118650 A1 WO2020118650 A1 WO 2020118650A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
page
data page
information table
information
Prior art date
Application number
PCT/CN2018/121054
Other languages
French (fr)
Chinese (zh)
Inventor
胡泉波
徐启明
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2018/121054 priority Critical patent/WO2020118650A1/en
Priority to CN201880014873.4A priority patent/CN111642137A/en
Publication of WO2020118650A1 publication Critical patent/WO2020118650A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • 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/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • G06F12/0882Page mode
    • 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
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1673Details of memory controller using buffers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • This application relates to the field of information technology, and in particular to a method, device, and system for quickly sending a write data preparation complete message.
  • Storage area network (storage area network, SAN) is a high-speed, easily expandable, widely used data storage network, independent of the computer local area network (local area network, LAN).
  • the SAN connects the server and the storage device together, and can provide a dedicated communication channel for any server and any storage device on it.
  • the SAN separates the storage device from the server and realizes the storage resource sharing at the server level.
  • the SAN mainly includes servers, network equipment, and storage equipment. According to different network types, it can be divided into Internet Protocol Storage Area Network (Internet Protocol-SAN, IP-SAN) and Fibre Channel Storage Area Network (Fiber Channel-SAN, FC-SAN).
  • IP-SAN uses IP channels to connect servers and storage devices.
  • FC-SAN uses Fibre Channel to connect servers and storage devices.
  • FC-SAN needs to use some dedicated hardware as a data channel to connect the server and the storage array, these hardware includes Fibre Channel host bus adapter (Fiber Channel-host bus adapter (FC-HBA) card, FC switch, fiber optic cable, optical Modules etc.
  • FC-HBA Fibre Channel host bus adapter
  • the servers in the SAN use the small computer system interface (SCSI) protocol to send data and transmit it to the storage array storage through the FC or IP channel.
  • SCSI small computer system interface
  • the data processing can be "block level" ).
  • the server When the server needs to store data, it will send a SCSI protocol write data command to the storage array; when the server needs to read data, it will send a SCSI protocol read data command to the storage array.
  • the storage array Take the server to issue a SCSI protocol write data command as an example. After the storage array allocates the data storage page, it sends a response message to the server to complete the write data preparation. It needs to cooperate with multiple modules inside the storage array to complete . Multiple modules participate in the processing, which causes the storage array to return a response message to the server that the write data is ready to be delayed too much, which affects the efficiency of data storage.
  • Embodiments of the present application provide a method, device, and system for quickly sending a write data preparation complete message to reduce the delay when sending a write data preparation complete message and improve the efficiency of business processing.
  • an embodiment of the present application provides a storage device, including a processor, a network interface card, and a memory, where:
  • the processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
  • the network interface card is used to receive a write data request, and according to the information of the data page recorded in the data page information table, allocate the data page recorded in the data page information table to cache the write data request to be stored And send a response message to the sender of the write data request to complete the write data preparation; wherein, the write data request is a request to write data to the storage device.
  • the network interface card when the network interface card receives the write data request, it obtains the information of the free data page from the memory, and the free data page can be used to cache the data to be written by the write data request data. In this way, the network interface card can directly obtain the information of the available data pages from the memory, complete the preparation for writing data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card to sending the write data request response message from the network interface card is shortened, and the processing time of the write data request service is improved. effectiveness.
  • the network interface card allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the network interface card allocated to store the data to be cached by the write data request Free data page of the data.
  • the storage device is a storage array
  • the processor is a central processing unit (CPU)
  • the memory is a main memory, such as random access memory (Random Access Memory, RAM)
  • the network interface card can be an FC-HBA card or an Ethernet card.
  • the FC-HBA card is also called a Fibre Channel interface card.
  • the network interface card and the processor may be connected by a Peripheral Component Interconnect Express (PCIe) link.
  • PCIe Peripheral Component Interconnect Express
  • the network interface card and the memory may also be connected through a PCIe link.
  • the processor creates a data page information table in the memory by running a driver of the network interface card during initialization of the network interface card.
  • the data page information table may be created in a memory managed by an operating system (OS) of the storage device, or a base address register (base address register) in the memory of the network interface card , BAR) address space creates the data page information table.
  • OS operating system
  • base address register base address register
  • the data page information table is an information table directly accessible by the network interface card, and the data page information table is also an information table directly accessed by the processor through a driver that runs the network interface card.
  • the memory includes a cache
  • the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table
  • the information of the idle data page recorded in is the information of the idle data page in the cache.
  • the processor is further configured to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page to In the data page information table.
  • the processor may determine the number of idle data pages that can be configured in the data page information table according to a preset ratio by running a driver of the network interface card, or according to a preset algorithm Determine the number of dynamic idle data pages.
  • the driver for the network interface card is a program in the operating system of the storage device, and the processor runs the driver for the network interface card in the operating system of the storage device Applying for an idle data page in the cache, and configuring the information of the applied idle data page into the data page information table.
  • the data page information table includes multiple entries, and each entry is used to record information of an idle data page. That is, an entry in the data page information table records information of an idle data page, and each entry records information of a different idle data page.
  • the information of the idle data page includes physical address information and length information of the idle data page.
  • the data page information table is a page swap queue created in the memory, and the page swap queue contains multiple entries in the form of a queue.
  • the data page information table may also be a linked list or an array created in the memory.
  • the network interface card includes a controller and a network port; wherein,
  • the network port is used to receive the write data request
  • the controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request.
  • the sender of the write data request sends a response message that write data preparation is complete.
  • the processor is further configured to configure at least one of the following information into the controller by running the driver of the network interface card according to the command format of the controller: the page exchange queue Starting address, number of entries, and format of entries.
  • the processor is configured to configure the idle data page requested from the cache into the page exchange queue by running the driver of the network interface card according to a command format preset by the controller .
  • the controller is further configured to migrate the data to be stored in the received write data request to the cache space corresponding to the allocated data page; the processor also uses By running the driver of the network interface card, the free data pages in the memory, such as the free data pages in the cache, are exchanged into the data page information table.
  • the free data pages in the cache are exchanged into the data page information table, which can ensure that there are enough free data pages in the data page information table for allocation, and can avoid the problem of business interruption caused by insufficient free data pages .
  • the processor is further configured to convert a virtual address of the data page information table in the memory to a physical address by running a driver of the network interface card;
  • the network interface card accesses the data page information table through the physical address of the data page information table.
  • an embodiment of the present application provides a network interface card, including a controller and a network port; wherein,
  • the network port is used to receive a write data request through a network, the write data request is a request to write data to a storage device, and the storage device receives a request to write data to the storage device through the network interface card And/or data to be stored;
  • the controller is configured to allocate a data page from the data page recorded in the data page information table to cache the data to be stored in the write data request, and send the write data preparation to the sender of the write data request Response message; wherein, the data page information table is an information table in the memory of the storage device, and the data page is an idle data page in the memory.
  • the controller when the network port receives a write data request, the controller obtains the information of the idle data page from the data page information table in the memory of the storage device, and the idle data page can be used To cache the data to be written in the write data request. In this way, the controller in the network interface card can directly obtain the available data page information from the memory, complete the preparation for writing data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request to the network interface card to sending the write data request response message is shortened, and the time for processing the write data request service is improved. effectiveness.
  • the controller allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the data allocated by the controller to cache the write data request Of free data pages.
  • the network interface card is an FC-HBA card or an Ethernet card.
  • the memory includes a cache
  • the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table
  • the information of the idle data page recorded in is the information of the idle data page in the cache.
  • the controller is further configured to receive configuration information of the data page information table and access the data page information table according to the configuration information of the data page information table; wherein, the The configuration information includes the starting address of the data page information table, the number and format of the table items.
  • the network port is also used to receive the data to be written by the write data request through the network;
  • the controller is also used to cache the data and migrate the data to the memory corresponding to the allocated data page.
  • an embodiment of the present application provides a method for processing a write data request, including:
  • the data page information table is an information table in the memory of the storage device,
  • the data page is a free data page in the memory
  • the method for processing a write data request when receiving a write data request, obtains information of an idle data page from the memory, and the idle data page can be used to cache the write request of the write data request data.
  • the information of available data pages can be directly obtained from the memory, the preparation of the write data can be completed, and a response message can be sent to the sender of the write data request to complete the write data preparation.
  • the time from receiving the write data request to sending the write data request response message is shortened, and the efficiency in processing the write data request service is improved.
  • the allocated data page is used to cache data to be stored by the write data request, and is an idle data page allocated to cache data to be stored by the write data request.
  • the data page information table may be created in a memory managed by the operating system, or the data page information table may be created in other non-cache space of the memory.
  • the memory includes a cache
  • the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table
  • the information of the idle data page recorded in is the information of the idle data page in the cache.
  • the method further includes:
  • the data page information table includes multiple entries, and each entry is used to record information of an idle data page.
  • the information of the data page includes physical address information and length information of the idle data page.
  • the page information table is a page exchange queue created in the memory, and the page exchange queue contains multiple entries in the form of a queue.
  • the method further includes:
  • the method further includes:
  • At least one of the following information is configured into the controller: the starting address of the data page information table, the number of entries, and the format of the entries.
  • an embodiment of the present application provides an information processing system, including a server and a storage device, where the server is used to write data to or read data from the storage device;
  • the storage device includes Processor, network interface card and memory, including:
  • the processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
  • the network interface card is used to receive a write data request sent by the server, and allocate the data page recorded in the data page information table for caching the data page according to the information of the data page recorded in the data page information table Write data to request the data to be stored, and send a response message to the server that write data preparation is complete.
  • the network interface card when receiving the write data request sent by the server, the network interface card obtains the information of the idle data page from the memory, and the idle data page can be used to cache the data to be written by the write data request. In this way, the network interface card can directly obtain the information of the available data pages from the memory, complete the preparation of writing data, and send a response message to the server that the preparation of writing data is complete. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card to sending the write data request response message from the network interface card is shortened, and the processing time of the write data request service is improved. effectiveness.
  • the network interface card allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the network interface card allocated to store the data to be cached by the write data request Free data page of the data.
  • the memory includes a cache
  • the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table
  • the information of the idle data page recorded in is the information of the idle data page in the cache.
  • the processor is further configured to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page to In the data page information table.
  • the data page information table includes multiple entries, and each entry is used to record information of an idle data page.
  • the information of the idle data page includes physical address information and length information of the idle data page.
  • the data page information table is a page swap queue created in the memory, and the page swap queue contains multiple entries in the form of a queue.
  • the network interface card includes a controller and a network port; wherein,
  • the network port is used to receive the write data request
  • the controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request.
  • the sender of the write data request sends a response message that write data preparation is complete.
  • the controller is further configured to migrate the data to be stored in the received write data request to the memory corresponding to the allocated data page;
  • the processor is also used to exchange a free data page in the memory, for example, a free data page in the cache, into the data page information table by running a driver of the network interface card.
  • the processor is further configured to convert a virtual address of the data page information table in the memory to a physical address by running a driver of the network interface card;
  • the network interface card accesses the data page information table through the physical address of the data page information table.
  • the present application provides a computer storage medium for storing computer software instructions for controlling a chip, which includes a program designed to execute the above-mentioned third aspect.
  • the present application provides a computer program.
  • the control chip When a control chip in a computer device or server runs the computer program, the control chip performs the function of the network interface card described in the second aspect.
  • FIG. 1A is a schematic structural diagram of an implementation manner of an FC-SAN system composed of a server and a storage array;
  • FIG. 1B is a schematic diagram of the specific structure of the storage array in FIG. 1A;
  • FIG. 1C is a schematic diagram of the specific structure of the server in FIG. 1A;
  • FIG. 2 is a schematic flowchart of an implementation manner when a server stores data in a storage array
  • FIG. 3 is a schematic structural diagram of an implementation manner of a storage array 300 provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for creating a page exchange queue process provided by an embodiment of this application;
  • FIG. 5 is a schematic flowchart of a processing method after the storage array 300 receives the write data request sent by the server 400;
  • FIG. 6 is a schematic flowchart of a method for a storage array 300 according to an embodiment of the present application to receive data and store data;
  • FIG. 7 is a schematic structural diagram of a storage device 700 provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a network interface card 800 provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of a method for processing a write data request according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an information processing system 100 provided by an embodiment of the present application.
  • a storage array is composed of multiple hard disks to form an array, which is used as a large resource pool. It stores data in different hard drives in a striping manner. When accessing data, the related hard drives in the array work together, which not only guarantees reliability, but also greatly reduces data access time, and has better space. Utilization.
  • FIG. 1A is a schematic structural diagram of an implementation manner of an FC-SAN system.
  • the FC-SAN system includes a server, a storage array, and an optical module switch.
  • the FC-HBA card 1 in the server and the FC-HBA card 2 in the storage array are respectively connected to the optical module switch (also called FC Switch) connection, through the FC switch to achieve communication.
  • FC Switch optical module switch
  • FIG. 1A is just a schematic diagram of a simple structure.
  • the server may further include a CPU and a main memory (eg, random access memory RAM, etc.).
  • the storage array may also include one or more of a disk controller, a hard disk drive (HDD), and a solid-state disk (SSD). It can be understood that, in specific implementation, other connection devices may also be included between the storage array and the server.
  • the optical module switch is not included between the storage array and the server, that is, the storage array and the server are directly connected and communicated.
  • the server in FIG. 1A needs to read data or store data during operation; its storage data or read data includes but is not limited to writing data to or reading data from the storage array.
  • the storage array receives the write data request of the server through the network and writes the data to be stored to the disk of the storage array; or transmits the data in the storage array disk to the storage device according to the read data request of the server server.
  • the optical module switch in FIG. 1A is mainly used for forwarding messages or data between the server and the storage array.
  • FIG. 1B is a schematic diagram of a specific structure of the memory array in FIG. 1A.
  • the storage array includes a physical layer and a software layer.
  • the physical layer includes but is not limited to CPU, FC-HBA card 2, memory and disk.
  • the software layer includes but is not limited to a driver module and a cache module.
  • the drive module is mainly used for driving and initializing the FC-HBA card 2 and the like;
  • the cache module is used for managing cache resources in the memory. It can be understood that the drive module and the cache module are software modules in the operating system of the storage array, and are implemented by the CPU of the storage array executing relevant programs.
  • FIG. 1C is a schematic diagram of a specific structure of the server in FIG. 1A.
  • the server includes a software layer and a physical layer.
  • the physical layer includes but is not limited to the CPU and the FC-HBA card 1
  • the software layer includes but is not limited to the application module.
  • the application module may be an application program in the server operating system, which completes and implements certain functions, and is usually implemented by the CPU of the server executing relevant programs.
  • the application needs to write data to or read data from the storage array through the network, it will send related commands or data to the FC-HBA card 1 through the CPU in the server, and receive related information through the FC-HBA card 1. Data or commands.
  • the video software when the video software needs to store a certain video, it needs to write relevant video data into the storage array.
  • the server sends the write data request and the video data to be stored to the storage array through the optical module switch, and the storage array receives the write data request and the video data forwarded by the optical module switch through the network, and The video data is stored in the disk of the storage array.
  • the process of writing data by the server to the storage array includes:
  • Step S101 When the application module in the server needs to store data, the server sends a write data command to the storage array through the FC-HBA card 1;
  • Step S102 The FC-HBA card 1 in the server sends the write data command to the storage array through the network;
  • Step S103 The FC-HBA card 2 in the storage array receives the write data command, obtains information of the data to be stored according to the write data command and sends it to the drive module of the storage array;
  • Step S104 the driver module applies for an idle data page from the cache module of the storage array according to the information of the data to be stored;
  • Step S105 the cache module allocates an idle data page for storing the data to be cached by the write data command, and sends information such as the address of the allocated idle data page to the drive module;
  • Step S106 the driver module sends the received address and other information of the idle data page to the FC-HBA card 2;
  • Step S107 The FC-HBA card 2 records the address information of the allocated data page, and sends a message to the server FC-HBA card 1 that the data write preparation is complete;
  • Step S108 After receiving the message that the data writing is completed through the FC-HBA card 1, the server sends the data to be stored to the storage array;
  • Step S109 The FC-HBA card 2 receives the data to be stored through the network, and according to the recorded address information of the data page allocated for storing the data to be stored, accesses the data to be stored through direct memory access (direct memory access) , DMA) way to write the allocated data page to notify the drive module that the data reception is completed;
  • direct memory access direct memory access
  • Step S110 The drive module notifies the cache module, and the cache module triggers the storing of the data to be stored in the disk according to the notification of the drive module.
  • Step S111 The cache module returns a write completion message and sends it to the application module in the server through the drive module, FC-HBA card 2, and FC-HBA card 1.
  • the cache module when the cache module confirms that the data to be stored in the cache space has all been stored on the disk of the storage array or all of the backup storage devices, the data to be stored has been stored on the permanent storage disk After that, the cache module sends a write completion message to the driver module, and the drive module sends the write completion message to the server through the FC-HBA card 2 to notify the application module in the server.
  • multiple components in the storage array such as FC-HBA card 2, drive module, and cache module
  • the storage array causes the storage array to return the write data ready to complete message to the server with a long delay, usually the delay will reach more than 20 microseconds.
  • the storage array cannot allocate pages for caching due to the large number of read and write requests that need to be processed, the storage array returns a long delay to the server for error codes.
  • Embodiments of the present application provide a method, device, and system for quickly sending a write data preparation completion message, to reduce the delay from the storage array receiving a write data command to returning a write data preparation completion message, and improve the efficiency of data storage.
  • FIG. 3 is a schematic structural diagram of an implementation manner of a storage array 300 provided by an embodiment of the present application.
  • the storage array 300 includes an FC-HBA card 301, a CPU 302, and a memory 303.
  • the FC-HBA card 301 and the CPU 302 are connected by a PCIe link
  • the FC-HBA card 301 and the memory 303 are connected by a PCIe link
  • the CPU and the memory communicate by PCIe or other methods.
  • the CPU 302 controls the storage array 300 by running the operating system 306.
  • the memory 303 provides a space where the operating system 306 runs and data to be stored or read by the cache storage array 300.
  • the operating system 306 includes but is not limited to the FC driver 304 and the cache module 305.
  • the FC driver 304 can communicate directly with the cache module 305 or indirectly with the cache module 305.
  • the FC driver 304 can communicate with the cache module 305 through other modules.
  • the FC-HBA card 301 includes but is not limited to an FC chip 3011 and an FC port 3012.
  • the FC chip 3011 is the core of the FC-HBA card 301, and may be an FC protocol and a data processing chip, and is mainly used to receive data to be stored sent by the server or send data to the server to be read by the server.
  • the FC port 3012 is a port on the FC-HBA card 301 to communicate with the server.
  • the FC-HBA card 301 can usually include 2 or 4 FC ports ( Figure 3 uses 4 as an example), and the FC port 3012 can be used for insertion.
  • the physical channel for input/output transmission includes but is not limited to a full-duplex input/output channel.
  • the operating system 306 is the operating basis of the software running in the storage array 300, and is mainly used to manage the hardware resources in the storage array 300, such as memory 303 and bus and other hardware resources, as well as providing software modules such as the FC driver 304 and the cache module 305 Operating platform.
  • the FC driver 304 is mainly used to initialize the FC chip 3011 in the FC-HBA card 301, and control the FC-HBA card 301 to receive data to be stored by the server or send data to the server to be read by the server.
  • the cache module 305 is mainly used to manage the data pages in the cache resource pool 3032, write the data in the cache resource pool 3032 to the disk (not shown in FIG. 3) of the storage array 300, or write the data in the disk of the storage array 300
  • the cache is in the cache resource pool 3032.
  • the cache module 305 may also include functions such as initializing the cache resource pool 3032 and executing data hit algorithms.
  • the memory 303 mainly includes an operating system (operating system, OS) managed memory 3031 and a cache resource pool 3032.
  • the memory 3031 managed by the OS is mainly used to support the operation of the operating system and the initialization of the hardware (including but not limited to the initialization of the FC-HBA card 301).
  • the cache resource pool 3032 is mainly used for caching data that the server needs to store or read.
  • FIG. 4 is a schematic flowchart of a method for creating a page exchange queue process provided by an embodiment of the present application. As shown in FIG. 4, the method includes:
  • FC driver 304 is run to initialize the FC chip 3011.
  • the CPU 302 may initialize the FC chip 3011 by running a program related to the FC driver 304.
  • the embodiments of the present application are convenient for description.
  • the FC driver 304 is used to implement related methods or perform related functions, which represents that the CPU 302 implements the relevant method or performs related functions by running the FC driver 304 related programs.
  • a part of the memory is applied to the memory managed by the FC driver 304 operating system 306, and a page swap queue is created according to the preset configuration requirements of the FC chip 3011, and the page swap queue can be directly accessed by the FC chip 3011.
  • the page exchange queue records idle data page information in the form of a queue, and may contain multiple entries, each of which records information of an idle data page. Taking 4 entries in the page exchange queue as an example, entry0 records the page information of page0 in the cache resource pool 3032, entry1 records the page information of page1 in the cache resource pool 3032, entry2 records the page information of the page2 in the cache resource pool 3032 Information, entry3 records the page information of page3 in the cache resource pool 3032.
  • the creation of the page exchange queue in step S402 may be implemented during the initialization of the FC chip 3011 by the FC driver 304.
  • each chip is preset with some basic configuration requirements before shipment, including but not limited to: commands and interfaces for communication between the chip and the driver, and the commands include parameters of the queue and the like.
  • the parameters of the page exchange queue may include: upper and lower limits of elements (such as entries) that the page exchange queue can support, and the format of the entry.
  • the format of the entry in the page swap queue preset by the FC chip 3011 is:
  • the FC driver 304 may create a page exchange queue according to the format of the entry preset by the FC chip 3011.
  • the page exchange queue created by the FC driver 304 may contain N entries, where N is a positive integer greater than or equal to 2.
  • the entry is an entry in the queue for recording basic information of a data page, including but not limited to the physical address of the data page and the length of the data page.
  • the data page is the smallest unit of a common memory management method, and its size can be 4KB or 8KB.
  • the entry may also include identification information of each entry, etc. The identification information is used to indicate whether an idle data page recorded for the entry has been allocated for buffering data.
  • the FC driver 304 can apply for a part of memory other than the specific memory reserved by the OS from the memory managed by the OS, which is used to create a page exchange queue.
  • the specific memory includes memory necessary for the operation of the OS, or memory reserved in the OS by other external devices. These memories are either used exclusively for OS operation or for other external devices. The FC driver 304 cannot access these memories.
  • the address corresponding to the memory requested by the FC driver 304 from the memory managed by the OS is a virtual address.
  • the FC driver 304 needs to virtualize the created page swap queue.
  • the address is converted into a physical address, and is allocated to the FC chip 3011 when the FC chip 3011 is initialized. In this way, the FC chip 3011 can directly access the page exchange queue. That is, the FC chip 3011 can directly read the information of the idle data pages recorded in the page exchange queue without the participation of other software modules or hardware, for example, it does not need to obtain the information of the idle data pages through the driver.
  • FC driver 304 converts the virtual address to a physical address, and a general address conversion method can be used.
  • the operating system 306 will address hardware devices (including memory 303) uniformly and maintain a mapping relationship between a virtual address and a physical address.
  • the FC driver 304 may perform virtual address and mapping based on the mapping relationship maintained by the operating system 306. Translation between physical addresses.
  • FC driver 304 can also directly access the page swap queue created by the FC driver 304, that is, the FC driver 304 and the FC chip 3011 share the created page swap queue.
  • FC driver 304 applies for M data pages from the cache resource pool to cache the data that the storage array 300 needs to store;
  • M is a positive integer greater than or equal to 1.
  • the M data pages requested by the FC driver 304 from the cache resource pool are idle data pages, and these data pages can be used to cache the data that the storage array 300 needs to store.
  • the number M of data pages requested by the FC driver 304 from the cache resource pool may be determined in different scenarios under different scenarios.
  • One way is to configure according to the read-write ratio of typical scenarios of storage services. For example, a common database business is a read-write ratio of 7:3, and the FC driver 304 can apply for 30% of the data pages in the cache resource pool 3032 to be shared in the page exchange queue.
  • the value of M can be flexibly configured to cache data and cause resources to be idle. For example, through a configuration interface, the value configured by the user according to the requirements of different business scenarios is received through the configuration interface.
  • the FC driver 304 applies to the cache resource pool 3032 for the data page according to the received value of M.
  • the specific software in the storage array 300 can also automatically adjust the value of the number M of data pages in the page swap queue according to the actual business situation of the storage array 300 through a preset algorithm.
  • the embodiments of the present application do not limit specific implementation manners.
  • FC driver 304 configures the information of the applied data page to the entry in the page exchange queue
  • the information of the data page includes but is not limited to the physical address and length information of the data page.
  • the information of a data page can be configured into an entry of the page exchange queue.
  • Each entry separately records information on different data pages.
  • the FC driver 304 records the physical address and length information of a data page applied to a variable corresponding to an entry.
  • FC driver 304 configures the information of the page exchange queue to the FC chip 3011.
  • the information of the page exchange queue includes one or more of the starting address, the number of entries, and the format of the entry of the page exchange queue.
  • a preset command set is configured.
  • the driver of the chip will perform related configuration according to the preset command set.
  • the FC driver 304 may configure the information of the page exchange queue into the FC chip 3011 according to the command set preset by the FC chip 3011.
  • the pre-configured command set of the FC chip 3011 is:
  • the FC driver 304 fills in the command set with the starting address, number of entries, and other queue information of the page exchange queue according to the format requirements of the command set, and then sends the filled command set to the FC chip 3011.
  • the FC chip 3011 can access the page exchange queue and obtain the information of the free data pages in the cache resource pool 3032 through the page exchange queue.
  • the FC chip 3011 can determine the information of the data page that can be used to cache data from the page exchange queue according to the write data request sent by the server, and return to the server that the write data preparation is complete Response message.
  • the FC driver 304 may also send the information of the page exchange queue (including but not limited to the start address and entry of the page exchange queue after the creation of the page exchange queue after step S402 above) The number, format, etc.) are configured or shared with the FC chip 3011.
  • FIG. 5 is a schematic flowchart of a processing method after the initialized storage array 300 in FIG. 4 receives the write data request sent by the server 400.
  • the server 400 and the storage array 300 are connected through a network.
  • the server 400 and the storage array 300 may be connected through an optical module switch through a network connection.
  • the application module in the server 400 needs to store data, it sends a command to write data to the storage array 300 through the FC-HBA card 401.
  • the method includes:
  • Step S501 When an application module in the server 400 (usually a software module in the service layer in the server) needs to store data, the server 400 sends a write data request to the storage array 300 through the FC-HBA card 401;
  • the write data request sent by the server 400 may be implemented by sending a write data command.
  • the embodiment of the present application does not limit the specific implementation manner of the server 400 sending the write data request.
  • Step S502 The FC-HBA card 301 in the storage array 300 receives the write data request
  • the FC-HBA card 301 receives the write data request sent by the server 400 through the network or directly through the FC port 3012.
  • Step S503 The FC-HBA card 301 parses the write data request and allocates the data page;
  • the FC chip 3011 in the FC-HBA card 301 parses the write data request sent by the server 400, and allocates a data page for buffering the data to be stored in the write data request according to the data page recorded in the page exchange queue.
  • the FC chip 3011 allocates the data page recorded in the entry 0 in the page swap queue to cache the data write request. Stored data. If the data to be stored in the write data request requires multiple data pages to be cached, the FC chip 3011 allocates multiple data pages of entry records in the page swap queue to cache the data to be stored in the write data request.
  • the FC-HBA card 301 can allocate data pages according to the information of the data pages recorded in the entry of the page exchange queue in the following manner:
  • each entry in the page exchange queue has an identification bit, which is used to identify whether the idle data page recorded by the entry has been occupied. For example, the identification bit of an entry is 0, indicating that the free data page in the entry is not allocated; the identification bit of an entry is 1, indicating that the free data page in the entry has been allocated.
  • the FC-HBA card 301 can select an entry to allocate an idle data page according to the identification bit of each entry.
  • FC-HBA card 301 allocates free data pages from the entry at the beginning of the page exchange queue, records the location information of the last used entry after each allocation, and the next time the data page is allocated, According to the last entry of the last entry used in the previous record, the corresponding free data page is allocated from the corresponding entry.
  • the idle data pages exchanged from the cache resource pool are sequentially increased at the end of the queue to ensure that the page exchange queue has sufficient idle data pages for the FC-HBA card 301 to allocate.
  • Step S504 The FC-HBA card 301 sends a response message to the server 400 that the write data preparation is complete.
  • FC chip 3011 in the FC-HBA card 301 is allocated to an idle data page used to cache the data to be stored in the write data request
  • FC chip 3011 is successfully allocated to the cache data request
  • a response message of writing data preparation completion is sent to the server 400 through the FC port 3012 to notify the server 400 that the storage array 300 is ready to receive data.
  • the FC chip 3011 no longer requests the cache module 305 to allocate the data page in the cache resource pool 3032 through the FC driver 304, which can avoid the time delay caused by applying the data page through the FC driver 304 and the cache module 305, and can improve the The server returns the speed and efficiency of writing data ready to complete the message.
  • FIG. 6 is a schematic flowchart of a method for a storage array 300 according to an embodiment of the present application to receive data and store data.
  • the method flow is a process in which the storage array 300 receives the data sent by the server 400 and performs storage after sending a response message to the server 400 that the write data preparation is completed according to the method shown in FIG. 5.
  • the storage array in FIG. 6 further includes a hard disk management module 307 and a storage space 308.
  • the hard disk management module 307 is used to manage the storage space 308 in the storage array 300, including but not limited to writing the data in the cache resource pool 3032 into the storage space 308.
  • the storage space 308 is a physical space where the storage array 300 stores data, and may be an HDD, an SSD, or the like.
  • the hard disk management module 307 may also include multiple sub-modules, and the functions of the hard disk management module 307 may be jointly implemented by multiple different sub-modules, which is not specifically limited in the embodiments of the present application.
  • the storage array 300 receives and stores data as follows:
  • Step 1 The FC port 3012 of the FC-HBA card 301 receives the data delivered by the server, and the FC chip 3011 caches the data received by the FC port 3012 in the hardware cache space inside the FC chip 3011;
  • Step 2 The FC chip 3011 obtains the information of the allocated data page from the page exchange queue
  • FIG. 6 takes the data page recorded by entry0 as the allocated data page as an example for description.
  • the entry0 is an entry allocated when the FC chip 3011 receives the write data request sent by the server 400, and information of the allocated data page is recorded in the entry0. For example, in the above step S503, the entry allocated by the FC chip 3011 for recording the allocated data page information.
  • the FC chip 3011 when the data page allocated by the FC chip 3011 in the above step S503 occupies multiple entries, the FC chip 3011 correspondingly acquires information of the data page from the multiple entries.
  • Step 3 FC chip 3011 migrates the received data to the data page recorded in entry 0 through DMA;
  • the FC chip 3011 migrates the received data to the storage space of the data page (eg, page0) corresponding to the physical address by DMA according to the physical address of the data page (eg, page0) recorded in entry0.
  • the storage space of the data page is the storage space in the cache resource pool 3032.
  • Step 4 The FC chip 3011 sends a notification message to the FC driver 304 that the data reception is completed, and the notification message includes the physical address of the data page page 0;
  • Step 5 The FC driver 304 sends a notification to the cache module 305 to notify the cache module 305 to process the data in the data page page 0;
  • Step 6 The cache module 305 notifies the hard disk management module 307 to process the data in the data page page 0;
  • Step 7 The hard disk management module 307 stores the data in the data page page 0 into the corresponding storage space 308;
  • Step 8 The cache module 305 notifies the FC driver 304 of the physical address of an idle data page (for example, pagem);
  • the cache resource pool 3032 needs to be The free data pages in the page are swapped into the page cache queue. In this step, the FC driver 304 is notified of the page, that is, the idle data page is used to exchange the already occupied data page page 0.
  • the idle data pages in the cache resource pool 3032 are exchanged into the page exchange queue, the same number of idle data pages can be determined from the cache resource pool 3032, and the determined idle data pages can be configured in the page exchange queue .
  • the same number is the number of data pages recorded in the page exchange queue and used to cache data.
  • the data received in step 1 needs to occupy 3 data pages.
  • the FC chip 3011 migrates the received data to the cache space corresponding to the 3 data pages by DMA, 3 more are determined from the cache resource pool 3032 Idle data pages and configure them in the page exchange queue. In this way, it can be ensured that there are enough data pages in the page exchange queue for the FC chip 3011 to allocate for data buffering.
  • step 7 does not limit the execution order of step 7 and step 8, the two steps may be executed in parallel, or step 8 may be executed first, and then step 7.
  • the number M of data pages requested by the FC driver 304 from the cache resource pool may also be greater than the number of data pages required by actual business requirements.
  • the storage array 300 needs 500 data pages to cache the data to be stored within a certain period of time, and the FC driver 304 can apply for 1000 data pages from the cache resource pool.
  • the 500 additional data pages in the data pages requested by the FC driver 304 can avoid the problem of caching failure due to insufficient data pages due to the partial data that has not been exchanged into the page exchange queue.
  • Step 9 The FC driver 304 configures the information of the data page page (including but not limited to the physical address and size of the page) to entry 0.
  • FIGS. 3-6 are described by taking the FC-SAN scenario in which the storage array receives the write data request sent by the server through the FC-HBA as an example. It can be understood that, in other scenarios, the implementation manner when a device with storage capability receives a write data request sent by another device through a network interface card can be implemented by referring to the implementation manners shown in FIG. 3 to FIG. 6 described above.
  • the storage array can receive the write data request sent by the server through the Ethernet interface card and perform corresponding processing.
  • the Ethernet network interface card may be a network interface card that supports data forwarding and offloading.
  • a page exchange queue may also be created in other parts of the memory, for example, the BAR address space of the FC-HBA card 301 in the memory.
  • FC chip 3011 From the perspective of the FC chip 3011 quickly acquiring the free data page information in the cache, it is also possible to create a page exchange queue in the cache space of the FC chip 3011. In this way, when the FC chip 3011 receives the write data request, it can quickly obtain the information of the free data page from the local cache.
  • a communication channel such as a PCIe link
  • the exchanged data pages need to be transferred through the PCIe link between the memory and the FC chip 3011 Information, the efficiency of page exchange will be lower than the way to create a page exchange queue in memory.
  • the page swap queue records data page information that is free in the cache as an example.
  • the free data pages in the cache can also be recorded in other forms, for example, in other ways such as arrays or linked lists. That is, the page exchange queue is only an implementation method for recording data page information, and other record tables capable of recording data page information, such as a data page information table, are within the scope disclosed in the embodiments of the present application.
  • These data page information tables record data page information that is free in the cache, and in combination with other technical features provided by the embodiments of the present application, can also solve the technical problems to be solved by the present application. Only in the specific implementation, the implementation method will be slightly different due to the characteristics of each form. For example, the address of the entry in the page exchange queue is usually continuous, and because the linked list determines the address of the next entry through the pointer, the address of its entry is not all continuous.
  • FIG. 7 is a schematic structural diagram of a storage device 700 according to an embodiment of the present application.
  • the storage device 700 includes a processor 701, a network interface card 702, and a memory 703, where:
  • the processor 701 is configured to create a data page information table in the memory 703 by running a driver of the network interface card 702, and the data page information table is used to record information of free data pages in the memory ;
  • the network interface card 702 is configured to receive a write data request, and allocate the data pages recorded in the data page information table to cache the data write request according to the data page information recorded in the data page information table The stored data, and send a response message to the sender of the write data request that the write data preparation is completed; wherein, the write data request is a request to write data to the storage device 700.
  • the network interface card 702 when the network interface card 702 receives the write data request, it obtains the information of the idle data page from the memory 703, and the idle data page can be used to cache the write data request. The written data. In this way, the network interface card 702 can directly obtain the information of the available buffer space from the memory 703, complete the preparation of the write data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device 700 to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card 702 to the network interface card 702 sending the write data request response message is shortened, and processing the write data request is improved Business efficiency.
  • the memory 703 includes a cache, which is used to temporarily store data written to the storage device 700 or to temporarily store data read from the storage device 700, in the page information table
  • the recorded information of the idle data page is information of the idle data page in the cache.
  • the implementation manner of the foregoing storage device 700 may be implemented with reference to the implementation manner of the storage array 300 shown in FIG. 3 to FIG. 6 in the embodiment of the present application.
  • the implementation of the processor 701 can refer to the implementation of the CPU 302 in the storage array 300
  • the implementation of the network interface card 702 can refer to the implementation of the FC-HBA card 301
  • the implementation of the memory 703 can refer to the implementation of the memory 303
  • the implementation method of the data page information table can be implemented by referring to the implementation method of the page exchange queue, which will not be described in detail.
  • the functions or steps implemented by the FC driver 304 shown in FIGS. 3-6 are implemented by the CPU 302 by running the driver program of the FC-HBA card 301, that is, the functions or steps implemented by the FC driver 304 It may be implemented by the processor 701 by running the driver of the network interface card 702.
  • FIG. 8 is a schematic structural diagram of a network interface card 800 according to an embodiment of the present application.
  • the network interface card 800 includes a controller 801 and a network port 802; wherein,
  • the network port 802 is used to receive a write data request through a network, the write data request is a request to write data to a storage device, and the storage device receives write data to the storage device through the network interface card 800 Requests and/or data to be stored;
  • the controller 801 is configured to allocate a data page from the data pages recorded in the data page information table to cache the data to be stored in the write data request, and send the write data preparation to the sender of the write data request to be completed Response message; wherein, the data page information table is an information table in the memory of the storage device, and the data page is an idle data page in the memory.
  • the controller 801 when the network port 802 receives the write data request, the controller 801 obtains information of idle data pages from the data page information table in the memory of the storage device, the idle data The page can be used to cache the data to be written by the write data request. In this way, the controller 801 in the network interface card 800 can directly obtain the information of the available buffer space from the memory, complete the preparation of the write data, and send a response message to the sender of the write data request to complete the write data preparation.
  • the time from receiving the write data request from the network interface card 800 to sending the write data request response message is shortened, and the time for processing the write data request service is improved s efficiency.
  • the implementation manner of the network interface card 800 may be implemented by referring to the implementation manner of the FC-HBA card 301 shown in FIGS. 3 to 6 in the embodiment of the present application.
  • the implementation manner of the controller 801 may refer to the implementation manner of the FC chip 3011
  • the implementation manner of the network port 802 may refer to the implementation manner of the FC port 3012.
  • FIG. 9 is a schematic flowchart of a method for processing a write data request according to an embodiment of the present application, including:
  • Step 900 Receive a write data request, which is a request to write data to a storage device
  • Step 902 According to the information of the data page recorded in the data page information table, allocate a data page for buffering the data to be written by the write data request; wherein, the data page information table is in the memory of the storage device Information table, the data page is a free data page in the memory;
  • Step 904 Send a response message to the sender of the data write request to complete the data write preparation.
  • the idle data page when a write data request is received, information of an idle data page is obtained from the memory, and the idle data page can be used to cache the data to be written by the write data request.
  • the available buffer space information can be directly obtained from the memory, the preparation of the write data can be completed, and a response message can be sent to the sender of the write data request to complete the write data preparation.
  • the time from receiving the write data request to sending the write data request response message is shortened, and the efficiency in processing the write data request service is improved.
  • the implementation manner of the above method may be implemented by referring to the implementation manners shown in FIG. 3 to FIG. 6 in the embodiments of the present application.
  • step 900 reference may be made to the implementation of step S502 in FIG. 5, for step 902, reference may be made to the implementation of step S503 in FIG. 5, and for step 904, reference may be made to the implementation of step S504 in FIG. 5, which is not described in detail.
  • the method flow shown in FIG. 9 can be further implemented by referring to the method flow shown in FIG. 4 and FIG. 6, and details are not described again.
  • FIG. 10 is a schematic structural diagram of an information processing system 100 according to an embodiment of the present application.
  • the storage device 100 includes a server 101 and a storage device 102.
  • the server 100 is used to write data to or read data from the storage device 102;
  • the storage device 102 includes a processor 1021, a network interface card 1022, and Memory 1023 where:
  • the processor 1021 is configured to create a data page information table in the memory 1023 by running a driver of the network interface card 1022, and the data page information table is used to record information of free data pages in the memory ;
  • the network interface card 1022 is configured to receive the write data request sent by the server 101, and allocate the data pages recorded in the data page information table for caching according to the information of the data pages recorded in the data page information table
  • the write data requests the data to be stored, and sends a response message to the server 101 that the write data preparation is complete.
  • the network interface card 1022 when receiving the write data request sent by the server 101, the network interface card 1022 obtains the information of the free data page from the memory 1023, and the free data page can be used to cache the Write data request data to be written. In this way, the network interface card 1022 can directly obtain the information of the available buffer space from the memory 1023, complete the preparation of the write data, and send a response message to the server 101 that the write data preparation is completed. Since there is no need for multiple modules in the storage device 102 to cooperate with each other to determine the available buffer space, the time from receiving the write data request from the network interface card 1022 to sending the write data request response message from the network interface card 1022 is shortened, and processing the write data request is improved Business efficiency.
  • the memory 1023 further includes a cache, which is used to temporarily store data written to the storage device 102 or to temporarily store data read from the storage device 102, and the page information table
  • the information of the idle data page recorded in is the information of the idle data page in the cache.
  • the implementation manner of the foregoing information processing system 100 may be implemented with reference to the implementation manners of the storage array 300 and the server 400 shown in FIGS. 3 to 6 in the embodiment of the present application.
  • the implementation of the server 101 can refer to the implementation of the server 400
  • the implementation of the processor 1021 can refer to the implementation of the CPU 302 in the storage array 300
  • the implementation of the network interface card 1022 can refer to the implementation of the FC-HBA card 301
  • the implementation of the memory 1023 can refer to the implementation of the memory 303
  • the implementation of the data page information table can refer to the implementation of the page exchange queue, and details will not be described in detail.
  • the functions or steps implemented by the FC driver 304 shown in FIGS. 3-6 are implemented by the CPU 302 by running the driver program of the FC-HBA card 301, that is, the functions or steps implemented by the FC driver 304 It can be implemented by the processor 1021 by running the driver of the network interface card 1022.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the modules is only a division of logical functions.
  • there may be other divisions for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections through some interfaces, devices, or units, and may also be electrical, mechanical, or other forms of connection.
  • the units described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present invention.
  • each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or software functional unit.
  • the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present invention essentially or part of the contribution to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium
  • several instructions are included to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage media include various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a RAM, a magnetic disk, or an optical disk.

Abstract

A method for processing a write data request, and a storage device, and a system for processing a write data request. The method comprises: receiving a write data request, wherein the write data request is a request for writing data into a storage device; allocating, according to information of a data page recorded in a data page information table, a data page for caching data to be written by the write data request, wherein the data page information table is an information table in a memory in the storage device, and the data page is an idle data page in the memory; and sending a response message of write data preparation completion to a sender of the write data request. By means of directly acquiring, from a memory, information of a data page for caching, and sending a response message of write data preparation completion, the time from receiving a write data request to sending a write data request response message is shortened, and efficiency of processing a write data request service is improved.

Description

快速发送写数据准备完成消息的方法、设备和系统Method, equipment and system for quickly sending write data ready message 技术领域Technical field
本申请涉及信息技术领域,特别涉及一种快速发送写数据准备完成消息的方法、设备和系统。This application relates to the field of information technology, and in particular to a method, device, and system for quickly sending a write data preparation complete message.
背景技术Background technique
存储区域网络(storage area network,SAN)是一种高速的、易扩展的、广泛用于数据存储的网络,独立于计算机局域网(local area network,LAN)。SAN将服务器和存储设备连接在一起,能够为其上的任意一台服务器和任意一台存储设备提供专用的通信通道。SAN将存储设备从服务器中独立出来,实现了服务器层次上的存储资源共享。Storage area network (storage area network, SAN) is a high-speed, easily expandable, widely used data storage network, independent of the computer local area network (local area network, LAN). The SAN connects the server and the storage device together, and can provide a dedicated communication channel for any server and any storage device on it. The SAN separates the storage device from the server and realizes the storage resource sharing at the server level.
SAN中主要包括服务器、网络设备、存储设备。根据不同的网络类型,可以分为互联网协议存储区域网络(Internet Protocol-SAN,IP-SAN)和光纤通道存储区域网络(Fiber Channel-SAN,FC-SAN)。IP-SAN使用IP通道连通服务器和存储设备。FC-SAN使用光纤通道连通服务器和存储设备。FC-SAN需要使用到一些专用的硬件,作为数据的通道连接服务器与存储阵列,这些硬件包括光纤通道主机总线适配器(Fiber Channel-host bus adapter,FC-HBA)卡、FC交换机、光纤线、光模块等。The SAN mainly includes servers, network equipment, and storage equipment. According to different network types, it can be divided into Internet Protocol Storage Area Network (Internet Protocol-SAN, IP-SAN) and Fibre Channel Storage Area Network (Fiber Channel-SAN, FC-SAN). IP-SAN uses IP channels to connect servers and storage devices. FC-SAN uses Fibre Channel to connect servers and storage devices. FC-SAN needs to use some dedicated hardware as a data channel to connect the server and the storage array, these hardware includes Fibre Channel host bus adapter (Fiber Channel-host bus adapter (FC-HBA) card, FC switch, fiber optic cable, optical Modules etc.
通常情况下,SAN中的服务器使用小型计算机系统接口(small computer system interface,SCSI)协议发送数据,并通过FC或IP通道,传输到存储阵列存储,数据的处理可以是“块级”(block level)。当服务器需要存储数据时,会发送一个SCSI协议的写数据命令到存储阵列;当服务器需要读取数据时,会发送一个SCSI协议的读数据命令到存储阵列。Normally, the servers in the SAN use the small computer system interface (SCSI) protocol to send data and transmit it to the storage array storage through the FC or IP channel. The data processing can be "block level" ). When the server needs to store data, it will send a SCSI protocol write data command to the storage array; when the server needs to read data, it will send a SCSI protocol read data command to the storage array.
以服务器下发一个SCSI协议的写数据命令为例,存储阵列在分配存放数据的页面后,再发送写数据准备完成的响应消息给服务器,需要经过存储阵列内部的多个模块的相互配合才能完成。多个模块参与处理,导致存储阵列向服务器返回写数据准备完成的响应消息时延过大,影响到数据存储的效率。Take the server to issue a SCSI protocol write data command as an example. After the storage array allocates the data storage page, it sends a response message to the server to complete the write data preparation. It needs to cooperate with multiple modules inside the storage array to complete . Multiple modules participate in the processing, which causes the storage array to return a response message to the server that the write data is ready to be delayed too much, which affects the efficiency of data storage.
发明内容Summary of the invention
本申请实施例提供一种快速发送写数据准备完成消息的方法、设备和系统,以降低发送写数据准备完成消息时的时延,提高业务处理的效率。Embodiments of the present application provide a method, device, and system for quickly sending a write data preparation complete message to reduce the delay when sending a write data preparation complete message and improve the efficiency of business processing.
第一方面,本申请实施例提供一种存储设备,包括处理器、网络接口卡和内存,其中:In a first aspect, an embodiment of the present application provides a storage device, including a processor, a network interface card, and a memory, where:
所述处理器,用于通过运行所述网络接口卡的驱动程序,在所述内存中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
所述网络接口卡,用于接收写数据请求,根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述 写数据请求是向所述存储设备写入数据的请求。The network interface card is used to receive a write data request, and according to the information of the data page recorded in the data page information table, allocate the data page recorded in the data page information table to cache the write data request to be stored And send a response message to the sender of the write data request to complete the write data preparation; wherein, the write data request is a request to write data to the storage device.
本申请实施例提供的存储设备,其网络接口卡在接收到写数据请求时,从内存中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡能够直接从内存获取可用的数据页面的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。由于不需要存储设备中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡接收写数据请求到网络接口卡发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the storage device provided in the embodiment of the present application, when the network interface card receives the write data request, it obtains the information of the free data page from the memory, and the free data page can be used to cache the data to be written by the write data request data. In this way, the network interface card can directly obtain the information of the available data pages from the memory, complete the preparation for writing data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card to sending the write data request response message from the network interface card is shortened, and the processing time of the write data request service is improved. effectiveness.
其中,所述网络接口卡分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,是所述网络接口卡分配到用于缓存所述写数据请求所要存储的数据的空闲数据页面。Wherein, the network interface card allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the network interface card allocated to store the data to be cached by the write data request Free data page of the data.
可选的,所述存储设备是存储阵列,所述处理器为中央处理器(central processing unit,CPU),所述内存为主存储器,例如随机存取存储器(Random Access Memory,RAM),所述网络接口卡可以是FC-HBA卡或以太网卡。本申请实施例中,FC-HBA卡也称作光纤通道接口卡。所述网络接口卡与所述处理器之间可以通过快速外围部件互联(Peripheral Component Interconnect Express,PCIe)链路连接。所述网络接口卡与所述内存之间也可以通过PCIe链路连接。Optionally, the storage device is a storage array, the processor is a central processing unit (CPU), and the memory is a main memory, such as random access memory (Random Access Memory, RAM), The network interface card can be an FC-HBA card or an Ethernet card. In the embodiment of the present application, the FC-HBA card is also called a Fibre Channel interface card. The network interface card and the processor may be connected by a Peripheral Component Interconnect Express (PCIe) link. The network interface card and the memory may also be connected through a PCIe link.
可选的,所述处理器是在所述网络接口卡初始化的过程中,通过运行所述网络接口卡的驱动程序,在所述内存中创建数据页面信息表。Optionally, the processor creates a data page information table in the memory by running a driver of the network interface card during initialization of the network interface card.
可选的,可以在所述存储设备的操作系统(operating system,OS)管理的内存中创建所述数据页面信息表,也可以在所述网络接口卡在内存中的基地址寄存器(base address register,BAR)地址空间创建所述数据页面信息表。Optionally, the data page information table may be created in a memory managed by an operating system (OS) of the storage device, or a base address register (base address register) in the memory of the network interface card , BAR) address space creates the data page information table.
可选的,所述数据页面信息表是所述网络接口卡可以直接访问的信息表,所述数据页面信息表也是所述处理器通过运行所述网络接口卡的驱动程序直接访问的信息表。Optionally, the data page information table is an information table directly accessible by the network interface card, and the data page information table is also an information table directly accessed by the processor through a driver that runs the network interface card.
在一种可能的实现方式中,所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。In a possible implementation manner, the memory includes a cache, and the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table The information of the idle data page recorded in is the information of the idle data page in the cache.
在一种可能的实现方式中,所述处理器,还用于通过运行所述网络接口卡的驱动程序,从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。In a possible implementation manner, the processor is further configured to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page to In the data page information table.
可选的,所述处理器可以通过运行所述网络接口卡的驱动程序,根据预设的比例确定可以配置到所述数据页面信息表中的空闲数据页面的数量,也可以根据预设的算法确定的动态的空闲数据页面的数量。Optionally, the processor may determine the number of idle data pages that can be configured in the data page information table according to a preset ratio by running a driver of the network interface card, or according to a preset algorithm Determine the number of dynamic idle data pages.
可选的,所述网络接口卡的驱动程序是所述存储设备的操作系统中的程序,所述处理器通过运行所述存储设备的操作系统中的所述网络接口卡的驱动程序,从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。Optionally, the driver for the network interface card is a program in the operating system of the storage device, and the processor runs the driver for the network interface card in the operating system of the storage device Applying for an idle data page in the cache, and configuring the information of the applied idle data page into the data page information table.
在一种可能的实现方式中,所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。即数据页面信息表中的一个表项记录一个空闲数据页面的信息,每个表项分别记录不同的空闲数据页面的信息。In a possible implementation manner, the data page information table includes multiple entries, and each entry is used to record information of an idle data page. That is, an entry in the data page information table records information of an idle data page, and each entry records information of a different idle data page.
在一种可能的实现方式中,所述空闲数据页面的信息包括所述空闲数据页面的物理 地址信息和长度信息。In a possible implementation manner, the information of the idle data page includes physical address information and length information of the idle data page.
在一种可能的实现方式中,所述数据页面信息表是在所述内存中创建的页面交换队列,所述页面交换队列以队列形式包含多个表项。In a possible implementation manner, the data page information table is a page swap queue created in the memory, and the page swap queue contains multiple entries in the form of a queue.
可选的,所述数据页面信息表也可以是在所述内存中创建的链表或数组。Optionally, the data page information table may also be a linked list or an array created in the memory.
在一种可能的实现方式中,所述网络接口卡包括控制器和网络端口;其中,In a possible implementation manner, the network interface card includes a controller and a network port; wherein,
所述网络端口,用于接收所述写数据请求;The network port is used to receive the write data request;
所述控制器,用于根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息。The controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request The sender of the write data request sends a response message that write data preparation is complete.
所述处理器还用于通过运行所述网络接口卡的驱动程序,按照所述控制器的命令格式,将下述信息中的至少其中之一配置到所述控制器中:所述页面交换队列的起始地址、表项的数量、表项的格式。The processor is further configured to configure at least one of the following information into the controller by running the driver of the network interface card according to the command format of the controller: the page exchange queue Starting address, number of entries, and format of entries.
可选的,所述处理器用于通过运行所述网络接口卡的驱动程序,按照所述控制器预设的命令格式,将从所述缓存中申请的空闲数据页面配置到所述页面交换队列中。Optionally, the processor is configured to configure the idle data page requested from the cache into the page exchange queue by running the driver of the network interface card according to a command format preset by the controller .
在一种可能的实现方式中,所述控制器,还用于将接收到的所述写数据请求所要存储的数据,迁移到所分配的数据页面对应的缓存空间中;所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述内存中空闲的数据页面,例如所述缓存中的空闲数据页面,交换到所述数据页面信息表中。将所述缓存中空闲的数据页面交换到所述数据页面信息表中,能够保证数据页面信息表中有足够的空闲数据页面用于分配,能够避免因空闲数据页面不足带来的业务中断的问题。In a possible implementation manner, the controller is further configured to migrate the data to be stored in the received write data request to the cache space corresponding to the allocated data page; the processor also uses By running the driver of the network interface card, the free data pages in the memory, such as the free data pages in the cache, are exchanged into the data page information table. The free data pages in the cache are exchanged into the data page information table, which can ensure that there are enough free data pages in the data page information table for allocation, and can avoid the problem of business interruption caused by insufficient free data pages .
在一种可能的实现方式中,所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述数据页面信息表在所述内存中的虚拟地址转换为物理地址;In a possible implementation manner, the processor is further configured to convert a virtual address of the data page information table in the memory to a physical address by running a driver of the network interface card;
所述网络接口卡通过所述数据页面信息表的物理地址访问所述数据页面信息表。The network interface card accesses the data page information table through the physical address of the data page information table.
第二方面,本申请实施例提供了一种网络接口卡,包括控制器和网络端口;其中,In a second aspect, an embodiment of the present application provides a network interface card, including a controller and a network port; wherein,
所述网络端口,用于通过网络接收写数据请求,所述写数据请求是向存储设备写入数据的请求,所述存储设备通过所述网络接口卡接收向所述存储设备写入数据的请求和/或待存储的数据;The network port is used to receive a write data request through a network, the write data request is a request to write data to a storage device, and the storage device receives a request to write data to the storage device through the network interface card And/or data to be stored;
所述控制器,用于从数据页面信息表记录的数据页面中,分配数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述数据页面信息表是所述存储设备内存中的信息表,所述数据页面是所述内存中的空闲数据页面。The controller is configured to allocate a data page from the data page recorded in the data page information table to cache the data to be stored in the write data request, and send the write data preparation to the sender of the write data request Response message; wherein, the data page information table is an information table in the memory of the storage device, and the data page is an idle data page in the memory.
本申请实施例提供的网络接口卡,在网络端口接收到写数据请求时,控制器从所述存储设备的内存中的数据页面信息表获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡中的控制器能够直接从内存获取可用的数据页面的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。由于不需要所述存储设备中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡接收写数据请求到其发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the network interface card provided in the embodiment of the present application, when the network port receives a write data request, the controller obtains the information of the idle data page from the data page information table in the memory of the storage device, and the idle data page can be used To cache the data to be written in the write data request. In this way, the controller in the network interface card can directly obtain the available data page information from the memory, complete the preparation for writing data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request to the network interface card to sending the write data request response message is shortened, and the time for processing the write data request service is improved. effectiveness.
其中,所述控制器分配所述数据页面信息表中记录的数据页面用于缓存所述写数据 请求所要存储的数据,是所述控制器分配到用于缓存所述写数据请求所要存储的数据的空闲数据页面。可选的,所述网络接口卡是FC-HBA卡或以太网卡。Wherein, the controller allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the data allocated by the controller to cache the write data request Of free data pages. Optionally, the network interface card is an FC-HBA card or an Ethernet card.
在一种可能的实现方式中,所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。In a possible implementation manner, the memory includes a cache, and the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table The information of the idle data page recorded in is the information of the idle data page in the cache.
在一种可能的实现方式中,所述控制器,还用于接收所述数据页面信息表的配置信息,根据所述数据页面信息表的配置信息访问所述数据页面信息表;其中,所述配置信息包括所述数据页面信息表的起始地址、表项的数量和格式。In a possible implementation manner, the controller is further configured to receive configuration information of the data page information table and access the data page information table according to the configuration information of the data page information table; wherein, the The configuration information includes the starting address of the data page information table, the number and format of the table items.
在一种可能的实现方式中,所述网络端口,还用于通过网络接收所述写数据请求所要写入的数据;In a possible implementation manner, the network port is also used to receive the data to be written by the write data request through the network;
所述控制器,还用于缓存所述数据,并将所述数据迁移到已分配的数据页面所对应的内存中。The controller is also used to cache the data and migrate the data to the memory corresponding to the allocated data page.
第三方面,本申请实施例提供了一种处理写数据请求的方法,包括:In a third aspect, an embodiment of the present application provides a method for processing a write data request, including:
接收写数据请求,所述写数据请求是向存储设备写入数据的请求;Receiving a write data request, which is a request to write data to a storage device;
根据数据页面信息表中记录的数据页面的信息,分配用于缓存所述写数据请求所要写入数据的数据页面;其中,所述数据页面信息表是所述存储设备中内存中的信息表,所述数据页面是所述内存中空闲的数据页面;According to the information of the data page recorded in the data page information table, allocate a data page for buffering the data to be written by the write data request; wherein, the data page information table is an information table in the memory of the storage device, The data page is a free data page in the memory;
向所述写数据请求的发送方发送写数据准备完成的响应消息。Send a response message to the sender of the write data request to complete the write data preparation.
本申请实施例提供的处理写数据请求的方法,在接收到写数据请求时,从内存中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,能够在接收到写数据请求时,直接从内存获取可用的数据页面的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。缩短了从接收写数据请求到发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。The method for processing a write data request provided by an embodiment of the present application, when receiving a write data request, obtains information of an idle data page from the memory, and the idle data page can be used to cache the write request of the write data request data. In this way, when a write data request is received, the information of available data pages can be directly obtained from the memory, the preparation of the write data can be completed, and a response message can be sent to the sender of the write data request to complete the write data preparation. The time from receiving the write data request to sending the write data request response message is shortened, and the efficiency in processing the write data request service is improved.
其中,所述分配数据页面用于缓存所述写数据请求所要存储的数据,是分配到用于缓存所述写数据请求所要存储的数据的空闲数据页面。Wherein, the allocated data page is used to cache data to be stored by the write data request, and is an idle data page allocated to cache data to be stored by the write data request.
可选的,可以在操作系统管理的内存中创建所述数据页面信息表,也可以在所述内存的其它非缓存空间创建所述数据页面信息表。Optionally, the data page information table may be created in a memory managed by the operating system, or the data page information table may be created in other non-cache space of the memory.
在一种可能的实现方式中,所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。In a possible implementation manner, the memory includes a cache, and the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table The information of the idle data page recorded in is the information of the idle data page in the cache.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。Apply for an idle data page from the cache, and configure the information of the applied idle data page into the data page information table.
在一种可能的实现方式中,所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。In a possible implementation manner, the data page information table includes multiple entries, and each entry is used to record information of an idle data page.
在一种可能的实现方式中,所述数据页面的信息包括所述空闲数据页面的物理地址信息和长度信息。In a possible implementation manner, the information of the data page includes physical address information and length information of the idle data page.
在一种可能的实现方式中,所述页面信息表是在所述内存中创建的页面交换队列, 所述页面交换队列以队列形式包含多个表项。In a possible implementation manner, the page information table is a page exchange queue created in the memory, and the page exchange queue contains multiple entries in the form of a queue.
在一种可能的实现方式中,所述方法还包括:In a possible implementation manner, the method further includes:
将接收到的所述写数据请求所要写入的数据,迁移到所分配的数据页面所对应的内存中;Migrate the data to be written in the received data write request to the memory corresponding to the allocated data page;
将所述内存中空闲的数据页面,例如所述缓存中的空闲数据页面,交换到所述数据页面信息表中。Exchange the free data pages in the memory, such as the free data pages in the cache, into the data page information table.
可选的,所述方法还包括:Optionally, the method further includes:
按照预设的命令格式,将下述信息中的至少其中之一配置到所述控制器中:所述数据页面信息表的起始地址、表项的数量、表项的格式。According to a preset command format, at least one of the following information is configured into the controller: the starting address of the data page information table, the number of entries, and the format of the entries.
第四方面,本申请实施例提供了一种信息处理系统,包括服务器和存储设备,所述服务器用于向所述存储设备写入数据或从所述存储设备读取数据;所述存储设备包括处理器、网络接口卡和内存,其中:According to a fourth aspect, an embodiment of the present application provides an information processing system, including a server and a storage device, where the server is used to write data to or read data from the storage device; the storage device includes Processor, network interface card and memory, including:
所述处理器,用于通过运行所述网络接口卡的驱动程序,在所述内存中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
所述网络接口卡,用于接收所述服务器发送的写数据请求,根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述服务器发送写数据准备完成的响应消息。The network interface card is used to receive a write data request sent by the server, and allocate the data page recorded in the data page information table for caching the data page according to the information of the data page recorded in the data page information table Write data to request the data to be stored, and send a response message to the server that write data preparation is complete.
上述信息处理系统,网络接口卡在接收到服务器发送的写数据请求时,从内存中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡能够直接从内存获取可用的数据页面的信息,完成写数据的准备,并向服务器发送写数据准备完成的响应消息。由于不需要存储设备中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡接收写数据请求到网络接口卡发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the above information processing system, when receiving the write data request sent by the server, the network interface card obtains the information of the idle data page from the memory, and the idle data page can be used to cache the data to be written by the write data request. In this way, the network interface card can directly obtain the information of the available data pages from the memory, complete the preparation of writing data, and send a response message to the server that the preparation of writing data is complete. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card to sending the write data request response message from the network interface card is shortened, and the processing time of the write data request service is improved. effectiveness.
其中,所述网络接口卡分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,是所述网络接口卡分配到用于缓存所述写数据请求所要存储的数据的空闲数据页面。Wherein, the network interface card allocates the data page recorded in the data page information table to cache the data to be stored by the write data request, which is the network interface card allocated to store the data to be cached by the write data request Free data page of the data.
在一种可能的实现方式中,所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。In a possible implementation manner, the memory includes a cache, and the cache is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the page information table The information of the idle data page recorded in is the information of the idle data page in the cache.
在一种可能的实现方式中,所述处理器,还用于通过运行所述网络接口卡的驱动程序,从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。In a possible implementation manner, the processor is further configured to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page to In the data page information table.
在一种可能的实现方式中,所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。In a possible implementation manner, the data page information table includes multiple entries, and each entry is used to record information of an idle data page.
在一种可能的实现方式中,所述空闲数据页面的信息包括所述空闲数据页面的物理地址信息和长度信息。In a possible implementation manner, the information of the idle data page includes physical address information and length information of the idle data page.
在一种可能的实现方式中,所述数据页面信息表是在所述内存中创建的页面交换队列,所述页面交换队列以队列形式包含多个表项。In a possible implementation manner, the data page information table is a page swap queue created in the memory, and the page swap queue contains multiple entries in the form of a queue.
在一种可能的实现方式中,所述网络接口卡包括控制器和网络端口;其中,In a possible implementation manner, the network interface card includes a controller and a network port; wherein,
所述网络端口,用于接收所述写数据请求;The network port is used to receive the write data request;
所述控制器,用于根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息。The controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request The sender of the write data request sends a response message that write data preparation is complete.
在一种可能的实现方式中,所述控制器,还用于将接收到的所述写数据请求所要存储的数据,迁移到所分配的数据页面对应的内存中;In a possible implementation manner, the controller is further configured to migrate the data to be stored in the received write data request to the memory corresponding to the allocated data page;
所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述内存中空闲的数据页面,例如所述缓存中的空闲数据页面,交换到所述数据页面信息表中。The processor is also used to exchange a free data page in the memory, for example, a free data page in the cache, into the data page information table by running a driver of the network interface card.
在一种可能的实现方式中,所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述数据页面信息表在所述内存中的虚拟地址转换为物理地址;In a possible implementation manner, the processor is further configured to convert a virtual address of the data page information table in the memory to a physical address by running a driver of the network interface card;
所述网络接口卡通过所述数据页面信息表的物理地址访问所述数据页面信息表。The network interface card accesses the data page information table through the physical address of the data page information table.
第五方面,本申请提供了一种计算机存储介质,用于储存为控制芯片所用的计算机软件指令,其包含用于执行上述第三方面方面所设计的程序。According to a fifth aspect, the present application provides a computer storage medium for storing computer software instructions for controlling a chip, which includes a program designed to execute the above-mentioned third aspect.
第六方面,本申请提供了一种计算机程序,当计算机设备或服务器中的控制芯片运行该计算机程序时,该控制芯片执行上述第二方面中所述网络接口卡的功能。In a sixth aspect, the present application provides a computer program. When a control chip in a computer device or server runs the computer program, the control chip performs the function of the network interface card described in the second aspect.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍。In order to more clearly explain the technical solutions of the embodiments of the present invention, the drawings required in the description of the embodiments will be briefly introduced below.
图1A为服务器和存储阵列所组成的FC-SAN系统的一种实现方式结构示意图;FIG. 1A is a schematic structural diagram of an implementation manner of an FC-SAN system composed of a server and a storage array;
图1B为图1A中存储阵列的具体结构示意图;1B is a schematic diagram of the specific structure of the storage array in FIG. 1A;
图1C为图1A中服务器的具体结构示意图;1C is a schematic diagram of the specific structure of the server in FIG. 1A;
图2为服务器向存储阵列存储数据时的实现方式流程示意图;2 is a schematic flowchart of an implementation manner when a server stores data in a storage array;
图3为本申请实施例提供的存储阵列300的一种实现方式结构示意图;3 is a schematic structural diagram of an implementation manner of a storage array 300 provided by an embodiment of the present application;
图4为本申请实施例提供的创建页面交换队列过程的方法流程示意图;4 is a schematic flowchart of a method for creating a page exchange queue process provided by an embodiment of this application;
图5为存储阵列300接收到服务器400发送的写数据请求后的处理方法流程示意图;5 is a schematic flowchart of a processing method after the storage array 300 receives the write data request sent by the server 400;
图6为本申请实施例提供的存储阵列300接收数据并存储数据的方法流程示意图;6 is a schematic flowchart of a method for a storage array 300 according to an embodiment of the present application to receive data and store data;
图7为本申请实施例提供的一种存储设备700的结构示意图;7 is a schematic structural diagram of a storage device 700 provided by an embodiment of the present application;
图8为本申请实施例提供的一种网络接口卡800的结构示意图;8 is a schematic structural diagram of a network interface card 800 provided by an embodiment of the present application;
图9为本申请实施例提供的一种处理写数据请求方法的流程示意图;9 is a schematic flowchart of a method for processing a write data request according to an embodiment of the present application;
图10为本申请实施例提供的一种信息处理系统100的结构示意图。FIG. 10 is a schematic structural diagram of an information processing system 100 provided by an embodiment of the present application.
具体实施方式detailed description
下面结合附图,对本发明的实施例进行描述。The following describes the embodiments of the present invention with reference to the drawings.
存储阵列是把多个硬盘组成一个阵列,当作大资源池使用。它将数据以分条(striping)的方式存储在不同的硬盘中,存取数据时,阵列中的相关硬盘一起工作,既保证可靠性,又大幅减低数据存取时间,同时有更佳的空间利用率。A storage array is composed of multiple hard disks to form an array, which is used as a large resource pool. It stores data in different hard drives in a striping manner. When accessing data, the related hard drives in the array work together, which not only guarantees reliability, but also greatly reduces data access time, and has better space. Utilization.
图1A为FC-SAN系统的一种实现方式结构示意图。如图1所示,所述FC-SAN系统包括服务器、存储阵列和光模块交换机,服务器中的FC-HBA卡1与存储阵列中的FC-HBA卡2分别与光模块交换机(也可以称为FC交换机)连接,通过FC交换机实现通信。FIG. 1A is a schematic structural diagram of an implementation manner of an FC-SAN system. As shown in FIG. 1, the FC-SAN system includes a server, a storage array, and an optical module switch. The FC-HBA card 1 in the server and the FC-HBA card 2 in the storage array are respectively connected to the optical module switch (also called FC Switch) connection, through the FC switch to achieve communication.
图1A只是一种简单的结构示意图,在具体实现时,服务器还可以包括CPU和主存储器(例如:随机存取存储器RAM等)。存储阵列也可以包括磁盘控制器、硬盘驱动器(hard disk drive,HDD)和固态硬盘(solid-state disk,SSD)等中的一种或多种。可以理解,在具体实现时,存储阵列和服务器之间还可以包括其它的连接设备等。在一种实施方式中,存储阵列和服务器之间不包括光模块交换机,即存储阵列和服务器直连和通信。FIG. 1A is just a schematic diagram of a simple structure. In a specific implementation, the server may further include a CPU and a main memory (eg, random access memory RAM, etc.). The storage array may also include one or more of a disk controller, a hard disk drive (HDD), and a solid-state disk (SSD). It can be understood that, in specific implementation, other connection devices may also be included between the storage array and the server. In one embodiment, the optical module switch is not included between the storage array and the server, that is, the storage array and the server are directly connected and communicated.
图1A中的服务器在运行过程中需要读取数据或存储数据;其存储数据或读取数据包括但不限于向存储阵列写入数据或从存储阵列中读取数据。相应的,所述存储阵列通过网络接收所述服务器的写数据请求,将待存储的数据写入存储阵列的磁盘中;或根据所述服务器的读数据请求将存储阵列磁盘中数据传输给所述服务器。图1A中的光模块交换机主要用于所述服务器与所述存储阵列之间报文或数据的转发。The server in FIG. 1A needs to read data or store data during operation; its storage data or read data includes but is not limited to writing data to or reading data from the storage array. Correspondingly, the storage array receives the write data request of the server through the network and writes the data to be stored to the disk of the storage array; or transmits the data in the storage array disk to the storage device according to the read data request of the server server. The optical module switch in FIG. 1A is mainly used for forwarding messages or data between the server and the storage array.
图1B是图1A中存储阵列的一种具体结构示意图。如图1B所示,所述存储阵列在包括物理层和软件层。所述物理层中包括但不限于CPU、FC-HBA卡2、内存和磁盘。所述软件层中包括但不限于驱动模块和缓存模块。其中,所述驱动模块主要用于FC-HBA卡2的驱动和初始化等;所述缓存模块用于管理内存中的缓存资源。可以理解,所述驱动模块和所述缓存模块是所述存储阵列的操作系统中的软件模块,并通过所述存储阵列的CPU执行相关的程序来实现。FIG. 1B is a schematic diagram of a specific structure of the memory array in FIG. 1A. As shown in FIG. 1B, the storage array includes a physical layer and a software layer. The physical layer includes but is not limited to CPU, FC-HBA card 2, memory and disk. The software layer includes but is not limited to a driver module and a cache module. Among them, the drive module is mainly used for driving and initializing the FC-HBA card 2 and the like; the cache module is used for managing cache resources in the memory. It can be understood that the drive module and the cache module are software modules in the operating system of the storage array, and are implemented by the CPU of the storage array executing relevant programs.
图1C是图1A中服务器的一种具体结构示意图。如图1C所示,所述服务器包括软件层和物理层。所述物理层中包括但不限于CPU和FC-HBA卡1,所述软件层中包括但不限于应用模块。所述应用模块可以是所述服务器操作系统中的应用程序,完成并实现一定的功能,通常通过服务器的CPU执行相关的程序来实现。当所述应用程序需要通过网络向存储阵列写入数据或读出数据时,会通过所述服务器中的CPU发送相关的命令或数据到FC-HBA卡1,通过FC-HBA卡1接收相关的数据或命令。FIG. 1C is a schematic diagram of a specific structure of the server in FIG. 1A. As shown in FIG. 1C, the server includes a software layer and a physical layer. The physical layer includes but is not limited to the CPU and the FC-HBA card 1, and the software layer includes but is not limited to the application module. The application module may be an application program in the server operating system, which completes and implements certain functions, and is usually implemented by the CPU of the server executing relevant programs. When the application needs to write data to or read data from the storage array through the network, it will send related commands or data to the FC-HBA card 1 through the CPU in the server, and receive related information through the FC-HBA card 1. Data or commands.
以所述应用程序为视频软件为例,当该视频软件需要存储某一视频时,其需要将相关的视频数据写入所述存储阵列中。所述服务器通过所述光模块交换机将写数据的请求和待存储的视频数据发送给存储阵列,所述存储阵列通过网络接收所述光模块交换机转发的所述写数据的请求和视频数据,并将所述视频数据存储在所述存储阵列的磁盘中。Taking the application program as video software as an example, when the video software needs to store a certain video, it needs to write relevant video data into the storage array. The server sends the write data request and the video data to be stored to the storage array through the optical module switch, and the storage array receives the write data request and the video data forwarded by the optical module switch through the network, and The video data is stored in the disk of the storage array.
下面以图1A-图1C所示的系统为例,对所述服务器向所述存储阵列写入数据的过程进行描述。如图2所示,所述服务器向所述存储阵列写入数据的过程包括:The following describes the process of writing data by the server to the storage array using the system shown in FIGS. 1A-1C as an example. As shown in FIG. 2, the process of the server writing data to the storage array includes:
步骤S101:服务器中的应用模块需要存储数据时,服务器通过FC-HBA卡1向存储阵列发送写数据的命令;Step S101: When the application module in the server needs to store data, the server sends a write data command to the storage array through the FC-HBA card 1;
步骤S102:服务器中的FC-HBA卡1通过网络向存储阵列发送所述写数据命令;Step S102: The FC-HBA card 1 in the server sends the write data command to the storage array through the network;
步骤S103:存储阵列中的FC-HBA卡2接收所述写数据命令,根据所述写数据命令获取待存储数据的信息并发送给存储阵列的驱动模块;Step S103: The FC-HBA card 2 in the storage array receives the write data command, obtains information of the data to be stored according to the write data command and sends it to the drive module of the storage array;
步骤S104:所述驱动模块根据所述待存储数据的信息向所述存储阵列的缓存模块申请空闲的数据页面;Step S104: the driver module applies for an idle data page from the cache module of the storage array according to the information of the data to be stored;
步骤S105:所述缓存模块分配用于缓存所述写数据命令需要存储数据的空闲数据页面,并将分配的空闲数据页面的地址等信息发送给所述驱动模块;Step S105: the cache module allocates an idle data page for storing the data to be cached by the write data command, and sends information such as the address of the allocated idle data page to the drive module;
步骤S106:所述驱动模块将接收到的空闲数据页面的地址等信息发送给FC-HBA卡2;Step S106: the driver module sends the received address and other information of the idle data page to the FC-HBA card 2;
步骤S107:FC-HBA卡2记录分配的数据页面的地址信息,并向服务器的FC-HBA卡1发送写数据准备完成的消息;Step S107: The FC-HBA card 2 records the address information of the allocated data page, and sends a message to the server FC-HBA card 1 that the data write preparation is complete;
步骤S108:所述服务器通过FC-HBA卡1接收到写数据准备完成的消息后,向所述存储阵列发送待存储的数据;Step S108: After receiving the message that the data writing is completed through the FC-HBA card 1, the server sends the data to be stored to the storage array;
步骤S109:FC-HBA卡2通过网络接收所述待存储数据,根据记录的为存储所述待存储数据所分配的数据页面的地址信息,将所述待存储数据通过直接内存访问(direct memory access,DMA)的方式写入所分配的数据页面,通知所述驱动模块数据接收完成;Step S109: The FC-HBA card 2 receives the data to be stored through the network, and according to the recorded address information of the data page allocated for storing the data to be stored, accesses the data to be stored through direct memory access (direct memory access) , DMA) way to write the allocated data page to notify the drive module that the data reception is completed;
步骤S110:所述驱动模块通知所述缓存模块,所述缓存模块根据所述驱动模块的通知触发将所述待存储数据存入磁盘中。Step S110: The drive module notifies the cache module, and the cache module triggers the storing of the data to be stored in the disk according to the notification of the drive module.
具体的,当FC-HBA卡2完成对所述待存储数据的接收并将所述待存储的数据通过DMA的方式写入所分配的数据页面后,会触发中断以通知驱动模块。驱动模块根据FC-HBA卡2的通知,通知缓存模块数据接收完成。所述缓存模块根据所述驱动模块的通知,向存储阵列的硬盘管理模块发送通知,硬盘管理模块将缓存中的所述待存储数据写入所述存储阵列的磁盘中。所述缓存模块还可以通知数据备份模块,将所述缓存中的所述待存储数据存储在具有备份功能的存储设备中,所述具有备份功能的存储设备通常是与所述存储阵列在地理位置上位于不同地方的存储设备。步骤S111:所述缓存模块返回写完成消息,通过所述驱动模块、FC-HBA卡2、FC-HBA卡1发送给所述服务器中的应用模块。Specifically, when the FC-HBA card 2 finishes receiving the data to be stored and writes the data to be stored into the allocated data page by DMA, an interrupt will be triggered to notify the driver module. According to the notification of the FC-HBA card 2, the driver module notifies the cache module that the data reception is completed. The cache module sends a notification to the hard disk management module of the storage array according to the notification of the drive module, and the hard disk management module writes the data to be stored in the cache into the disk of the storage array. The cache module may also notify the data backup module to store the data to be stored in the cache in a storage device with a backup function, the storage device with a backup function is usually in a geographic location with the storage array On storage devices located in different places. Step S111: The cache module returns a write completion message and sends it to the application module in the server through the drive module, FC-HBA card 2, and FC-HBA card 1.
具体的,当缓存模块确认缓存空间中的所述待存储数据已经全部存储在所述存储阵列的磁盘或全部存储在备份的存储设备后,即所述待存储的数据已经存储在永久性存储磁盘后,所述缓存模块会向所述驱动模块发送写完成的消息,所述驱动模块通过FC-HBA卡2将写完成的消息发送给所述服务器,以通知所述服务器中的应用模块。上述过程中,从步骤S102到步骤S107,需要通过存储阵列中的多个组件(例如FC-HBA卡2、驱动模块和缓存模块)相互配合,才能将存储阵列写数据准备完成的消息返回给服务器。这使得存储阵列向服务器返回写数据准备完成消息的时延较长,通常情况下时延会达到20微妙以上。此外,当存储阵列因需要处理的读写请求较多无法分配用于缓存的页面时,存储阵列向服务器返回错误码的时延也会较长。Specifically, when the cache module confirms that the data to be stored in the cache space has all been stored on the disk of the storage array or all of the backup storage devices, the data to be stored has been stored on the permanent storage disk After that, the cache module sends a write completion message to the driver module, and the drive module sends the write completion message to the server through the FC-HBA card 2 to notify the application module in the server. In the above process, from step S102 to step S107, multiple components in the storage array (such as FC-HBA card 2, drive module, and cache module) need to cooperate with each other to return the message that the storage array is ready to write data to the server . This causes the storage array to return the write data ready to complete message to the server with a long delay, usually the delay will reach more than 20 microseconds. In addition, when the storage array cannot allocate pages for caching due to the large number of read and write requests that need to be processed, the storage array returns a long delay to the server for error codes.
本申请实施例提供一种快速发送写数据准备完成消息的方法、设备和系统,以降低存储阵列收到写数据命令到返回写数据准备完成消息的时延,提高数据存储时的效率。Embodiments of the present application provide a method, device, and system for quickly sending a write data preparation completion message, to reduce the delay from the storage array receiving a write data command to returning a write data preparation completion message, and improve the efficiency of data storage.
图3为本申请实施例提供的存储阵列300的一种实现方式结构示意图。如图3所示,存储阵列300包括FC-HBA卡301、CPU302和内存303。FC-HBA卡301与CPU302之间通过PCIe链路连接,FC-HBA卡301与内存303之间通过PCIe链路连接,CPU与内存通过PCIe或其他方式通信。在存储阵列300中,CPU302通过运行操作系统306实现对存储阵列300的控制。内存303提供操作系统306运行的空间以及缓存存储阵列300待存储或待读取的数据。操作系统306中包括但不限于FC驱动304和缓存模块305。FC驱动304既可以直接与缓存模块305通信,也可以间接与缓存模块305通信,例如FC驱动 304可以通过其它模块缓存模块305通信。FIG. 3 is a schematic structural diagram of an implementation manner of a storage array 300 provided by an embodiment of the present application. As shown in FIG. 3, the storage array 300 includes an FC-HBA card 301, a CPU 302, and a memory 303. The FC-HBA card 301 and the CPU 302 are connected by a PCIe link, the FC-HBA card 301 and the memory 303 are connected by a PCIe link, and the CPU and the memory communicate by PCIe or other methods. In the storage array 300, the CPU 302 controls the storage array 300 by running the operating system 306. The memory 303 provides a space where the operating system 306 runs and data to be stored or read by the cache storage array 300. The operating system 306 includes but is not limited to the FC driver 304 and the cache module 305. The FC driver 304 can communicate directly with the cache module 305 or indirectly with the cache module 305. For example, the FC driver 304 can communicate with the cache module 305 through other modules.
FC-HBA卡301包括但不限于FC芯片3011和FC端口3012。FC芯片3011是FC-HBA卡301的核心,可以是FC协议及数据处理芯片,主要用于接收服务器发送的待存储的数据或向服务器发送服务器需要读取的数据。FC端口3012是FC-HBA卡301上与服务器通信的端口,FC-HBA卡301通常可以包括2个或4个FC端口(图3以4个为例进行说明),FC端口3012可以用于插入光纤线缆,以提供输入/输出传输的物理通道,所述输入/输出传输的物理通道包括但不限于全双工的输入/输出通道等。The FC-HBA card 301 includes but is not limited to an FC chip 3011 and an FC port 3012. The FC chip 3011 is the core of the FC-HBA card 301, and may be an FC protocol and a data processing chip, and is mainly used to receive data to be stored sent by the server or send data to the server to be read by the server. The FC port 3012 is a port on the FC-HBA card 301 to communicate with the server. The FC-HBA card 301 can usually include 2 or 4 FC ports (Figure 3 uses 4 as an example), and the FC port 3012 can be used for insertion. An optical fiber cable to provide a physical channel for input/output transmission. The physical channel for input/output transmission includes but is not limited to a full-duplex input/output channel.
操作系统306,是存储阵列300中运行的软件的运行基础,主要用于管理存储阵列300中的硬件资源,例如内存303和总线等硬件资源,以及为FC驱动304和缓存模块305等软件模块提供运行平台。The operating system 306 is the operating basis of the software running in the storage array 300, and is mainly used to manage the hardware resources in the storage array 300, such as memory 303 and bus and other hardware resources, as well as providing software modules such as the FC driver 304 and the cache module 305 Operating platform.
FC驱动304主要用于初始化FC-HBA卡301中的FC芯片3011,控制FC-HBA卡301接收服务器需要存储的数据或向服务器发送服务器需要读取的数据。The FC driver 304 is mainly used to initialize the FC chip 3011 in the FC-HBA card 301, and control the FC-HBA card 301 to receive data to be stored by the server or send data to the server to be read by the server.
缓存模块305主要用于管理缓存资源池3032中的数据页面,将缓存资源池3032中的数据写入存储阵列300的磁盘(图3中未示出)中,或将存储阵列300磁盘中的数据缓存在缓存资源池3032中。可选的,缓存模块305还可以包括初始化缓存资源池3032和执行数据命中算法等功能。The cache module 305 is mainly used to manage the data pages in the cache resource pool 3032, write the data in the cache resource pool 3032 to the disk (not shown in FIG. 3) of the storage array 300, or write the data in the disk of the storage array 300 The cache is in the cache resource pool 3032. Optionally, the cache module 305 may also include functions such as initializing the cache resource pool 3032 and executing data hit algorithms.
内存303主要包括操作系统(operating system,OS)管理的内存3031和缓存资源池3032。OS管理的内存3031主要用于支撑操作系统的运行,以及支撑硬件的初始化(包括但不限于FC-HBA卡301的初始化)等。缓存资源池3032主要用于服务器需要存储或读取的数据的缓存。The memory 303 mainly includes an operating system (operating system, OS) managed memory 3031 and a cache resource pool 3032. The memory 3031 managed by the OS is mainly used to support the operation of the operating system and the initialization of the hardware (including but not limited to the initialization of the FC-HBA card 301). The cache resource pool 3032 is mainly used for caching data that the server needs to store or read.
下面以图3所示结构为例,结合图4至图6,对本申请实施例提供的技术方案进行详细的描述。The following uses the structure shown in FIG. 3 as an example, and in combination with FIGS. 4 to 6 to describe in detail the technical solutions provided by the embodiments of the present application.
图4为本申请实施例提供的创建页面交换队列过程的方法流程示意图,如图4所示,所述方法包括:FIG. 4 is a schematic flowchart of a method for creating a page exchange queue process provided by an embodiment of the present application. As shown in FIG. 4, the method includes:
S401:运行FC驱动304以对FC芯片3011进行初始化;S401: Run the FC driver 304 to initialize the FC chip 3011;
即在存储阵列300上电后,操作系统306启动的过程中,运行FC驱动304以对FC芯片3011进行初始化。That is, after the storage array 300 is powered on, during the startup of the operating system 306, the FC driver 304 is run to initialize the FC chip 3011.
具体的,可以是CPU302通过运行FC驱动304相关的程序,对FC芯片3011进行初始化。本申请实施例为描述方便,以FC驱动304实施相关方法或完成相关功能,代表CPU302通过运行FC驱动304相关的程序实施相关方法或完成相关功能。Specifically, the CPU 302 may initialize the FC chip 3011 by running a program related to the FC driver 304. The embodiments of the present application are convenient for description. The FC driver 304 is used to implement related methods or perform related functions, which represents that the CPU 302 implements the relevant method or performs related functions by running the FC driver 304 related programs.
S402:运行FC驱动304以创建页面交换队列;S402: Run the FC driver 304 to create a page exchange queue;
即FC驱动304操作系统306管理的内存中申请部分内存,按照FC芯片3011的预设的配置要求,创建页面交换队列,该页面交换队列可以被FC芯片3011直接访问。That is, a part of the memory is applied to the memory managed by the FC driver 304 operating system 306, and a page swap queue is created according to the preset configuration requirements of the FC chip 3011, and the page swap queue can be directly accessed by the FC chip 3011.
该页面交换队列是以队列的形式记录空闲数据页面信息,可以包含多个表项,其中的每个表项记录一个空闲数据页面的信息。以页面交换队列中有4个表项(entry)为例,entry0记录缓存资源池3032中page0的页面信息,entry1记录缓存资源池3032中page1的页面信息,entry2记录缓存资源池3032中page2的页面信息,entry3记录缓存资源池3032中page3的页面信息。The page exchange queue records idle data page information in the form of a queue, and may contain multiple entries, each of which records information of an idle data page. Taking 4 entries in the page exchange queue as an example, entry0 records the page information of page0 in the cache resource pool 3032, entry1 records the page information of page1 in the cache resource pool 3032, entry2 records the page information of the page2 in the cache resource pool 3032 Information, entry3 records the page information of page3 in the cache resource pool 3032.
可选的,步骤S402中创建页面交换队列可以在FC驱动304对FC芯片3011进行初 始化的过程中实施。Alternatively, the creation of the page exchange queue in step S402 may be implemented during the initialization of the FC chip 3011 by the FC driver 304.
具体的,每个芯片在出厂前,都预先设定了一些基本的配置要求,包括但不限于:芯片与驱动之间通信的命令、接口,所述命令包括队列的参数等。其中,页面交换队列的参数可以包括:页面交换队列能够支持的元素(例如entry)的上限、下限,以及entry的格式等。Specifically, each chip is preset with some basic configuration requirements before shipment, including but not limited to: commands and interfaces for communication between the chip and the driver, and the commands include parameters of the queue and the like. The parameters of the page exchange queue may include: upper and lower limits of elements (such as entries) that the page exchange queue can support, and the format of the entry.
例如,FC芯片3011预设的页面交换队列中entry的格式为:For example, the format of the entry in the page swap queue preset by the FC chip 3011 is:
{数据页面物理地址,数据页面长度}{Data page physical address, data page length}
或,or,
{数据页面长度,数据页面物理地址}{Data page length, data page physical address}
FC驱动304可以按照上述FC芯片3011预设的entry的格式创建页面交换队列。The FC driver 304 may create a page exchange queue according to the format of the entry preset by the FC chip 3011.
FC驱动304创建的页面交换队列可以包含N个entry,其中,N是大于等于2的正整数。所述entry是队列中的表项,用于记录一个数据页面的基本信息,包括但不限于数据页面的物理地址和数据页面的长度。其中,数据页面是常见的内存管理方式的最小单元,其大小可以是4KB或8KB。可选的,所述entry中还可以包括每个entry的标识信息等,所述标识信息用于表示给entry记录的空闲数据页面是否已经被分配用于缓存数据。The page exchange queue created by the FC driver 304 may contain N entries, where N is a positive integer greater than or equal to 2. The entry is an entry in the queue for recording basic information of a data page, including but not limited to the physical address of the data page and the length of the data page. Among them, the data page is the smallest unit of a common memory management method, and its size can be 4KB or 8KB. Optionally, the entry may also include identification information of each entry, etc. The identification information is used to indicate whether an idle data page recorded for the entry has been allocated for buffering data.
可选的,FC驱动304可以从OS管理的内存中申请除OS预留的特定内存之外的部分内存,用于创建页面交换队列。所述特定内存包括OS运行所必须的内存,或其它外部设备在OS中预留的内存等。这些内存要么专门用于OS运行,要么专门供其它外部设备,FC驱动304不能访问这些内存。Optionally, the FC driver 304 can apply for a part of memory other than the specific memory reserved by the OS from the memory managed by the OS, which is used to create a page exchange queue. The specific memory includes memory necessary for the operation of the OS, or memory reserved in the OS by other external devices. These memories are either used exclusively for OS operation or for other external devices. The FC driver 304 cannot access these memories.
在具体实现时,FC驱动304从OS管理的内存中申请的内存对应的地址是虚拟地址,为了使FC芯片3011能够直接访问创建的页面交换队列,FC驱动304需要将创建的页面交换队列的虚拟地址转换为物理地址,并在对FC芯片3011初始化时配置给FC芯片3011。这样,FC芯片3011才能够直接访问页面交换队列。即FC芯片3011可以直接读取页面交换队列中记录的空闲数据页面的信息,不需要通过其它软件模块或硬件的参与,例如不需要通过驱动获取空闲数据页面的信息。In the specific implementation, the address corresponding to the memory requested by the FC driver 304 from the memory managed by the OS is a virtual address. In order for the FC chip 3011 to directly access the created page swap queue, the FC driver 304 needs to virtualize the created page swap queue. The address is converted into a physical address, and is allocated to the FC chip 3011 when the FC chip 3011 is initialized. In this way, the FC chip 3011 can directly access the page exchange queue. That is, the FC chip 3011 can directly read the information of the idle data pages recorded in the page exchange queue without the participation of other software modules or hardware, for example, it does not need to obtain the information of the idle data pages through the driver.
需要说明的是,上述FC驱动304将虚拟地址转换为物理地址,可以采用通用的地址转换方法。例如,操作系统306会给硬件设备(包括内存303)进行统一编址,并会维护一个虚拟地址与物理地址之间的映射关系,FC驱动304可以根据操作系统306维护的映射关系进行虚拟地址与物理地址之间的转换。It should be noted that the above FC driver 304 converts the virtual address to a physical address, and a general address conversion method can be used. For example, the operating system 306 will address hardware devices (including memory 303) uniformly and maintain a mapping relationship between a virtual address and a physical address. The FC driver 304 may perform virtual address and mapping based on the mapping relationship maintained by the operating system 306. Translation between physical addresses.
可以理解,FC驱动304创建的页面交换队列,不仅FC芯片3011可以直接访问,FC驱动304也可以直接访问,即FC驱动304和FC芯片3011共享创建的页面交换队列。It can be understood that not only the FC chip 3011 but the FC driver 304 can also directly access the page swap queue created by the FC driver 304, that is, the FC driver 304 and the FC chip 3011 share the created page swap queue.
S403:FC驱动304从缓存资源池中申请M个数据页面用于缓存存储阵列300需要存储的数据;S403: The FC driver 304 applies for M data pages from the cache resource pool to cache the data that the storage array 300 needs to store;
其中,所述M为大于等于1的正整数。FC驱动304从缓存资源池中申请的M个数据页面是空闲的数据页面,这些数据页面能够用于缓存存储阵列300需要存储的数据。Wherein, M is a positive integer greater than or equal to 1. The M data pages requested by the FC driver 304 from the cache resource pool are idle data pages, and these data pages can be used to cache the data that the storage array 300 needs to store.
可选的,FC驱动304从缓存资源池中所申请的数据页面个数M,在不同的场景下可以有不同的确定方式。Optionally, the number M of data pages requested by the FC driver 304 from the cache resource pool may be determined in different scenarios under different scenarios.
一种方式是按照存储业务的典型场景的读写比例进行配置。例如,常见的数据库业 务为读写比例7:3,FC驱动304可以申请缓存资源池3032中30%的数据页面共享到页面交换队列中。One way is to configure according to the read-write ratio of typical scenarios of storage services. For example, a common database business is a read-write ratio of 7:3, and the FC driver 304 can apply for 30% of the data pages in the cache resource pool 3032 to be shared in the page exchange queue.
另一种方式是,在存储阵列300存储数据的业务比例较低的情况下,为避免页面交换队列中配置的数据页面过多,部分被配置到交换队列中的空闲的数据页面未被分配用于缓存数据而造成资源闲置,上述M的值可以被灵活配置。例如通过一个配置接口,通过该配置接口接收用户根据不同业务场景的需求所配置的数值。FC驱动304根据接收到的M的值向缓存资源池3032申请数据页面。当然,存储阵列300中特定的软件,也可以通过预设的算法,自动地根据存储阵列300实际的业务情况,动态调整页面交换队列中数据页面个数M的值。本申请实施例不限定具体的实现方式。Another way is that, in the case where the storage ratio of the data stored in the storage array 300 is low, in order to avoid too many data pages configured in the page swap queue, some idle data pages configured in the swap queue are not allocated. The value of M can be flexibly configured to cache data and cause resources to be idle. For example, through a configuration interface, the value configured by the user according to the requirements of different business scenarios is received through the configuration interface. The FC driver 304 applies to the cache resource pool 3032 for the data page according to the received value of M. Of course, the specific software in the storage array 300 can also automatically adjust the value of the number M of data pages in the page swap queue according to the actual business situation of the storage array 300 through a preset algorithm. The embodiments of the present application do not limit specific implementation manners.
S404:FC驱动304将申请到的数据页面的信息配置到页面交换队列中的entry;S404: The FC driver 304 configures the information of the applied data page to the entry in the page exchange queue;
其中,数据页面的信息包括但不限于数据页面的物理地址和长度信息。The information of the data page includes but is not limited to the physical address and length information of the data page.
具体的,可以将一个数据页面的信息配置到页面交换队列的一个entry中。每个entry分别记录不同的数据页面的信息。例如,FC驱动304将申请到的一个数据页面的物理地址和长度信息记录到一个entry对应的变量中。Specifically, the information of a data page can be configured into an entry of the page exchange queue. Each entry separately records information on different data pages. For example, the FC driver 304 records the physical address and length information of a data page applied to a variable corresponding to an entry.
S405:FC驱动304将页面交换队列的信息配置到FC芯片3011。S405: The FC driver 304 configures the information of the page exchange queue to the FC chip 3011.
页面交换队列的信息,包括页面交换队列的起始地址、entry数量、entry的格式等中的一个或多个。The information of the page exchange queue includes one or more of the starting address, the number of entries, and the format of the entry of the page exchange queue.
具体的,芯片在出厂的时候,会配置预设的命令集。芯片的驱动会根据该预设的命令集进行相关的配置。在本实施例中,FC驱动304可以根据FC芯片3011预设的命令集,将页面交换队列的信息配置到FC芯片3011中。Specifically, when the chip is shipped from the factory, a preset command set is configured. The driver of the chip will perform related configuration according to the preset command set. In this embodiment, the FC driver 304 may configure the information of the page exchange queue into the FC chip 3011 according to the command set preset by the FC chip 3011.
例如,FC芯片3011预先配置的命令集为:For example, the pre-configured command set of the FC chip 3011 is:
Figure PCTCN2018121054-appb-000001
Figure PCTCN2018121054-appb-000001
FC驱动304按照所述命令集的格式要求,将页面交换队列的起始地址、entry数量、等队列信息填写在所述命令集中,然后将填写后的所述命令集发送给FC芯片3011。The FC driver 304 fills in the command set with the starting address, number of entries, and other queue information of the page exchange queue according to the format requirements of the command set, and then sends the filled command set to the FC chip 3011.
FC驱动304将页面交换队列的信息配置到FC芯片3011后,FC芯片3011可以访问页面交换队列,并通过页面交换队列获取缓存资源池3032中空闲的数据页面的信息。当存储阵列300接收到服务器发送的写数据请求时,FC芯片3011可以根据服务器发送的写数据请求,从页面交换队列中确定可用于缓存数据的数据页面的信息,并向服务器返回写数据准备完成的响应消息。After the FC driver 304 configures the information of the page exchange queue to the FC chip 3011, the FC chip 3011 can access the page exchange queue and obtain the information of the free data pages in the cache resource pool 3032 through the page exchange queue. When the storage array 300 receives the write data request sent by the server, the FC chip 3011 can determine the information of the data page that can be used to cache data from the page exchange queue according to the write data request sent by the server, and return to the server that the write data preparation is complete Response message.
作为一种可选的实现方式,FC驱动304也可以在上述步骤S402之后,即完成页面交换队列的创建后,就将页面交换队列的信息(包括但不限于页面交换队列的起始地址、entry的数量、格式等)配置或共享给FC芯片3011。As an optional implementation, the FC driver 304 may also send the information of the page exchange queue (including but not limited to the start address and entry of the page exchange queue after the creation of the page exchange queue after step S402 above) The number, format, etc.) are configured or shared with the FC chip 3011.
参考图5,图5为图4中初始化后的存储阵列300接收到服务器400发送的写数据 请求后的处理方法流程示意图。其中,服务器400与存储阵列300通过网络连接。例如服务器400与存储阵列300通过网络连接可以通过光模块交换机连接。服务器400中的应用模块需要存储数据时,通过FC-HBA卡401向存储阵列300发送写数据的命令。如图5所示,所述方法包括:Referring to FIG. 5, FIG. 5 is a schematic flowchart of a processing method after the initialized storage array 300 in FIG. 4 receives the write data request sent by the server 400. Among them, the server 400 and the storage array 300 are connected through a network. For example, the server 400 and the storage array 300 may be connected through an optical module switch through a network connection. When the application module in the server 400 needs to store data, it sends a command to write data to the storage array 300 through the FC-HBA card 401. As shown in FIG. 5, the method includes:
步骤S501:服务器400中的应用模块(通常是服务器中的业务层中的软件模块)需要存储数据时,服务器400通过FC-HBA卡401向存储阵列300发送写数据请求;Step S501: When an application module in the server 400 (usually a software module in the service layer in the server) needs to store data, the server 400 sends a write data request to the storage array 300 through the FC-HBA card 401;
可选的,服务器400发送的写数据请求可以通过发送写数据命令的方式实现。本申请实施例不限定服务器400发送写数据请求的具体实现方式。Optionally, the write data request sent by the server 400 may be implemented by sending a write data command. The embodiment of the present application does not limit the specific implementation manner of the server 400 sending the write data request.
步骤S502:存储阵列300中的FC-HBA卡301接收所述写数据请求;Step S502: The FC-HBA card 301 in the storage array 300 receives the write data request;
具体的,FC-HBA卡301通过FC端口3012接收服务器400通过网络或直接发送的写数据请求。Specifically, the FC-HBA card 301 receives the write data request sent by the server 400 through the network or directly through the FC port 3012.
步骤S503:FC-HBA卡301解析该写数据请求,并分配数据页面;Step S503: The FC-HBA card 301 parses the write data request and allocates the data page;
具体的,FC-HBA卡301中的FC芯片3011解析服务器400发送的写数据请求,根据页面交换队列中记录的数据页面,分配用于缓存所述写数据请求所要存储数据的数据页面。Specifically, the FC chip 3011 in the FC-HBA card 301 parses the write data request sent by the server 400, and allocates a data page for buffering the data to be stored in the write data request according to the data page recorded in the page exchange queue.
例如所述写数据请求所要存储的数据占用的存储空间在一个数据页面的缓存空间范围内,则FC芯片3011分配页面交换队列中的entry 0记录的数据页面,用于缓存所述写数据请求所要存储的数据。如果所述写数据请求所要存储的数据需要多个数据页面进行缓存,则FC芯片3011分配页面交换队列中多个entry记录的数据页面,用于缓存所述写数据请求所要存储的数据。For example, the storage space occupied by the data to be stored in the write data request is within the range of the cache space of a data page, then the FC chip 3011 allocates the data page recorded in the entry 0 in the page swap queue to cache the data write request. Stored data. If the data to be stored in the write data request requires multiple data pages to be cached, the FC chip 3011 allocates multiple data pages of entry records in the page swap queue to cache the data to be stored in the write data request.
可选的,FC-HBA卡301可以通过下述方式,根据页面交换队列的entry中记录的数据页面的信息,分配数据页面:Optionally, the FC-HBA card 301 can allocate data pages according to the information of the data pages recorded in the entry of the page exchange queue in the following manner:
一种是页面交换队列中的每个entry都有一个标识位,该标识位用于标识该entry记录的空闲数据页面是否已经被占用。例如某entry的标识位为0,表示该entry中的空闲数据页面未被分配;某entry的标识位为1,表示该entry中的空闲数据页面已被分配。FC-HBA卡301可以根据每个entry的标识位,选择entry用于分配空闲的数据页面。One is that each entry in the page exchange queue has an identification bit, which is used to identify whether the idle data page recorded by the entry has been occupied. For example, the identification bit of an entry is 0, indicating that the free data page in the entry is not allocated; the identification bit of an entry is 1, indicating that the free data page in the entry has been allocated. The FC-HBA card 301 can select an entry to allocate an idle data page according to the identification bit of each entry.
另一种方式是FC-HBA卡301从页面交换队列的起始位置的entry开始分配空闲的数据页面,每次分配后记录最后一个已经使用的entry的位置信息,并在下次分配数据页面时,根据前次记录的最后一个已经使用的entry的位置的下一个entry起,从对应的entry中分配对应的空闲数据页面。同时,从缓存资源池中交换的空闲数据页面,在队列的末尾依次增加,保证页面交换队列有充足的空闲数据页面供FC-HBA卡301用于分配。Another way is that the FC-HBA card 301 allocates free data pages from the entry at the beginning of the page exchange queue, records the location information of the last used entry after each allocation, and the next time the data page is allocated, According to the last entry of the last entry used in the previous record, the corresponding free data page is allocated from the corresponding entry. At the same time, the idle data pages exchanged from the cache resource pool are sequentially increased at the end of the queue to ensure that the page exchange queue has sufficient idle data pages for the FC-HBA card 301 to allocate.
需要说明的是,本申请实施例不限定于上述两种方式,其它等同的或变换的方式,只要能够使得FC-HBA卡301从页面交换队列的entry中记录获取数据页面的信息并进行分配,都在本申请实施例覆盖的范围内。It should be noted that the embodiments of the present application are not limited to the above two methods, other equivalent or conversion methods, as long as the FC-HBA card 301 can record and obtain the information of the data page from the entry of the page exchange queue and distribute, All are within the scope covered by the embodiments of the present application.
步骤S504:FC-HBA卡301向服务器400发送写数据准备完成的响应消息。Step S504: The FC-HBA card 301 sends a response message to the server 400 that the write data preparation is complete.
具体的,FC-HBA卡301中的FC芯片3011在分配到用于缓存所述写数据请求所要存储的数据的空闲数据页面后,即FC芯片3011在成功分配到用于缓存所述写数据请求所 要存储的数据的空闲数据页面后,通过FC端口3012向服务器400发送写数据准备完成的响应消息,以通知服务器400存储阵列300已做好接收数据的准备。Specifically, after the FC chip 3011 in the FC-HBA card 301 is allocated to an idle data page used to cache the data to be stored in the write data request, the FC chip 3011 is successfully allocated to the cache data request After the idle data page of the data to be stored, a response message of writing data preparation completion is sent to the server 400 through the FC port 3012 to notify the server 400 that the storage array 300 is ready to receive data.
上述过程中,FC芯片3011不再通过FC驱动304向缓存模块305请求分配缓存资源池3032中的数据页面,可以避免通过FC驱动304和缓存模块305申请数据页面所造成的时延,能够提升向服务器返回写数据准备完成消息的速度和效率。In the above process, the FC chip 3011 no longer requests the cache module 305 to allocate the data page in the cache resource pool 3032 through the FC driver 304, which can avoid the time delay caused by applying the data page through the FC driver 304 and the cache module 305, and can improve the The server returns the speed and efficiency of writing data ready to complete the message.
图6为本申请实施例提供的存储阵列300接收数据并存储数据的方法流程示意图。该方法流程为存储阵列300根据图5所示的方法向服务器400发送写数据准备完成的响应消息后,接收服务器400发送的数据并进行存储的过程。为清楚描述,图6中存储阵列还包括硬盘管理模块307和存储空间308。其中,硬盘管理模块307用于管理存储阵列300中的存储空间308,包括但不限于将缓存资源池3032中的数据写入存储空间308中。存储空间308是存储阵列300存储数据的物理空间,可以是HDD或SSD等。在具体实现时,硬盘管理模块307也可以包括多个子模块,可以由多个不同的子模块共同实现硬盘管理模块307的功能,本申请实施例不做具体的限定。FIG. 6 is a schematic flowchart of a method for a storage array 300 according to an embodiment of the present application to receive data and store data. The method flow is a process in which the storage array 300 receives the data sent by the server 400 and performs storage after sending a response message to the server 400 that the write data preparation is completed according to the method shown in FIG. 5. For clear description, the storage array in FIG. 6 further includes a hard disk management module 307 and a storage space 308. The hard disk management module 307 is used to manage the storage space 308 in the storage array 300, including but not limited to writing the data in the cache resource pool 3032 into the storage space 308. The storage space 308 is a physical space where the storage array 300 stores data, and may be an HDD, an SSD, or the like. In a specific implementation, the hard disk management module 307 may also include multiple sub-modules, and the functions of the hard disk management module 307 may be jointly implemented by multiple different sub-modules, which is not specifically limited in the embodiments of the present application.
如图6所示,存储阵列300接收并存储数据的过程为:As shown in FIG. 6, the storage array 300 receives and stores data as follows:
步骤①:FC-HBA卡301的FC端口3012接收到服务器下发的数据,FC芯片3011将FC端口3012接收到的数据缓存在FC芯片3011内部的硬件缓存空间中;Step ①: The FC port 3012 of the FC-HBA card 301 receives the data delivered by the server, and the FC chip 3011 caches the data received by the FC port 3012 in the hardware cache space inside the FC chip 3011;
步骤②:FC芯片3011从页面交换队列中获取已分配的数据页面的信息;Step ②: The FC chip 3011 obtains the information of the allocated data page from the page exchange queue;
图6以entry0记录的数据页面为已分配的数据页面为例进行说明。FIG. 6 takes the data page recorded by entry0 as the allocated data page as an example for description.
该entry0是在FC芯片3011接收到服务器400发送的写数据请求时分配的entry,entry0中记录了分配的数据页面的信息。例如,上述步骤S503中,FC芯片3011分配的用于记录已经分配的数据页面信息的entry。The entry0 is an entry allocated when the FC chip 3011 receives the write data request sent by the server 400, and information of the allocated data page is recorded in the entry0. For example, in the above step S503, the entry allocated by the FC chip 3011 for recording the allocated data page information.
可选的,当FC芯片3011在上述步骤S503中分配的数据页面占用多个entry时,FC芯片3011相应的从多个entry中获取数据页面的信息。Optionally, when the data page allocated by the FC chip 3011 in the above step S503 occupies multiple entries, the FC chip 3011 correspondingly acquires information of the data page from the multiple entries.
步骤③:FC芯片3011将接收的数据通过DMA的方式迁移到entry 0中记录的数据页面中;Step ③: FC chip 3011 migrates the received data to the data page recorded in entry 0 through DMA;
即FC芯片3011根据entry0中记录的数据页面(例如page0)的物理地址,将接收到的数据通过DMA的方式迁移到所述物理地址对应的数据页面(例如page0)的存储空间中。该数据页面的存储空间即缓存资源池3032中的存储空间。That is, the FC chip 3011 migrates the received data to the storage space of the data page (eg, page0) corresponding to the physical address by DMA according to the physical address of the data page (eg, page0) recorded in entry0. The storage space of the data page is the storage space in the cache resource pool 3032.
下面以entry0中记录的数据页面在缓存资源池3032中为page0为例进行说明。The following uses the data page recorded in entry0 as page0 in the cache resource pool 3032 as an example for description.
步骤④:FC芯片3011向FC驱动304发送数据接收完成的通知消息,所述通知消息中包含数据页面page 0的物理地址;Step ④: The FC chip 3011 sends a notification message to the FC driver 304 that the data reception is completed, and the notification message includes the physical address of the data page page 0;
步骤⑤:FC驱动304向缓存模块305发送通知,以通知缓存模块305处理数据页面page 0中的数据;Step ⑤: The FC driver 304 sends a notification to the cache module 305 to notify the cache module 305 to process the data in the data page page 0;
步骤⑥:缓存模块305通知硬盘管理模块307处理数据页面page 0中的数据;Step ⑥: The cache module 305 notifies the hard disk management module 307 to process the data in the data page page 0;
步骤⑦:硬盘管理模块307将数据页面page 0中的数据存储到对应的存储空间308中;Step ⑦: The hard disk management module 307 stores the data in the data page page 0 into the corresponding storage space 308;
步骤⑧:缓存模块305将空闲的数据页面(例如page m)的物理地址通知FC驱动304;Step ⑧: The cache module 305 notifies the FC driver 304 of the physical address of an idle data page (for example, pagem);
因为page0所在entry已经被占用,为保证页面共享队列中有足够的数据页面用于 FC芯片3011分配给服务器400发送的其它写数据请求或其它服务器下发的写数据请求,需要将缓存资源池3032中空闲的数据页面,交换到页面缓存队列中。本步骤中将page m通知FC驱动304,就是用空闲的数据页面交换已经被占用的数据页面page 0。Because the entry where page0 is located has been occupied, in order to ensure that there are enough data pages in the page sharing queue for other write data requests sent by the FC chip 3011 to the server 400 or write data requests issued by other servers, the cache resource pool 3032 needs to be The free data pages in the page are swapped into the page cache queue. In this step, the FC driver 304 is notified of the page, that is, the idle data page is used to exchange the already occupied data page page 0.
可选的,将缓存资源池3032中空闲的数据页面交换到页面交换队列中,可以通过从缓存资源池3032中确定同等数量的空闲数据页面,并将确定的空闲数据页面配置到页面交换队列中。其中,所述同等数量,是与页面交换队列中记录的、被用于缓存数据的数据页面的数量。例如,步骤①中接收到的数据需要占用3个数据页面,FC芯片3011将接收的数据通过DMA的方式迁移到3个数据页面所对应的缓存空间后,从缓存资源池3032中再确定3个空闲数据页面并配置到页面交换队列中。这样,能够保证页面交换队列中,有足够的数据页面供FC芯片3011分配用于数据的缓存。Optionally, the idle data pages in the cache resource pool 3032 are exchanged into the page exchange queue, the same number of idle data pages can be determined from the cache resource pool 3032, and the determined idle data pages can be configured in the page exchange queue . Wherein, the same number is the number of data pages recorded in the page exchange queue and used to cache data. For example, the data received in step ① needs to occupy 3 data pages. After the FC chip 3011 migrates the received data to the cache space corresponding to the 3 data pages by DMA, 3 more are determined from the cache resource pool 3032 Idle data pages and configure them in the page exchange queue. In this way, it can be ensured that there are enough data pages in the page exchange queue for the FC chip 3011 to allocate for data buffering.
可选的,本申请实施例不限定步骤⑦和步骤⑧的执行顺序,两个步骤可以并行执行,也可以先执行步骤⑧,再执行步骤⑦。Optionally, the embodiment of the present application does not limit the execution order of step ⑦ and step ⑧, the two steps may be executed in parallel, or step ⑧ may be executed first, and then step ⑦.
可选的,在上述步骤S403中,FC驱动304从缓存资源池中所申请的数据页面个数M,也可以大于实际业务需求所要求的数据页面的个数。例如,存储阵列300在一定时间内缓存待存储的数据需要500个数据页面,FC驱动304可以向缓存资源池申请1000个数据页面。FC驱动304所申请的数据页面中多出的500个数据页面,能够避免因空闲页面还未交换到页面交换队列导致的部分数据无足够可用的数据页面而导致缓存失败的问题。Optionally, in the above step S403, the number M of data pages requested by the FC driver 304 from the cache resource pool may also be greater than the number of data pages required by actual business requirements. For example, the storage array 300 needs 500 data pages to cache the data to be stored within a certain period of time, and the FC driver 304 can apply for 1000 data pages from the cache resource pool. The 500 additional data pages in the data pages requested by the FC driver 304 can avoid the problem of caching failure due to insufficient data pages due to the partial data that has not been exchanged into the page exchange queue.
步骤⑨:FC驱动304将数据页面page m的信息(包括但不限于page m的物理地址和大小等)配置到entry 0。Step ⑨: The FC driver 304 configures the information of the data page page (including but not limited to the physical address and size of the page) to entry 0.
上述图3-图6所描述的实现方式是以FC-SAN场景下,存储阵列通过FC-HBA接收服务器发送的写数据请求等为例进行的说明。可以理解,对于其它场景下,具备存储能力的设备通过网络接口卡接收其它设备发送的写数据请求时的实现方式,可以参照上述图3-图6所示的实现方式来实现。例如,在IP-SAN的场景下,存储阵列可以通过以太网络接口卡接收服务器发送的写数据请求并进行相应的处理。可选的,当以太网络接口卡接收服务器发送的写数据请求时,以太网络接口卡可以是支持数据转发卸载的网络接口卡。The implementations described in the above FIGS. 3-6 are described by taking the FC-SAN scenario in which the storage array receives the write data request sent by the server through the FC-HBA as an example. It can be understood that, in other scenarios, the implementation manner when a device with storage capability receives a write data request sent by another device through a network interface card can be implemented by referring to the implementation manners shown in FIG. 3 to FIG. 6 described above. For example, in the IP-SAN scenario, the storage array can receive the write data request sent by the server through the Ethernet interface card and perform corresponding processing. Optionally, when the Ethernet network interface card receives the write data request sent by the server, the Ethernet network interface card may be a network interface card that supports data forwarding and offloading.
并且,上述图3-图6所描述的实现方式是在OS管理的内存中创建页面交换队列为例进行说明的。在具体实现时,也可以在内存的其它部分创建页面交换队列,例如FC-HBA卡301在内存中的BAR地址空间。In addition, the implementation manners described above in FIGS. 3 to 6 are described as an example of creating a page swap queue in the memory managed by the OS. In a specific implementation, a page exchange queue may also be created in other parts of the memory, for example, the BAR address space of the FC-HBA card 301 in the memory.
从FC芯片3011快速获取缓存中空闲数据页面信息的角度,也可以在FC芯片3011的缓存空间中创建页面交换队列。这样,FC芯片3011在接收到写数据请求时,能够快速地从本地的缓存中获取空闲的数据页面的信息。当然,由于FC芯片3011与内存之间通过通信通道,例如PCIe链路,实现通信,在进行数据页面的交换时,因需要通过内存与FC芯片3011之间的PCIe链路传递交换的数据页面的信息,页面的交换效率会低于在内存中创建页面交换队列的方式。From the perspective of the FC chip 3011 quickly acquiring the free data page information in the cache, it is also possible to create a page exchange queue in the cache space of the FC chip 3011. In this way, when the FC chip 3011 receives the write data request, it can quickly obtain the information of the free data page from the local cache. Of course, because the communication between the FC chip 3011 and the memory is achieved through a communication channel, such as a PCIe link, when data pages are exchanged, the exchanged data pages need to be transferred through the PCIe link between the memory and the FC chip 3011 Information, the efficiency of page exchange will be lower than the way to create a page exchange queue in memory.
上述实现方式是以在内存中创建页面交换队列,该页面交换队列记录有缓存中空闲的数据页面信息为例进行的描述。在具体实现时,还可以通过其它形式记录缓存中空闲数据页面,例如还可以通过数组或链表等其它方式。即页面交换队列只是用于记录数据 页面信息的一种实现方式,对于其它能够记录数据页面信息的记录表,例如数据页面信息表,都是本申请实施例所公开的范围。这些数据页面信息表,记录有缓存中空闲的数据页面信息,结合本申请实施例提供的其它技术特征,也能够解决本申请要解决的技术问题。只是在具体实现时,实现方式因各种形式自身的特点会略有不同。例如,页面交换队列中的entry的地址通常是连续的,而链表因为通过指针确定下一个表项的地址,因此其表项的地址不全是连续的。The above implementation is described by creating a page swap queue in memory, and the page swap queue records data page information that is free in the cache as an example. In specific implementation, the free data pages in the cache can also be recorded in other forms, for example, in other ways such as arrays or linked lists. That is, the page exchange queue is only an implementation method for recording data page information, and other record tables capable of recording data page information, such as a data page information table, are within the scope disclosed in the embodiments of the present application. These data page information tables record data page information that is free in the cache, and in combination with other technical features provided by the embodiments of the present application, can also solve the technical problems to be solved by the present application. Only in the specific implementation, the implementation method will be slightly different due to the characteristics of each form. For example, the address of the entry in the page exchange queue is usually continuous, and because the linked list determines the address of the next entry through the pointer, the address of its entry is not all continuous.
参考图7,图7为本申请实施例提供的一种存储设备700的结构示意图。存储设备700包括处理器701、网络接口卡702和内存703,其中:Referring to FIG. 7, FIG. 7 is a schematic structural diagram of a storage device 700 according to an embodiment of the present application. The storage device 700 includes a processor 701, a network interface card 702, and a memory 703, where:
所述处理器701,用于通过运行所述网络接口卡702的驱动程序,在所述内存703中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor 701 is configured to create a data page information table in the memory 703 by running a driver of the network interface card 702, and the data page information table is used to record information of free data pages in the memory ;
所述网络接口卡702,用于接收写数据请求,根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述写数据请求是向所述存储设备700写入数据的请求。The network interface card 702 is configured to receive a write data request, and allocate the data pages recorded in the data page information table to cache the data write request according to the data page information recorded in the data page information table The stored data, and send a response message to the sender of the write data request that the write data preparation is completed; wherein, the write data request is a request to write data to the storage device 700.
本申请实施例提供的存储设备700,其网络接口卡702在接收到写数据请求时,从内存703中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡702能够直接从内存703获取可用的缓存空间的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。由于不需要存储设备700中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡702接收写数据请求到网络接口卡702发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the storage device 700 provided in the embodiment of the present application, when the network interface card 702 receives the write data request, it obtains the information of the idle data page from the memory 703, and the idle data page can be used to cache the write data request. The written data. In this way, the network interface card 702 can directly obtain the information of the available buffer space from the memory 703, complete the preparation of the write data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device 700 to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card 702 to the network interface card 702 sending the write data request response message is shortened, and processing the write data request is improved Business efficiency.
可选的,所述内存703包括缓存,所述缓存是用于临时存储写入所述存储设备700的数据或用于临时存储从所述存储设备700读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。Optionally, the memory 703 includes a cache, which is used to temporarily store data written to the storage device 700 or to temporarily store data read from the storage device 700, in the page information table The recorded information of the idle data page is information of the idle data page in the cache.
可选的,上述存储设备700的实现方式,可以参考本申请实施例中图3-图6所示的存储阵列300的实现方式来实现。具体的,处理器701的实现方式可以参考存储阵列300中CPU302的实现方式,网络接口卡702的实现方式可以参考FC-HBA卡301的实现方式,内存703的实现方式可以参考内存303的实现方式,数据页面信息表的实现方式可以参考页面交换队列的实现方式来实现,具体不再赘述。示例性的,图3-图6中所示的FC驱动304所实现的功能或步骤,是CPU302通过运行所述FC-HBA卡301的驱动程序实现的,即FC驱动304所实现的功能或步骤可以由处理器701通过运行所述网络接口卡702的驱动程序来实现。Optionally, the implementation manner of the foregoing storage device 700 may be implemented with reference to the implementation manner of the storage array 300 shown in FIG. 3 to FIG. 6 in the embodiment of the present application. Specifically, the implementation of the processor 701 can refer to the implementation of the CPU 302 in the storage array 300, the implementation of the network interface card 702 can refer to the implementation of the FC-HBA card 301, and the implementation of the memory 703 can refer to the implementation of the memory 303 The implementation method of the data page information table can be implemented by referring to the implementation method of the page exchange queue, which will not be described in detail. Exemplarily, the functions or steps implemented by the FC driver 304 shown in FIGS. 3-6 are implemented by the CPU 302 by running the driver program of the FC-HBA card 301, that is, the functions or steps implemented by the FC driver 304 It may be implemented by the processor 701 by running the driver of the network interface card 702.
参考图8,图8为本申请实施例提供的一种网络接口卡800的结构示意图。如图8所示,网络接口卡800包括控制器801和网络端口802;其中,Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a network interface card 800 according to an embodiment of the present application. As shown in FIG. 8, the network interface card 800 includes a controller 801 and a network port 802; wherein,
所述网络端口802,用于通过网络接收写数据请求,所述写数据请求是向存储设备写入数据的请求,所述存储设备通过所述网络接口卡800接收向所述存储设备写入数据的请求和/或待存储的数据;The network port 802 is used to receive a write data request through a network, the write data request is a request to write data to a storage device, and the storage device receives write data to the storage device through the network interface card 800 Requests and/or data to be stored;
所述控制器801,用于从数据页面信息表记录的数据页面中,分配数据页面用于缓 存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述数据页面信息表是所述存储设备内存中的信息表,所述数据页面是所述内存中的空闲数据页面。The controller 801 is configured to allocate a data page from the data pages recorded in the data page information table to cache the data to be stored in the write data request, and send the write data preparation to the sender of the write data request to be completed Response message; wherein, the data page information table is an information table in the memory of the storage device, and the data page is an idle data page in the memory.
本申请实施例提供的网络接口卡800,在网络端口802接收到写数据请求时,控制器801从所述存储设备的内存中的数据页面信息表获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡800中的控制器801能够直接从内存获取可用的缓存空间的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。由于不需要所述存储设备中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡800接收写数据请求到其发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the network interface card 800 provided by the embodiment of the present application, when the network port 802 receives the write data request, the controller 801 obtains information of idle data pages from the data page information table in the memory of the storage device, the idle data The page can be used to cache the data to be written by the write data request. In this way, the controller 801 in the network interface card 800 can directly obtain the information of the available buffer space from the memory, complete the preparation of the write data, and send a response message to the sender of the write data request to complete the write data preparation. Since there is no need for multiple modules in the storage device to cooperate with each other to determine the available cache space, the time from receiving the write data request from the network interface card 800 to sending the write data request response message is shortened, and the time for processing the write data request service is improved s efficiency.
可选的,上述网络接口卡800的实现方式,可以参考本申请实施例中图3-图6所示的FC-HBA卡301的实现方式来实现。具体的,控制器801的实现方式可以参考FC芯片3011的实现方式,网络端口802的实现方式可以参考FC端口3012的实现方式具体不再赘述。Optionally, the implementation manner of the network interface card 800 may be implemented by referring to the implementation manner of the FC-HBA card 301 shown in FIGS. 3 to 6 in the embodiment of the present application. Specifically, the implementation manner of the controller 801 may refer to the implementation manner of the FC chip 3011, and the implementation manner of the network port 802 may refer to the implementation manner of the FC port 3012.
参考图9,图9为本申请实施例提供的一种处理写数据请求方法的流程示意图,包括:Referring to FIG. 9, FIG. 9 is a schematic flowchart of a method for processing a write data request according to an embodiment of the present application, including:
步骤900:接收写数据请求,所述写数据请求是向存储设备写入数据的请求;Step 900: Receive a write data request, which is a request to write data to a storage device;
步骤902:根据数据页面信息表中记录的数据页面的信息,分配用于缓存所述写数据请求所要写入数据的数据页面;其中,所述数据页面信息表是所述存储设备中内存中的信息表,所述数据页面是所述内存中空闲的数据页面;Step 902: According to the information of the data page recorded in the data page information table, allocate a data page for buffering the data to be written by the write data request; wherein, the data page information table is in the memory of the storage device Information table, the data page is a free data page in the memory;
步骤904:向所述写数据请求的发送方发送写数据准备完成的响应消息。Step 904: Send a response message to the sender of the data write request to complete the data write preparation.
上述方法中,在接收到写数据请求时,从内存中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,能够在接收到写数据请求时,直接从内存获取可用的缓存空间的信息,完成写数据的准备,并向写数据请求的发送方发送写数据准备完成的响应消息。缩短了从接收写数据请求到发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the above method, when a write data request is received, information of an idle data page is obtained from the memory, and the idle data page can be used to cache the data to be written by the write data request. In this way, when a write data request is received, the available buffer space information can be directly obtained from the memory, the preparation of the write data can be completed, and a response message can be sent to the sender of the write data request to complete the write data preparation. The time from receiving the write data request to sending the write data request response message is shortened, and the efficiency in processing the write data request service is improved.
可选的,上述方法的实现方式,可以参考本申请实施例中图3-图6所示的实现方式来实现。具体的,步骤900可以参考上述图5中步骤S502的实现方式,步骤902可以参考上述图5中步骤S503的实现方式,步骤904可以参考上述图5中步骤S504的实现方式,具体不再赘述。可选的,图9所示的方法流程,进一步还可以参考图4和图6中所示的方法流程来实现,不再赘述。Optionally, the implementation manner of the above method may be implemented by referring to the implementation manners shown in FIG. 3 to FIG. 6 in the embodiments of the present application. Specifically, for step 900, reference may be made to the implementation of step S502 in FIG. 5, for step 902, reference may be made to the implementation of step S503 in FIG. 5, and for step 904, reference may be made to the implementation of step S504 in FIG. 5, which is not described in detail. Optionally, the method flow shown in FIG. 9 can be further implemented by referring to the method flow shown in FIG. 4 and FIG. 6, and details are not described again.
参考图10,图10为本申请实施例提供的一种信息处理系统100的结构示意图。存储设备100包括服务器101和存储设备102,所述服务器100用于向所述存储设备102写入数据或从所述存储设备102读取数据;存储设备102包括处理器1021、网络接口卡1022和内存1023其中:Referring to FIG. 10, FIG. 10 is a schematic structural diagram of an information processing system 100 according to an embodiment of the present application. The storage device 100 includes a server 101 and a storage device 102. The server 100 is used to write data to or read data from the storage device 102; the storage device 102 includes a processor 1021, a network interface card 1022, and Memory 1023 where:
所述处理器1021,用于通过运行所述网络接口卡1022的驱动程序,在所述内存1023中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor 1021 is configured to create a data page information table in the memory 1023 by running a driver of the network interface card 1022, and the data page information table is used to record information of free data pages in the memory ;
所述网络接口卡1022,用于接收所述服务器101发送的写数据请求,根据所述数据 页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述服务器101发送写数据准备完成的响应消息。The network interface card 1022 is configured to receive the write data request sent by the server 101, and allocate the data pages recorded in the data page information table for caching according to the information of the data pages recorded in the data page information table The write data requests the data to be stored, and sends a response message to the server 101 that the write data preparation is complete.
本申请实施例提供的信息处理系统100,网络接口卡1022在接收到服务器101发送的写数据请求时,从内存1023中获取空闲的数据页面的信息,该空闲的数据页面能够用于缓存所述写数据请求所要写入的数据。这样,网络接口卡1022能够直接从内存1023获取可用的缓存空间的信息,完成写数据的准备,并向服务器101发送写数据准备完成的响应消息。由于不需要存储设备102中的多个模块相互配合以确定可用缓存空间,缩短了从网络接口卡1022接收写数据请求到网络接口卡1022发送写数据请求响应消息的时间,提高了处理写数据请求业务时的效率。In the information processing system 100 provided by the embodiment of the present application, when receiving the write data request sent by the server 101, the network interface card 1022 obtains the information of the free data page from the memory 1023, and the free data page can be used to cache the Write data request data to be written. In this way, the network interface card 1022 can directly obtain the information of the available buffer space from the memory 1023, complete the preparation of the write data, and send a response message to the server 101 that the write data preparation is completed. Since there is no need for multiple modules in the storage device 102 to cooperate with each other to determine the available buffer space, the time from receiving the write data request from the network interface card 1022 to sending the write data request response message from the network interface card 1022 is shortened, and processing the write data request is improved Business efficiency.
可选的,所述内存1023还包括缓存,所述缓存是用于临时存储写入所述存储设备102的数据或用于临时存储从所述存储设备102读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。Optionally, the memory 1023 further includes a cache, which is used to temporarily store data written to the storage device 102 or to temporarily store data read from the storage device 102, and the page information table The information of the idle data page recorded in is the information of the idle data page in the cache.
可选的,上述信息处理系统100的实现方式,可以参考本申请实施例中图3-图6所示的存储阵列300和服务器400的实现方式来实现。具体的,服务器101的实现方式可以参考服务器400的实现方式,处理器1021的实现方式可以参考存储阵列300中CPU302的实现方式,网络接口卡1022的实现方式可以参考FC-HBA卡301的实现方式,内存1023的实现方式可以参考内存303的实现方式,数据页面信息表的实现方式可以参考页面交换队列的实现方式来实现,具体不再赘述。示例性的,图3-图6中所示的FC驱动304所实现的功能或步骤,是CPU302通过运行所述FC-HBA卡301的驱动程序实现的,即FC驱动304所实现的功能或步骤可以由处理器1021通过运行所述网络接口卡1022的驱动程序来实现。Optionally, the implementation manner of the foregoing information processing system 100 may be implemented with reference to the implementation manners of the storage array 300 and the server 400 shown in FIGS. 3 to 6 in the embodiment of the present application. Specifically, the implementation of the server 101 can refer to the implementation of the server 400, the implementation of the processor 1021 can refer to the implementation of the CPU 302 in the storage array 300, and the implementation of the network interface card 1022 can refer to the implementation of the FC-HBA card 301 The implementation of the memory 1023 can refer to the implementation of the memory 303, and the implementation of the data page information table can refer to the implementation of the page exchange queue, and details will not be described in detail. Exemplarily, the functions or steps implemented by the FC driver 304 shown in FIGS. 3-6 are implemented by the CPU 302 by running the driver program of the FC-HBA card 301, that is, the functions or steps implemented by the FC driver 304 It can be implemented by the processor 1021 by running the driver of the network interface card 1022.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的模块及步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art may realize that the modules and steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly explain the hardware and software, Interchangeability, in the above description, the composition and steps of each example have been generally described according to function. Whether these functions are executed in hardware or software depends on the specific application of the technical solution and design constraints. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a division of logical functions. In actual implementation, there may be other divisions, for example, multiple modules or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections through some interfaces, devices, or units, and may also be electrical, mechanical, or other forms of connection.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present invention.
另外,在本发明各个实施例中的各功能模块可以集成在一个处理单元中,也可以是 各个模块单独物理存在,也可以是两个或两个以上模块集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The above integrated unit may be implemented in the form of hardware or software functional unit.
所述集成的模块如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention essentially or part of the contribution to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium In it, several instructions are included to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage media include various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed by the present invention. Modifications or replacements, these modifications or replacements should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (26)

  1. 一种存储设备,包括处理器、网络接口卡和内存,其特征在于:A storage device, including a processor, a network interface card and memory, is characterized by:
    所述处理器,用于通过运行所述网络接口卡的驱动程序,在所述内存中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
    所述网络接口卡,用于接收写数据请求,根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述写数据请求是向所述存储设备写入数据的请求。The network interface card is used to receive a write data request, and according to the information of the data page recorded in the data page information table, allocate the data page recorded in the data page information table to cache the write data request to be stored And send a response message to the sender of the write data request to complete the write data preparation; wherein, the write data request is a request to write data to the storage device.
  2. 根据权利要求1所述的存储设备,其特征在于:The storage device according to claim 1, wherein:
    所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息;The memory includes a cache, which is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the information of idle data pages recorded in the page information table is Information about idle data pages in the cache;
    所述处理器,还用于通过运行所述网络接口卡的驱动程序,从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。The processor is also used to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page into the data page information table.
  3. 根据权利要求1或2所述的存储设备,其特征在于:The storage device according to claim 1 or 2, wherein:
    所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。The data page information table contains multiple entries, and each entry is used to record information of an idle data page.
  4. 根据权利要求1-3所述的任一存储设备,其特征在于:The storage device according to any one of claims 1-3, characterized in that:
    所述空闲数据页面的信息包括所述空闲数据页面的物理地址信息和长度信息。The information of the idle data page includes physical address information and length information of the idle data page.
  5. 根据权利要求1-4所述的任一存储设备,其特征在于:The storage device according to any one of claims 1 to 4, wherein:
    所述数据页面信息表是在所述内存中创建的页面交换队列,所述页面交换队列以队列形式包含多个表项。The data page information table is a page exchange queue created in the memory, and the page exchange queue contains multiple entries in the form of a queue.
  6. 根据权利要求1-5所述的任一存储设备,其特征在于,所述网络接口卡包括控制器和网络端口;其中,The storage device according to any one of claims 1 to 5, wherein the network interface card includes a controller and a network port; wherein,
    所述网络端口,用于接收所述写数据请求;The network port is used to receive the write data request;
    所述控制器,用于根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息。The controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request The sender of the write data request sends a response message that write data preparation is complete.
  7. 根据权利要求6所述的存储设备,其特征在于,The storage device according to claim 6, wherein:
    所述控制器,还用于将接收到的所述写数据请求所要存储的数据,迁移到所分配的数据页面对应的缓存空间中;The controller is also used to migrate the data to be stored in the received data write request to the cache space corresponding to the allocated data page;
    所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述内存中空闲的数据页面交换到所述数据页面信息表中。The processor is also used to exchange a free data page in the memory into the data page information table by running a driver of the network interface card.
  8. 根据权利要求1-7所述的任一存储设备,其特征在于,所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述数据页面信息表在所述内存中的虚拟地址转换为物理地址;The storage device according to any one of claims 1-7, wherein the processor is further configured to virtualize the data page information table in the memory by running a driver of the network interface card The address is converted to a physical address;
    所述网络接口卡通过所述数据页面信息表的物理地址访问所述数据页面信息表。The network interface card accesses the data page information table through the physical address of the data page information table.
  9. 一种网络接口卡,其特征在于,包括控制器和网络端口;其中,A network interface card, characterized in that it includes a controller and a network port; wherein,
    所述网络端口,用于通过网络接收写数据请求,所述写数据请求是向存储设备写入数据的请求,所述存储设备通过所述网络接口卡接收向所述存储设备写入数据的请求和 /或待存储的数据;The network port is used to receive a write data request through a network, the write data request is a request to write data to a storage device, and the storage device receives a request to write data to the storage device through the network interface card And/or data to be stored;
    所述控制器,用于从数据页面信息表记录的数据页面中,分配数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息;其中,所述数据页面信息表是所述存储设备内存中的信息表,所述数据页面是所述内存中的空闲数据页面。The controller is configured to allocate a data page from the data page recorded in the data page information table to cache the data to be stored in the write data request, and send the write data preparation to the sender of the write data request Response message; wherein, the data page information table is an information table in the memory of the storage device, and the data page is an idle data page in the memory.
  10. 根据权利要求9所述的网络接口卡,其特征在于:The network interface card according to claim 9, wherein:
    所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息。The memory includes a cache, which is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the information of idle data pages recorded in the page information table is Information about idle data pages in the cache.
  11. 根据权利要求9或10所述的网络接口卡,其特征在于:The network interface card according to claim 9 or 10, characterized in that:
    所述控制器,还用于接收所述数据页面信息表的配置信息,根据所述数据页面信息表的配置信息访问所述数据页面信息表;其中,所述配置信息包括所述数据页面信息表的起始地址、表项的数量和格式。The controller is further configured to receive configuration information of the data page information table and access the data page information table according to the configuration information of the data page information table; wherein, the configuration information includes the data page information table Start address, number and format of entries.
  12. 根据权利要求9-11所述的任一网络接口卡,其特征在于:The network interface card according to any one of claims 9-11, characterized in that:
    所述网络端口,还用于通过网络接收所述写数据请求所要写入的数据;The network port is also used to receive the data to be written by the write data request through the network;
    所述控制器,还用于缓存所述数据,并将所述数据迁移到已分配的数据页面所对应的内存中。The controller is also used to cache the data and migrate the data to the memory corresponding to the allocated data page.
  13. 一种处理写数据请求的方法,其特征在于,所述方法包括:A method for processing a write data request, characterized in that the method includes:
    接收写数据请求,所述写数据请求是向存储设备写入数据的请求;Receiving a write data request, which is a request to write data to a storage device;
    根据数据页面信息表中记录的数据页面的信息,分配用于缓存所述写数据请求所要写入数据的数据页面;其中,所述数据页面信息表是所述存储设备中内存中的信息表,所述数据页面是所述内存中空闲的数据页面;According to the information of the data page recorded in the data page information table, allocate a data page for buffering the data to be written by the write data request; wherein, the data page information table is an information table in the memory of the storage device, The data page is a free data page in the memory;
    向所述写数据请求的发送方发送写数据准备完成的响应消息。Send a response message to the sender of the write data request to complete the write data preparation.
  14. 根据权利要求13所述的存储设备,其特征在于,所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息,所述方法还包括:The storage device according to claim 13, wherein the memory includes a cache, and the cache is used to temporarily store data written to the storage device or temporarily store data read from the storage device, The information of the idle data page recorded in the page information table is information of the idle data page in the cache, and the method further includes:
    从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。Apply for an idle data page from the cache, and configure the information of the applied idle data page into the data page information table.
  15. 根据权利要求13或14所述的存储设备,其特征在于:The storage device according to claim 13 or 14, wherein:
    所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。The data page information table contains multiple entries, and each entry is used to record information of an idle data page.
  16. 根据权利要求13-15所述的任一存储设备,其特征在于:A storage device according to any one of claims 13-15, characterized in that:
    所述数据页面的信息包括所述空闲数据页面的物理地址信息和长度信息。The information of the data page includes physical address information and length information of the idle data page.
  17. 根据权利要求13-16所述的任一存储设备,其特征在于:A storage device according to any one of claims 13-16, characterized in that:
    所述页面信息表是在所述内存中创建的页面交换队列,所述页面交换队列以队列形式包含多个表项。The page information table is a page exchange queue created in the memory, and the page exchange queue contains multiple entries in the form of a queue.
  18. 根据权利要求13-17所述的任一方法,其特征在于,所述方法还包括:A method according to any one of claims 13-17, characterized in that the method further comprises:
    将接收到的所述写数据请求所要写入的数据,迁移到所分配的数据页面所对应的内存中;Migrate the data to be written in the received data write request to the memory corresponding to the allocated data page;
    将所述内存中空闲的数据页面交换到所述数据页面信息表中。Exchanging free data pages in the memory into the data page information table.
  19. 一种信息处理系统,包括服务器和存储设备,所述服务器用于向所述存储设备写入数据或从所述存储设备读取数据;所述存储设备包括处理器、网络接口卡和内存,其特征在于:An information processing system includes a server and a storage device, the server is used to write data to or read data from the storage device; the storage device includes a processor, a network interface card, and a memory, which The characteristics are:
    所述处理器,用于通过运行所述网络接口卡的驱动程序,在所述内存中创建数据页面信息表,所述数据页面信息表用于记录所述内存中空闲数据页面的信息;The processor is configured to create a data page information table in the memory by running a driver of the network interface card, and the data page information table is used to record information of free data pages in the memory;
    所述网络接口卡,用于接收所述服务器发送的写数据请求,根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述服务器发送写数据准备完成的响应消息。The network interface card is used to receive a write data request sent by the server, and allocate the data page recorded in the data page information table for caching the data page according to the information of the data page recorded in the data page information table Write data to request the data to be stored, and send a response message to the server that write data preparation is complete.
  20. 根据权利要求19所述的信息处理系统,其特征在于:The information processing system according to claim 19, characterized in that:
    所述内存包括缓存,所述缓存用于临时存储写入所述存储设备的数据或用于临时存储从所述存储设备读出的数据,所述页面信息表中记录的空闲数据页面的信息是所述缓存中的空闲数据页面的信息;The memory includes a cache, which is used to temporarily store data written to the storage device or to temporarily store data read from the storage device, and the information of idle data pages recorded in the page information table is Information about idle data pages in the cache;
    所述处理器,还用于通过运行所述网络接口卡的驱动程序,从所述缓存中申请空闲的数据页面,并将申请的空闲数据页面的信息配置到所述数据页面信息表中。The processor is also used to apply for a free data page from the cache by running a driver of the network interface card, and configure the information of the applied free data page into the data page information table.
  21. 根据权利要求19或20所述的信息处理系统,其特征在于:The information processing system according to claim 19 or 20, characterized in that:
    所述数据页面信息表包含多个表项,每个表项用于记录一个空闲数据页面的信息。The data page information table contains multiple entries, and each entry is used to record information of an idle data page.
  22. 根据权利要求19-21所述的任一信息处理系统,其特征在于:The information processing system according to any one of claims 19-21, characterized in that:
    所述空闲数据页面的信息包括所述空闲数据页面的物理地址信息和长度信息。The information of the idle data page includes physical address information and length information of the idle data page.
  23. 根据权利要求19-22所述的任一信息处理系统,其特征在于:An information processing system according to any one of claims 19-22, characterized in that:
    所述数据页面信息表是在所述内存中创建的页面交换队列,所述页面交换队列以队列形式包含多个表项。The data page information table is a page exchange queue created in the memory, and the page exchange queue contains multiple entries in the form of a queue.
  24. 根据权利要求19-23所述的任一信息处理系统,其特征在于,所述网络接口卡包括控制器和网络端口;其中,The information processing system according to any one of claims 19 to 23, wherein the network interface card includes a controller and a network port; wherein,
    所述网络端口,用于接收所述写数据请求;The network port is used to receive the write data request;
    所述控制器,用于根据所述数据页面信息表中记录的数据页面的信息,分配所述数据页面信息表中记录的数据页面用于缓存所述写数据请求所要存储的数据,并向所述写数据请求的发送方发送写数据准备完成的响应消息。The controller is configured to allocate the data page recorded in the data page information table based on the information of the data page recorded in the data page information table to cache the data to be stored in the write data request The sender of the write data request sends a response message that write data preparation is complete.
  25. 根据权利要求24所述的信息处理系统,其特征在于,The information processing system according to claim 24, characterized in that
    所述控制器,还用于将接收到的所述写数据请求所要存储的数据,迁移到所分配的数据页面对应的内存中;The controller is also used to migrate the data to be stored in the received write data request to the memory corresponding to the allocated data page;
    所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述内存中空闲的数据页面交换到所述数据页面信息表中。The processor is also used to exchange a free data page in the memory into the data page information table by running a driver of the network interface card.
  26. 根据权利要求19-25所述的任一信息处理系统,其特征在于,所述处理器还用于通过运行所述网络接口卡的驱动程序,将所述数据页面信息表在所述内存中的虚拟地址转换为物理地址;The information processing system according to any one of claims 19-25, wherein the processor is further configured to store the data page information table in the memory by running a driver of the network interface card Convert virtual address to physical address;
    所述网络接口卡通过所述数据页面信息表的物理地址访问所述数据页面信息表。The network interface card accesses the data page information table through the physical address of the data page information table.
PCT/CN2018/121054 2018-12-14 2018-12-14 Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message WO2020118650A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/121054 WO2020118650A1 (en) 2018-12-14 2018-12-14 Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message
CN201880014873.4A CN111642137A (en) 2018-12-14 2018-12-14 Method, device and system for quickly sending write data preparation completion message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/121054 WO2020118650A1 (en) 2018-12-14 2018-12-14 Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message

Publications (1)

Publication Number Publication Date
WO2020118650A1 true WO2020118650A1 (en) 2020-06-18

Family

ID=71076693

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/121054 WO2020118650A1 (en) 2018-12-14 2018-12-14 Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message

Country Status (2)

Country Link
CN (1) CN111642137A (en)
WO (1) WO2020118650A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918101B (en) * 2021-12-09 2022-03-15 苏州浪潮智能科技有限公司 Method, system, equipment and storage medium for writing data cache

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030079087A1 (en) * 2001-10-19 2003-04-24 Nec Corporation Cache memory control unit and method
US20100023676A1 (en) * 2008-07-25 2010-01-28 Moon Yang-Gi Solid state storage system for data merging and method of controlling the same according to both in-place method and out-of-place method
CN101827071A (en) * 2008-06-09 2010-09-08 飞塔公司 Network protocol reassembly accelaration
US20160314042A1 (en) * 2015-04-27 2016-10-27 Invensas Corporation Preferred state encoding in non-volatile memories

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100349142C (en) * 2004-05-25 2007-11-14 中国科学院计算技术研究所 Remote page access method for use in shared virtual memory system and network interface card
CN103645969B (en) * 2013-12-13 2017-06-20 华为技术有限公司 Data copy method and data-storage system
WO2018102969A1 (en) * 2016-12-05 2018-06-14 华为技术有限公司 Control method, device and system for data reading-writing command in nvme over fabric architecture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030079087A1 (en) * 2001-10-19 2003-04-24 Nec Corporation Cache memory control unit and method
CN101827071A (en) * 2008-06-09 2010-09-08 飞塔公司 Network protocol reassembly accelaration
US20100023676A1 (en) * 2008-07-25 2010-01-28 Moon Yang-Gi Solid state storage system for data merging and method of controlling the same according to both in-place method and out-of-place method
US20160314042A1 (en) * 2015-04-27 2016-10-27 Invensas Corporation Preferred state encoding in non-volatile memories

Also Published As

Publication number Publication date
CN111642137A (en) 2020-09-08

Similar Documents

Publication Publication Date Title
US9329783B2 (en) Data processing system and data processing method
US20200278880A1 (en) Method, apparatus, and system for accessing storage device
US10838665B2 (en) Method, device, and system for buffering data for read/write commands in NVME over fabric architecture
TWI732110B (en) Method and system for performing low latency direct data access to non-volatile flash memory
US10372340B2 (en) Data distribution method in storage system, distribution apparatus, and storage system
US9395921B2 (en) Writing data using DMA by specifying a buffer address and a flash memory address
US9734085B2 (en) DMA transmission method and system thereof
US20140195634A1 (en) System and Method for Multiservice Input/Output
US20190155548A1 (en) Computer system and storage access apparatus
US9092426B1 (en) Zero-copy direct memory access (DMA) network-attached storage (NAS) file system block writing
US20070067432A1 (en) Computer system and I/O bridge
AU2015402888B2 (en) Computer device and method for reading/writing data by computer device
US20220222016A1 (en) Method for accessing solid state disk and storage device
WO2016065611A1 (en) File access method, system and host
WO2023103704A1 (en) Data processing method, storage medium, and processor
US20110246600A1 (en) Memory sharing apparatus
US11604742B2 (en) Independent central processing unit (CPU) networking using an intermediate device
WO2020118650A1 (en) Method for quickly sending write data preparation completion message, and device, and system for quickly sending write data preparation completion message
US10430220B1 (en) Virtual devices as protocol neutral communications mediators
JP2866376B2 (en) Disk array device
JP2009070359A (en) Wide area communication network start system for improving start efficiency of hard disk-less type computer

Legal Events

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

Ref document number: 18943312

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18943312

Country of ref document: EP

Kind code of ref document: A1