WO2025215775A1 - デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラム - Google Patents
デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラムInfo
- Publication number
- WO2025215775A1 WO2025215775A1 PCT/JP2024/014580 JP2024014580W WO2025215775A1 WO 2025215775 A1 WO2025215775 A1 WO 2025215775A1 JP 2024014580 W JP2024014580 W JP 2024014580W WO 2025215775 A1 WO2025215775 A1 WO 2025215775A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- unit
- memory
- access
- data access
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Definitions
- the present invention relates to a device data access device, a device data access method, and a program.
- processors excel at different workloads (have high processing power). While general-purpose CPUs (Central Processing Units) are capable of high-speed, highly efficient calculations of highly parallel workloads that CPUs are not good at (have low processing power), there are accelerators (hereafter referred to as ACCs where appropriate) such as FPGAs (Field Programmable Gate Arrays), GPUs (Graphics Processing Units), and ASICs (Application Specific Integrated Circuits).
- ACCs Acceler
- FPGAs Field Programmable Gate Arrays
- GPUs Graphics Processing Units
- ASICs Application Specific Integrated Circuits
- vRAN virtual radio access network
- FEC Forward Error Correction processing
- a computer in computer systems, may be configured with hardware (CPU) that supports general-purpose processing and hardware (accelerator) that is specialized for specific calculations, offloading some of the calculation processing from the general-purpose processor running the software to the accelerator.
- CPU hardware
- accelerator hardware
- FIG. 17 is a simplified block diagram showing the hardware of a server in a computer system.
- the server hardware 10 includes a CPU (Central Processing Unit) 11, a memory cache 12, a memory (main memory) 13, and an external device unit 14.
- the CPU 11 is one of the computational resources that performs computation together with the accelerator.
- the external device unit 14 includes a network interface card (NIC) and an accelerator (ACC).
- the NIC is NIC hardware that realizes a network interface.
- the accelerator is a calculation accelerator device such as an FPGA/GPU that is specialized for a specific calculation.
- data is sent and received between the CPU 11 and the external device unit 14 .
- the CPU 11 and the external device unit 14 exchange data via a memory (main memory) 13.
- the server also has a user application unit (not shown), and the user application unit accesses data stored in the external device unit 14 via the memory 13.
- the external device unit 14 performs DMA (Direct Memory Access) transfers, which transfer data directly between the memory 13 without going through the CPU 11.
- DMA Direct Memory Access
- Non-Patent Document 1 Intel Data Direct I/O Technology (Intel is a registered trademark)
- Non-Patent Document 2 Effective Use of Intel Data Direct I/O Technology
- a direct write from the external device unit 14 to the memory cache 12 is performed as indicated by the white arrow aa in Fig. 17.
- a direct write to the memory cache 12 is an L3 cache hit (see Fig. 18 for details on L3). Since the external device unit 14 writes directly to the memory cache 12, the system satisfies "Requirement 1,” which requires a reduction in access time due to an L3 cache hit. It also satisfies "Requirement 2,” which requires application transparency, which means that no modifications to the application are required. However, since direct writing from the external device unit 14 to the memory cache 12 requires dedicated functions and mechanisms in the external device unit and the CPU (memory cache), it does not satisfy "Requirement 3,” which requires hardware versatility.
- FIG. 18 is a diagram illustrating the process of receiving data from an external device unit of a server in a computer system and the overhead caused by a cache miss.
- the same components as those in FIG. 17 are denoted by the same reference numerals.
- the server shown in FIG. 18 includes hardware 10, an OS 20, and a user application unit 31 in a user space 30.
- the user application unit 31 is an application that requires device IO.
- the OS 20 has an interrupt handler 21.
- the user application unit 31 and the OS 20 are connected via a Socket API or the like.
- access by interrupt There are two application modes: access by interrupt and access by polling.
- the external device unit 14 starts the interrupt handler 21 of the OS 20, and the user application unit 31 accesses the data transferred to the memory 13 in response to an interrupt from the interrupt handler 21.
- the external device unit 14 also notifies the interrupt handler 21 of the completion of the transfer by interrupt.
- the user application unit 31 accesses the memory 13 by polling.
- the polling method can be faster than the interrupt method.
- the left diagram in Figure 18 shows the access time for one access (8 bytes) to the hardware 10.
- L1, L2, L3, and DRAM access in the left diagram in Figure 18 indicate the level of access time, with the closer to the CPU the shorter the access time.
- L1 is the access time to the CPU's internal memory or memory cache 12
- the access time for one access (8 bytes) is the shortest at 1.0 - 4.0 ns. If we estimate that accessing one packet of 9000 bytes takes 1125 accesses, the time is approximately 30-50us, including 64-bit bulk transfers on the PCIe bus and hardware prefetching.
- Non-Patent Documents 1 and 2 require dedicated functions and mechanisms in the external device unit and CPU (memory cache), which poses the issue of requiring changes to existing applications, external device units, and CPUs (they do not satisfy "Requirement 3: Hardware Versatility”).
- the present invention was made in light of this background, and its objective is to process access to data transferred by an external device in a short time without changing existing applications or hardware.
- the present invention provides a device data access device that speeds up data access from an application unit to an external device unit, and is characterized by comprising: a data transfer completion detection unit that detects the completion of data transfer from the external device unit to the main memory when a processor and the external device unit exchange data via the main memory; and a prefetch instruction unit that, at the point in time when the data transfer completion detected by the data transfer completion detection unit has been completed, prefetches the data from the main memory whose transfer has been completed into a memory cache located between the processor and the main memory.
- access to data transferred by an external device can be processed in a short time without changing existing applications or hardware.
- FIG. 1 is a schematic configuration diagram of a device data high-speed access system according to a first embodiment of the present invention
- FIG. 1 is a diagram showing the hardware configuration of a high-speed device data access system according to an embodiment of the present invention, which uses simultaneous multithreading of a CPU to logically increase the number of CPU cores and assigns data processing threads to the logical cores to execute data processing in parallel.
- FIG. 10 is a diagram showing a correspondence table between device names and process names that access data transferred from the corresponding devices, which is provided in the device/data usage core correspondence recording unit of the device data access device of the device data high-speed access system according to an embodiment of the present invention.
- FIG. 1 is a diagram showing a correspondence table between process names and operating logical core IDs provided in a device/data use core correspondence recording unit of a device data access device of a device data high-speed access system according to an embodiment of the present invention.
- FIG. 1 is a diagram illustrating a basic operation of a device data access device of a high-speed device data access system according to an embodiment of the present invention.
- 10 is a diagram illustrating a proactive prefetch operation by an interrupt of a device data access device of a high-speed device data access system according to an embodiment of the present invention.
- FIG. 1 is a diagram showing a correspondence table between process names and operating logical core IDs provided in a device/data use core correspondence recording unit of a device data access device of a device data high-speed access system according to an embodiment of the present invention.
- FIG. 1 is a diagram illustrating a basic operation of a device data access device of a high-speed device data access system according to an embodiment of the present invention.
- 10 is
- 10A and 10B are diagrams illustrating a proactive prefetch operation triggered by an interrupt from a device data access device of a high-speed device data access system according to an embodiment of the present invention, in comparison with the polling method before application.
- 10 is a flowchart showing a proactive prefetch process using an interrupt from the device data access device of the high-speed device data access system according to the embodiment of the present invention.
- 10A and 10B are diagrams illustrating a proactive prefetch operation by polling of a device data access device of a high-speed device data access system according to an embodiment of the present invention.
- FIGS. 10A and 10B are diagrams illustrating a proactive prefetch operation by Polling of a device data access device of a high-speed device data access system according to an embodiment of the present invention, in comparison with an interrupt method before application.
- 10 is a flowchart showing a proactive prefetch process by polling of the device data access device of the high-speed device data access system according to the embodiment of the present invention.
- FIG. 10 is a schematic configuration diagram of a device data high-speed access system according to a second embodiment of the present invention.
- FIG. 10 is a schematic configuration diagram of a device data high-speed access system according to a third embodiment of the present invention.
- FIG. 10 is a diagram illustrating an example of the configuration of a device data utilization core correspondence recording unit of a device data access apparatus of a device data high-speed access system according to a third embodiment of the present invention.
- FIG. 10 is a schematic configuration diagram of a device data high-speed access system according to a fourth embodiment of the present invention.
- FIG. 10 is a hardware configuration diagram showing an example of a computer that realizes the functions of a device data high-speed access system according to a fourth embodiment of the present invention.
- FIG. 2 is a simplified block diagram showing the hardware of a server in the computer system.
- 10A and 10B are diagrams illustrating a process of receiving data from an external device unit of a server in a computer system and overhead caused by a cache miss.
- (First embodiment) 1 is a schematic diagram of a device data high-speed access system according to a first embodiment of the present invention, in which the same components as those in FIG. 18 are given the same reference numerals.
- the device data high-speed access system 1000 comprises hardware 10, a device data access device 100 located on an OS 20, and a user application unit 31 located in a user space 30.
- the hardware 10 includes a CPU 11 , a memory cache 12 , a memory (main memory) 13 , and an external device unit 14 .
- the CPU 11 is a typical CPU installed in a server computer, and has a plurality of processing cores and a communication function with the external device unit 14 via interrupts.
- the memory cache 12 is a functional unit within the CPU 11 or independent from the CPU 11, and temporarily caches and holds data from the memory 13.
- the memory cache 12 is configured with elements that are capable of responding faster than the memory 13.
- the memory 13 is configured with a charge-type dynamic random access memory (DRAM)
- the memory cache 12 is configured with a static random access memory (SRAM).
- DRAM charge-type dynamic random access memory
- SRAM static random access memory
- the memory 13 is a functional unit configured with elements such as DRAM, and receives and records data transferred from the external device unit 14. In addition, the memory 13 responds to a request from the CPU 11 with the recorded data.
- the external device unit 14 includes a NIC and an accelerator (ACC).
- the NIC and the accelerator (ACC) have the function of transferring data to the memory 13. When the transfer is completed, the NIC and the accelerator (ACC) can notify the CPU by an interrupt.
- the external device unit 14 includes an NIC and an accelerator (ACC), but the external device unit 14 may include either an NIC or an accelerator (accelerator or NIC).
- the types and numbers of NICs and accelerators may be any.
- accelerators include FPGAs, GPUs, ASICs, and AI (artificial intelligence) accelerators.
- the external device unit 14 is connected to the server via a bus such as PCI Express.
- the external device unit 14 performs DMA transfer, which transfers data directly to and from the memory 13 without going through the CPU 11 .
- the user application section 31 is an application that receives data from the external device section 14 .
- Methods that trigger data reception include a "polling method" in which the user application unit 31 accesses the memory 13 at regular intervals, and a method triggered by an interrupt from the external device unit 14.
- a method for receiving data in addition to a method in which the user application section 31 directly accesses the memory 13, there is also a method in which the user application section 31 accesses the memory 13 via the OS 20.
- the device data access apparatus 100 speeds up data access from the user application unit 31 to the external device unit 14 when the processor and the external device unit 14 exchange data via the memory (main memory) 13 .
- the device data access device 100 includes a data transfer completion detection unit 110, a prefetch instruction unit 120, an interrupt handling unit 130, a polling unit 140, a data access suppression unit 150, an interrupt suppression unit 160, a polling suppression unit 170, a data transfer completion detection execution core selection unit 180, a prefetch target cache selection unit 190, and a device/data usage core correspondence recording unit 200.
- the data transfer completion detection unit 110 detects the completion of data transfer from the external device unit 14 to the memory (main memory) 13. Specifically, the data transfer completion detection unit 110 detects the completion of data transfer by an interrupt from the external device unit 14 (FIGS. 6 to 8) or by polling processing from the CPU 11 (processor) (FIGS. 9 to 11).
- the data transfer completion detection unit 110 detects the completion of data transfer from the external device unit 14 to the memory 13 via the polling unit 140 and the interrupt handling unit 130 . After detecting the completion of the data transfer, the data transfer completion detection unit 110 notifies the prefetch instruction unit of the "size,”"memoryaddress,” and "device ID" of the transferred data.
- the prefetch instruction unit 120 prefetches the data from the memory (main memory) 13 whose transfer has been completed into the memory cache 12 located between the CPU 11 (processor) and the memory (main memory) 13.
- the prefetch instruction unit 120 instructs the CPU 11 to load data from memory into the cache. Specifically, the prefetch instruction unit 120 instructs the CPU 11 to issue a memory prefetch command based on the memory address, physical core, and memory cache hierarchy (left diagram in FIG. 18).
- the physical core/memory cache hierarchy to be specified may be inquired of by the prefetch target cache selection unit 190 . Taking an Intel CPU as an example, the instruction to be issued is to select an instruction that is suitable for the specified memory cache hierarchy from among a plurality of prefetch instructions for different caches to be loaded, and to issue the instruction.
- the interrupt handling unit 130 detects the completion of the data transfer by an interrupt from the external device unit 14 notifying the completion of the data transfer.
- the polling unit 140 detects the completion of data transfer by repeatedly accessing the memory 13 at a fixed interval.
- the data access suppression unit 150 suppresses memory access until prefetching to the memory cache is completed. Specifically, the data access suppression unit 150 suppresses data access from the user application unit 31 through the polling suppression unit 170 and the interrupt suppression unit 160 until the prefetch instruction from the prefetch instruction unit 120 is completed. The data access suppression unit 150 suppresses data access in response to an instruction from the prefetch instruction unit 120, and releases the suppression in response to an instruction from the prefetch instruction unit 120. For example, the data access suppression unit 150 suppresses access from the user application unit 31 to data that has been loaded onto the memory 13 and transferred from the external device unit 14.
- the interrupt suppression unit 160 suppresses and releases memory access by masking or unmasking interrupt processing. Specifically, the interrupt suppression unit 160 suppresses notifications by interrupts from the external device unit 14 while the suppression is instructed.
- One method of suppressing interrupts is to temporarily disable interrupt notifications from the device by masking the interrupt controller of the CPU.
- the polling suppression unit 170 suppresses and releases memory access by stopping or starting the polling thread on the receiving side. Specifically, the polling suppression unit 170 suppresses memory access by polling during the period in which suppression is instructed.
- Example 1 A method of setting the allocation of calculation time to a polling thread of a user application to zero by setting the scheduler.
- Example 2 A method in which a control flag for suppressing polling is provided in the polling thread and polling is suppressed according to the control flag.
- the data transfer completion detection execution core selection unit 180 selects a core of the external device unit 14 that will perform data transfer completion detection, and sets the selected core so that data transfer completion detection is performed by the selected core.
- the data transfer completion detection execution core selection unit 180 queries the device/data usage core correspondence recording unit 200 based on the device name, obtains information about the core on which the process using the device is running, and sets it up so that data transfer completion detection is performed.
- Example 1 When the proactive method is an interrupt
- the detection method adopted by the data transfer completion detection unit 110 is an interrupt, an interrupt handler for detection is started in the relevant core by setting the interrupt mask of the CPU.
- Example 2 When the proactive method is polling
- the detection method adopted by the data transfer completion detection unit 110 is polling
- the process that performs the polling is fixed to the core by using the Linux taskset command or the like.
- the prefetch target cache selection unit 190 selects a memory cache to be prefetched by identifying information about the physical core in which the process that uses the data is running, based on the ID of the data source device. Here, the relationship between the device ID, the process that uses the data, and the physical core of that process is obtained from the user application unit 31.
- the device/data-using-core correspondence record unit 200 holds the device that performs the data transfer, the name of the process that accesses the data transferred by the device, and the physical core number on which the process operates.
- SMT simultaneous multithreading
- CPUs have simultaneous multithreading (SMT) functionality, which allows one physical core to be separated into multiple logical cores for operation.
- SMT such as Intel Hyper Threading allows the CPU's microinstruction processors to be shared between logical cores, increasing the utilization rate of the processors.
- FIG. 2 is a diagram showing the hardware configuration of a high-speed device data access system that uses simultaneous multithreading of a CPU to logically increase the number of CPU cores and assign data processing threads to the logical cores to execute data processing in parallel.
- the hardware 10 shown in FIG. 2 includes a CPU 11 , a memory cache 12 , and a memory (main memory) 13 .
- the CPU 11 has a physical core #A and a physical core #B (physical core 15).
- the physical core #A can operate separately as a logical core #1 and a logical core #2 (logical core 16), and the physical core #B can operate separately as a logical core #3 and a logical core #4 (logical core 16).
- Logical core #1 and logical core #2 are cores on which a process named router_process (FIG. 3) accessed by the NIC runs, and logical core #3 and logical core #4 are cores on which a process named acc_process_1 (FIG. 3) accessed by the accelerator runs.
- the memory cache 12 includes an L2 cache [individual core] 12A corresponding to physical core #A, an L2 cache [individual core] 12A corresponding to physical core #B, and an L3 memory cache [shared between cores] 12B.
- FIG. 3 is a diagram showing a correspondence table 210 stored in the device-data-using-core correspondence recording unit 200, which lists device names and process names that access data transferred from the corresponding devices.
- the device name "NIC” is associated with the process name “router_process” that accesses the data to be transferred from the device.
- the device name “Accelerator” is associated with the process name “acc_process_1” that accesses the data to be transferred from the device.
- the process name correspondence table 210 is determined in advance for each application or system, and is therefore set in advance by the designer.
- FIG. 4 shows a correspondence table 220 of process names and operating logical core IDs, which is provided in the device-data-using-core correspondence recording unit 200.
- the process name "router_process” corresponds to the operating logical core IDs "1, 2" (logical core #1 and logical core #2), and the process name “acc_process” corresponds to the operating logical core IDs "3, 4" (logical core #3 and logical core #4).
- the logical core ID correspondence table 220 dynamically acquires the cores (affinity settings) on which each process may run from the OS 20 (FIG. 1) and reflects the information in the table.
- the prefetch target cache selection unit 190 ( Figure 1) references the process name correspondence table 210 in the device/data usage core correspondence recording unit 200 to obtain the process name that will access the data transferred from the device in question from the device name, and then references the logical core ID correspondence table 220 from this process name to identify the operating logical core ID, thereby selecting the memory cache to prefetch (L2 cache [individual core] 12A, L3 [shared between cores] 12B).
- FIG. 5 is a diagram for explaining the basic operation of the device data access apparatus 100 of the device data high-speed access system 1000.
- FIG. 5 is shown in contrast to the explanatory diagram of the technical background and problems in FIG.
- the user application unit 31 shown in FIG. 5 is an application that requires device IO, in this case an application that receives data from the external device unit 14 .
- a device data access device 100 is arranged on an OS 20. Upon completion of data transfer from an external device unit 14 to a memory (main memory) 13, the device data access device 100 prefetches the data from the memory (main memory) 13 whose transfer has been completed into a memory cache 12.
- the device data access device 100 proactively detects the completion of data transfer from the external device unit 14 and pre-loads the data into the memory cache 12 using pre-fetching, thereby reducing the memory access overhead of the CPU 11.
- the device data access apparatus 100 detects the completion of the transfer by an interrupt from the external device unit 14 or by polling processing from the CPU 11 . Whether access is by polling or by an interrupt from the external device unit 14 is determined by the application format of the user application unit 31 .
- the operation of the device data access apparatus 100 by proactive prefetching will be explained separately for ⁇ proactive prefetching by interrupt> (FIGS. 6 to 8) and ⁇ proactive prefetching by polling> (FIGS. 9 to 11).
- FIG. 6 is a diagram for explaining the proactive prefetch operation by interruption of the device data access apparatus 100.
- the same components as those in FIG. 5 are denoted by the same reference numerals.
- the device data access apparatus 100 performs prefetching to the memory cache 12 when an interrupt from the hardware 10 is detected (see "Prefetch instruction" in FIG. 6). This enables the device data access apparatus 100 to process access to data transferred by an external device unit in a short time without changing existing applications or hardware.
- FIG. 7 is a diagram illustrating a proactive prefetch operation triggered by an interrupt, in comparison with the polling method before application.
- the upper diagram of Fig. 7 shows the behavior of an application in a comparative example before application of this embodiment
- the lower diagram of Fig. 7 shows the proactive prefetch operation triggered by an interrupt after application of this embodiment.
- the polling interval (white arrow b in the upper diagram of Fig. 7) between polling (symbol a1 in the upper diagram of Fig. 7) and polling (symbol a2 in the upper diagram of Fig. 7) is the first overhead (overhead #1).
- the access speed of memory 13 made up of DRAM is slower than that of memory cache 12 such as SRAM, and this DRAM access is repeated multiple times, which is the second overhead (overhead #2) (shaded arrow c in the upper diagram of Fig. 7).
- the problem with the behavior of the application (polling method) in the comparative example before application is as follows: All memory accesses after polling result in cache misses, so the DRAM access time is long (overhead #2).
- a transfer completion interrupt switch (symbol d in the lower diagram of FIG. 7 ) is used as a trigger to prefetch 12 data (here, three times) (symbol e in the lower diagram of FIG. 7 ) to the memory cache.
- the prefetching of 12 data to the memory cache is performed within the polling interval (symbols a1 and a2 in the lower diagram of FIG. 7 ).
- the polling interval is a cause of overhead (overhead #1), but this polling interval is used to prefetch 12 data to the memory cache within this polling interval (symbol e in the lower diagram of FIG. 7 ). Because the prefetching (symbol e in the lower diagram of FIG. 7 ) is performed within the polling interval (symbols a1 and a2 in the lower diagram of FIG. 7 ), all subsequent memory accesses (symbol f in the lower diagram of FIG. 7 ) during polling (symbol a2 in the lower diagram of FIG. 7 ) result in cache hits (symbol g in the lower diagram of FIG. 7 ). This reduces the memory access time of the polling thread. As a result, overhead #2, which occurs due to long DRAM access time, can be reduced. According to the inventors' calculations, accessing one packet of 9000 bytes took a maximum of 17 us, a reduction of approximately 15 us.
- FIG. 8 is a flowchart showing the proactive prefetch process using an interrupt.
- This flow is an example of a method for proactive detection using interrupts, in which the user application unit 31 detects data arrival by polling.
- the data transfer completion detection execution core selection unit 180 selects a core in the external device unit 14 that will perform data transfer completion detection, and sets the selected core to perform data transfer completion detection.
- the detection method adopted by the data transfer completion detection unit 110 is an interrupt
- the CPU interrupt mask is set so that an interrupt handler for detection is started in the selected core.
- step S11 when the transfer is complete, the external device unit 14 sends an interrupt notification to the device data access device 100.
- step S12 the data transfer completion detection unit 110 detects the completion of data transfer from the external device unit 14 to the memory 13 via the polling unit 140 and the interrupt handling unit 130.
- step S13 the interrupt handling unit 130 detects the completion of the data transfer through a data transfer completion notification interrupt from the external device unit 14.
- step S14 the prefetch instruction unit 120 instructs the CPU 11 to load the data in memory 13 into the cache.
- step S15 the data access suppression unit 150 suppresses data access from the user application unit 31 via the polling suppression unit 170 and the interrupt suppression unit 160 until the prefetch instruction from the prefetch instruction unit 120 is completed.
- step S16 the polling suppression unit 170 suppresses memory access by polling during the period for which suppression is instructed.
- step S17 the prefetch target cache selection unit 190 selects the memory cache to prefetch from by identifying information about the physical core on which the process using the data is running, based on the ID of the data source device.
- step S18 the device/data-using-core correspondence recording unit 200 stores the device that performs the data transfer, the name of the process that accesses the data transferred by that device, and the physical core number on which that process is running.
- step S19 the prefetch instruction unit 120 issues a prefetch command to the prefetch target core.
- step S20 the user application unit 31 detects data reception triggered by polling, accesses the memory, and ends the processing of this flow.
- pre-emptive pre-fetching using interrupts we will explain pre-emptive pre-fetching using polling.
- FIG. 9 is a diagram for explaining the proactive prefetch operation by polling of the device data access apparatus 100.
- the same components as those in FIG. 5 are denoted by the same reference numerals.
- the device data access apparatus 100 performs prefetching to the memory cache 12 when it detects the completion of data transfer from the hardware 10 by polling (see "Prefetch instruction" in FIG. 9).
- FIG. 10 is a diagram illustrating a proactive prefetch operation using Polling in comparison with the interrupt method before application of this embodiment.
- the upper diagram of Fig. 10 shows the behavior of an application using the interrupt method of the comparative example before application of this embodiment
- the lower diagram of Fig. 10 shows the proactive prefetch operation using an interrupt trigger after application of this embodiment.
- the transfer completion interrupt switch (symbol h in the upper diagram of Fig. 10) is the first overhead (overhead #3) (symbol i in the upper diagram of Fig. 10).
- the DRAM access (symbol j in the upper diagram of Fig. 10) to the memory 13 configured by DRAM has a slow access speed and is repeated multiple times, which is the second overhead (overhead #2) (shaded arrow k in the upper diagram of Fig. 10).
- FIG. 11 is a flowchart showing the proactive prefetch process using polling.
- This flow is an example of a method for proactive detection by polling, in which the user application unit 31 detects data arrival by an interrupt.
- the data transfer completion detection execution core selection unit 180 selects a core in the external device unit 14 that will perform data transfer completion detection, and sets the selected core to perform data transfer completion detection. Furthermore, if the detection method adopted by the data transfer completion detection unit 110 is an interrupt, the CPU interrupt mask is set so that an interrupt handler for detection is started in the selected core.
- step S21 the external device unit 14 transfers the data to the memory 13, and when the transfer is complete, notifies the CPU 11 via an interrupt.
- step S22 the data transfer completion detection unit 110 detects the completion of data transfer from the external device unit 14 to the memory 13 via the polling unit 140 and the interrupt handling unit 130.
- step S23 the polling unit 140 detects the completion of data transfer by repeatedly accessing the memory 13 at regular intervals.
- step S24 the prefetch instruction unit 120 instructs the CPU to load the data in memory 13 into the cache.
- step S25 the data access suppression unit 150 suppresses data access from the user application unit 31 via the polling suppression unit 170 and the interrupt suppression unit 160 until the prefetch instruction from the prefetch instruction unit 120 is completed.
- step S26 the interrupt suppression unit 160 suppresses notifications due to interrupts from the external device unit during the period for which suppression is instructed.
- step S27 the prefetch target cache selection unit 190 selects the memory cache to prefetch from by identifying information about the physical core on which the process using the data is running, based on the ID of the data source device.
- step S28 the device/data-using-core correspondence recording unit 200 stores the device that performs the data transfer, the name of the process that accesses the data transferred by that device, and the physical core number on which that process is running.
- step S29 the prefetch instruction unit 120 issues a prefetch command to the prefetch target core.
- step S30 the user application section 31 receives the interrupt, performs memory access, and ends the processing of this flow.
- proactive prefetching using Polling we have explained about proactive prefetching using Polling.
- Second Embodiment 12 is a schematic diagram of a device data high-speed access system according to a second embodiment of the present invention, in which the same components as those in FIG. 5 are denoted by the same reference numerals.
- the device data high-speed access system 1000A comprises hardware 10, an OS 20, and a user application unit 31 on a user space 30, and on the OS 20, a device data access device 100, an access suppression unit 230, and a scheduler 240 are arranged.
- the access inhibiting unit 230 inhibits access to the memory area from the application until the device data access apparatus 100 completes the prefetch.
- the access suppression unit 230 receives from the device data access device 100 "notification to the scheduler 220/suppression of polling from applications by CPU setting" (suppression method 1) and “temporary suspension of interrupts by interrupt mask setting” (suppression method 2).
- the device data access device 100 can prevent device access from occurring from an application before prefetching is complete.
- a prefetch target cache and hierarchy are selected by identifying a core that uses data transferred from a device.
- Fig. 13 is a schematic diagram of a device data high-speed access system 1000B according to a third embodiment of the present invention. The same components as those in Fig. 2, Fig. 5, and Fig. 18 are assigned the same reference numerals.
- Fig. 13 shows the relevant units (prefetch instruction unit 120, data transfer completion detection execution core selection unit 180, prefetch target cache selection unit 190, and device/data usage core correspondence recording unit 200) extracted from the device data access apparatus 100 in Fig. 5.
- Fig. 14 is an example configuration of the device/data usage core correspondence recording unit 200 shown in Fig. 13.
- the device/data usage core correspondence recording unit 200 shown in Fig. 13 stores the device that performs the data transfer, the name of the process that accesses the data transferred by that device, and the physical core number on which that process runs, as well as the data usage core and device shown in Fig. 14.
- the data usage core is physical core #B and the device is the NIC, and physical core #B and the device is an accelerator.
- the prefetch instruction unit 120 suppresses access to the memory area from the application until prefetching is complete. Specifically, the prefetch instruction unit 120 "prevents polling from the application by setting the scheduler” or “temporarily suspends interrupts by setting an interrupt mask.”
- prefetching main memory data it is desirable to prefetch to a cache that is as close as possible to the CPU core that will access the data. As shown in the enlarged left image of Figure 13, it is desirable to prefetch to a cache that is closer to the CPU core, for example, L2 (approximately 256kb) rather than L3 (approximately 2-4mb), and to prefetch to L1 (approximately 64kb) rather than L2 (approximately 256kb).
- the device data access device 100 selects the cache to be prefetched based on information in the "device/data usage core correspondence recording unit 200" which records the correspondence between devices and data usage cores, and realizes prefetching to a location close to the core that uses the data. Furthermore, in this embodiment, the proactive prefetch operation described in the first and second embodiments is initiated by the corresponding prefetch target core. By enabling the execution of the prefetch command to be executed by a core close to the core that uses the data, the overhead due to transitions between cores is further reduced.
- the fourth embodiment of the present invention describes a specific example of an application.
- 15 is a schematic diagram of a device data high-speed access system according to a fourth embodiment of the present invention, in which the same components as those in FIG. 5 are denoted by the same reference numerals.
- a Web server application 31A and a device data access apparatus 100 are arranged in a user space 30.
- the web server application 31A receives requests from clients via a network and responds to them.
- the web server application is, for example, Apache or Nginx.
- a request in the Web server application 31A is received in the form of a packet via the NIC.
- the packet reception process from the NIC is performed by "memory access triggered by an interrupt.”
- the proactive prefetch operation anticipates memory access from the web server application, resulting in a cache hit when the web server application accesses memory, thereby shortening access time.
- the device data access apparatus 100 (FIG. 1) according to the above embodiment is realized by a computer 900 having a configuration as shown in FIG. 16, for example.
- FIG. 16 is a hardware configuration diagram showing an example of a computer 900 that realizes the functions of the device data access apparatus 100.
- the device data access apparatus 100 includes a CPU 901, a RAM 902, a ROM 903, a HDD 904, an accelerator 905, an input/output interface (I/F) 906, a media interface (I/F) 907, and a communication interface (I/F) 908.
- the accelerator 905 corresponds to the accelerator of the external device unit 14 in FIG. 1 .
- Accelerator 905 is an accelerator (external device unit 14) ( Figure 1) that processes at least one of data from communication I/F 908 and data from RAM 902 at high speed. Accelerator 905 may be of a type that returns the execution results to CPU 901 or RAM 902 after executing processing from CPU 901 or RAM 902 (look-aside type). Accelerator 905 may also be of a type that performs processing between communication I/F 908 and CPU 901 or RAM 902 (in-line type).
- the accelerator 905 is connected to an external device 915 via a communication I/F 908.
- the input/output I/F 906 is connected to an input/output device 916.
- the media I/F 907 reads and writes data from a recording medium 917.
- the CPU 901 operates based on a program stored in the ROM 903 or HDD 904, and controls each part of the device data access apparatus 100 shown in Fig. 1 by executing a program (also called an application or an app for short) loaded into the RAM 902.
- This program can also be distributed via a communication line or recorded on a recording medium 917 such as a CD-ROM.
- the ROM 903 stores a boot program executed by the CPU 901 when the computer 900 is started, programs that depend on the hardware of the computer 900, and the like.
- the CPU 901 controls an input/output device 916, which is made up of input units such as a mouse and keyboard, and output units such as a display and printer, via an input/output I/F 906.
- the CPU 901 acquires data from the input/output device 916 via the input/output I/F 906, and outputs generated data to the input/output device 916.
- a GPU Graphics Processing Unit
- a processor may also be used as a processor in addition to the CPU 901.
- the HDD 904 stores programs executed by the CPU 901 and data used by those programs.
- the communication I/F 908 receives data from an external device 915 via a communication network (e.g., NW (Network)) and outputs the data to the CPU 901, and also transmits data generated by the CPU 901 to the external device 915 via the communication network.
- NW Network
- Media I/F 907 reads the program or data stored on recording medium 917 and outputs it to CPU 901 via RAM 902.
- CPU 901 loads the program related to the target processing from recording medium 917 onto RAM 902 via media I/F 907, and executes the loaded program.
- Recording medium 917 is an optical recording medium such as a DVD (Digital Versatile Disc) or a PD (Phase Change Rewritable Disk), a magneto-optical recording medium such as an MO (Magneto Optical Disk), a magnetic recording medium, a conductive memory tape medium, or a semiconductor memory, etc.
- the CPU 901 of the computer 900 executes a program loaded onto the RAM 902 to realize the functions of the device data access apparatus 100.
- the data in the RAM 902 is stored in the HDD 904.
- the CPU 901 reads and executes a program related to the target processing from the recording medium 917.
- the CPU 901 may read a program related to the target processing from an external device 915 via a communications network.
- the device data access device 100 speeds up data access from the application unit (user application unit 31) to the external device unit 14, and includes a data transfer completion detection unit 110 that detects the completion of data transfer from the external device unit 14 to the main memory (memory 13) when the processor (CPU 11) and the external device unit 14 exchange data via the main memory (memory 13), and a prefetch instruction unit 120 that, at the time of data transfer completion detected by the data transfer completion detection unit 110, prefetches the data from the main memory whose transfer has been completed into the memory cache 12 located between the processor (CPU 11) and the main memory (memory 13).
- a data transfer completion detection unit 110 that detects the completion of data transfer from the external device unit 14 to the main memory (memory 13) when the processor (CPU 11) and the external device unit 14 exchange data via the main memory (memory 13
- a prefetch instruction unit 120 that, at the time of data transfer completion detected by the data transfer completion detection unit 110, prefetches the data from the main memory
- the device data access apparatus 100 can proactively detect the completion of data transfer from the external device unit 14 and pre-load the data into the memory cache 12 using pre-fetching, thereby reducing the memory access overhead of the CPU 11. As a result, access to data transferred by the external device unit 14 can be processed in a short time without changing existing applications or hardware.
- the device data access device 100 can satisfy Requirement 1: (Access time) Speeding up access from applications to main memory (reducing direct access to main memory due to cache misses). Furthermore, the device data access device 100 can satisfy Requirement 2: (App transparency) No changes to existing applications are required. Furthermore, the device data access device 100 can satisfy Requirement 3: (Hardware versatility) No special functions such as direct loading to cache are required for the hardware.
- the data transfer completion detection unit 110 detects the completion of data transfer through an interrupt from the external device unit 14 or polling from the processor.
- the device data access device 100 performs prefetching proactively, independent of the user application, by having the data transfer completion detection unit 110 start prefetching when it detects that the data transfer has completed. This allows the device data access device 100 to satisfy "Requirement 1: Access time” and "Requirement 2: Application transparency.” Furthermore, because detection of data transfer completion can be achieved using general-purpose hardware functions such as polling or interrupts, it can also satisfy "Requirement 3: Hardware versatility.”
- the device data access device 100 ( Figure 1) is equipped with a data access suppression unit 150 that suppresses memory access until prefetching to the memory cache 12 is complete.
- the data access suppression unit 150 can suppress data access from the user application unit 31 via the polling suppression unit 170 and the interrupt suppression unit 160 until the prefetch instruction from the prefetch instruction unit 120 is completed.
- the device data access device 100 ( Figure 1) is equipped with a polling suppression unit 170 that suppresses and releases memory access by stopping or starting the polling thread on the receiving side.
- the polling suppression unit 170 can suppress memory access by polling during the period when suppression is instructed.
- the device data access device 100 ( Figure 1) is equipped with an interrupt suppression unit 160 that suppresses and releases memory access by masking or unmasking interrupt processing.
- notifications by interrupt from the external device unit 14 can be suppressed during the period when the suppression is instructed.
- the processor's physical cores are separated into a prefetch-only core and a CPU core that performs data access.
- the polling interval shown for CPU core #1 (proactive) in the lower diagram of Figure 7 is used, and 12 prefetches (symbol e in the lower diagram of Figure 7) are made to the memory cache within this polling interval, and prefetches (symbol e in the lower diagram of Figure 7) are made within the polling interval (symbols a1 and a2 in the lower diagram of Figure 7).
- a transfer completion interrupt switch (symbol n in the lower diagram of Figure 10) is triggered to prefetch 12 into the memory cache (symbol l in the lower diagram of Figure 10). Because CPU core #1 (proactive) has performed a prefetch (symbol l in the lower diagram of Figure 10), subsequent memory accesses during polling (symbol o in the lower diagram of Figure 10) have the effect of resulting in a cache hit (symbol p in the lower diagram of Figure 10).
- the above-mentioned configurations, functions, processing units, processing means, etc. may be realized in hardware, for example by designing them as integrated circuits.
- the above-mentioned configurations, functions, etc. may be realized by software that allows a processor to interpret and execute programs that realize each function.
- Information on the programs, tables, files, etc. that realize each function can be stored in memory, recording devices such as hard disks and SSDs (Solid State Drives), or recording media such as IC (Integrated Circuit) cards, SD (Secure Digital) cards, and optical discs.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
ユーザアプリケーション部(31)から外部デバイス部(14)へのデータアクセスを高速化するデバイスデータアクセス装置(100)であって、CPU(11)と外部デバイス部(14)が、メモリ(13)を介してデータをやりとりする際、外部デバイス部(14)からメモリ(13)へのデータ転送の完了を検知するデータ転送完了検知部(110)と、データ転送完了検知部(110)が検知したデータ転送完了時点で、転送が完了したメインメモリのデータを、CPU(11)とメモリ(13)の間にあるメモリキャッシュ(12)へプリフェッチするプリフェッチ指示部(120)と、備える。
Description
本発明は、デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラムに関する。
プロセッサの種別に応じて、得意(処理能力が高い)とするワークロードが異なる。汎用性の高いCPU(Central Processing Unit)に対し、CPUが苦手(処理能力が低い)とする並列度の高いワークロードを、高速かつ高効率に演算可能なFPGA(Field Programmable Gate Array)/(以下の説明において、「/」は「または」を表記する)GPU(Graphics Processing Unit)/ASIC(Application Specific Integrated Circuit)等のアクセラレータ(以下、適宜ACCという)がある。これらの異種プロセッサを組み合わせ、CPUの苦手とするワークロードをACCへオフロードして演算することで、総合的な演算時間や演算効率を向上させるオフロード技術の活用が進んでいる。
vRAN(virtual Radio Access Network)等ではCPUのみでは性能が足りず要件を満たせない場合に、FPGAやGPUなどの高速演算可能なアクセラレータに一部の処理をオフロードすることが行われている。
ACCオフロードが行われる具体的ワークロードとしては、vRANにおける符号化/復号化処理(FEC:Forward Error Correction処理)、音声や映像のメディア処理、暗号化/復号化処理等が代表例として挙げられる。
ACCオフロードが行われる具体的ワークロードとしては、vRANにおける符号化/復号化処理(FEC:Forward Error Correction処理)、音声や映像のメディア処理、暗号化/復号化処理等が代表例として挙げられる。
計算機システムにおいて、計算機(以下、アクセラレータ搭載サーバ)上に、汎用処理に対応したハードウェア(CPU)と特定の演算に特化したハードウェア(アクセラレータ)を搭載し、ソフトウェアの動作する汎用プロセッサからアクセラレータに対し一部の演算処理をオフロードする構成をとることがある。
図17は、計算機システムのサーバのハードウェアを簡略化して示すブロック図である。
サーバのハードウェア10は、CPU(Central Processing Unit)11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、外部デバイス部14と、を備える。
CPU11は、アクセラレータとともに計算を行う計算リソースの一つである。
外部デバイス部14は、NIC(Network Interface Card)と、アクセラレータ(ACC)と、を有する。NICは、NWインターフェイスを実現するNICハードウェアである。アクセラレータは、特定の演算に特化したFPGA/GPU等の計算アクセラレータデバイスである。
サーバのハードウェア10は、CPU(Central Processing Unit)11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、外部デバイス部14と、を備える。
CPU11は、アクセラレータとともに計算を行う計算リソースの一つである。
外部デバイス部14は、NIC(Network Interface Card)と、アクセラレータ(ACC)と、を有する。NICは、NWインターフェイスを実現するNICハードウェアである。アクセラレータは、特定の演算に特化したFPGA/GPU等の計算アクセラレータデバイスである。
計算機システムにおいて、CPU11と、外部デバイス部14との間で、データを送受する。
CPU11と外部デバイス部14は、メモリ(メインメモリ)13を介してデータのやり取りを行う。また、サーバは、図示しないユーザアプリケーション部を有し、ユーザアプリケーション部は、メモリ13を介して、外部デバイス部14が格納したデータにアクセスする。
CPU11と外部デバイス部14は、メモリ(メインメモリ)13を介してデータのやり取りを行う。また、サーバは、図示しないユーザアプリケーション部を有し、ユーザアプリケーション部は、メモリ13を介して、外部デバイス部14が格納したデータにアクセスする。
外部デバイス部14は、メモリ13との間でCPU11を介さずに直接データ転送を行うDMA(Direct Memory Access)転送を行う。
[既存技術]
既存技術には、Intel Data Direct I/O Technology (「Intelは登録商標」)(非特許文献1)、およびインテルデータ・ダイレクト I/O テクノロジーの効果的な利用がある(非特許文献2)。
非特許文献1、2は、いずれも、デバイスからメモリキャッシュに直接書き込みを行う機能に関する技術であり、アプリケーションからのメモリアクセス時間を短縮する。
既存技術には、Intel Data Direct I/O Technology (「Intelは登録商標」)(非特許文献1)、およびインテルデータ・ダイレクト I/O テクノロジーの効果的な利用がある(非特許文献2)。
非特許文献1、2は、いずれも、デバイスからメモリキャッシュに直接書き込みを行う機能に関する技術であり、アプリケーションからのメモリアクセス時間を短縮する。
図17に上記既存技術を適用した例では、図17の白抜き矢印aaに示すように、外部デバイス部14からメモリキャッシュ12に直接書き込みを行う。ここでは、メモリキャッシュ12への直接書き込みは、L3キャッシュヒットである(L3については、後記図18)。
外部デバイス部14からメモリキャッシュ12に直接書き込みを行うので、L3キャッシュヒットによるアクセス時間短縮が可能であるという要件「要件1」を満たす。また、アプリケーションへの改変が不要であるアプリ透過性を有するという要件「要件2」を満たす。しかしながら、外部デバイス部14からメモリキャッシュ12に直接書き込みを行うためには、外部デバイス部および、CPU(メモリキャッシュ)に、専用の機能や仕組みが必要なことから、ハードウェア汎用性という要件「要件3」は満たさない。
外部デバイス部14からメモリキャッシュ12に直接書き込みを行うので、L3キャッシュヒットによるアクセス時間短縮が可能であるという要件「要件1」を満たす。また、アプリケーションへの改変が不要であるアプリ透過性を有するという要件「要件2」を満たす。しかしながら、外部デバイス部14からメモリキャッシュ12に直接書き込みを行うためには、外部デバイス部および、CPU(メモリキャッシュ)に、専用の機能や仕組みが必要なことから、ハードウェア汎用性という要件「要件3」は満たさない。
既存技術の外部デバイス部からのデータ受信処理と、キャッシュミスによるオーバヘッドについて説明する。
図18は、計算機システムのサーバの外部デバイス部からのデータ受信処理と、キャッシュミスによるオーバヘッドについて説明する図である。図17と同一構成部分には、同一符号を付している。
図18に示すサーバは、ハードウェア10と、OS20と、ユーザ空間30上にユーザアプリケーション部31と、を備える。
ユーザアプリケーション部31は、デバイスIOを要するアプリケーションである。
OS20は、割込みハンドラ21を有する。ユーザアプリケーション部31とOS20は、Socket APIなどを介して接続される。
図18は、計算機システムのサーバの外部デバイス部からのデータ受信処理と、キャッシュミスによるオーバヘッドについて説明する図である。図17と同一構成部分には、同一符号を付している。
図18に示すサーバは、ハードウェア10と、OS20と、ユーザ空間30上にユーザアプリケーション部31と、を備える。
ユーザアプリケーション部31は、デバイスIOを要するアプリケーションである。
OS20は、割込みハンドラ21を有する。ユーザアプリケーション部31とOS20は、Socket APIなどを介して接続される。
アプリケーションの形態としては、割り込みによるアクセスと、pollingによるアクセスの2つの方法がある。
図18に示すように、割り込みによるアクセスの場合、外部デバイス部14は、OS20の割込みハンドラ21を起動し、割込みハンドラ21の割り込みによりユーザアプリケーション部31がメモリ13に転送されたデータにアクセスする。また、外部デバイス部14は、割込みハンドラ21に転送完了を割込通知する。
図18に示すように、割り込みによるアクセスの場合、外部デバイス部14は、OS20の割込みハンドラ21を起動し、割込みハンドラ21の割り込みによりユーザアプリケーション部31がメモリ13に転送されたデータにアクセスする。また、外部デバイス部14は、割込みハンドラ21に転送完了を割込通知する。
一方、ユーザアプリケーション部31がpollingにより外部デバイス部14と通信するpolling方式の場合、ユーザアプリケーション部31は、メモリ13に対してpollingによりアクセスする。polling方式は、polling間隔によっては、割り込み方式に比べて高速化できる。
図18左図は、ハードウェア10の1回(8bytes)のアクセス時間を示す図である。図18左図のL1,L2,L3,DRAMアクセスは、アクセス時間のレベルを示しており、CPUに近いほどアクセス時間は短い。例えば、L1は、CPU内部メモリ、またはメモリキャッシュ12へのアクセス時間であり、1回(8bytes)のアクセス時間は1.0 - 4.0 nsと最短である。
1Packet 9000bytesへのアクセスについて、1125回アクセスした場合を試算すると、PCIeバスの64bit一括転送やハードウェアプリフェッチを含めると、約30-50usとなる。
1Packet 9000bytesへのアクセスについて、1125回アクセスした場合を試算すると、PCIeバスの64bit一括転送やハードウェアプリフェッチを含めると、約30-50usとなる。
"Intel Data Direct I/O Technology",[online],[令和6年3月1日検索],インターネット〈URL:https://www.intel.com/content/www/us/en/io/data-direct-i-o-technology.html〉
"インテル データ・ダイレクト I/O テクノロジーの効果的な利用",[online],[令和6年3月1日検索],インターネット〈URL:https://www.isus.jp/products/vtune/vtune-cookbook-effective-utilization-of-data-direct-io-technology/〉
しかしながら、従来技術には、下記課題がある。
CPU11と外部デバイス部14が、主記憶(メインメモリ)を介し、データをやりとりするケースにおいて、CPU11が外部デバイス部14からメモリに転送されたデータにアクセスする際には、毎回必ずキャッシュミスが生じ、毎回メモリまでアクセスを行うため、オーバヘッドがある。例えば、図18に示すように、割り込みによるアクセスの場合、初回アクセスでは、キャッシュヒットなし(図18のメモリキャッシュ12の破線囲み参照)であり、オーバヘッドになる。このため、キャッシュミスによる、メインメモリへの直接アクセスが増え、ユーザアプリケーション部31からメインメモリへのアクセスの高速化が図られないという課題がある(「要件1:アクセス時間」を満たさない)。
CPU11と外部デバイス部14が、主記憶(メインメモリ)を介し、データをやりとりするケースにおいて、CPU11が外部デバイス部14からメモリに転送されたデータにアクセスする際には、毎回必ずキャッシュミスが生じ、毎回メモリまでアクセスを行うため、オーバヘッドがある。例えば、図18に示すように、割り込みによるアクセスの場合、初回アクセスでは、キャッシュヒットなし(図18のメモリキャッシュ12の破線囲み参照)であり、オーバヘッドになる。このため、キャッシュミスによる、メインメモリへの直接アクセスが増え、ユーザアプリケーション部31からメインメモリへのアクセスの高速化が図られないという課題がある(「要件1:アクセス時間」を満たさない)。
既存技術(非特許文献1、2)は、外部デバイス部および、CPU(メモリキャッシュ)に、専用の機能や仕組みが必要なことから、既存のアプリケーション、外部デバイス部および、CPUを変更する必要があるという課題がある(「要件3:ハードウェア汎用性」を満たさない)。
このような背景を鑑みて本発明がなされたのであり、本発明は、既存のアプリケーションやハードウェアを変更することなく、外部デバイス部が転送したデータへのアクセスを、短時間で処理することを課題とする。
前記した課題を解決するため、本発明は、アプリケーション部から外部デバイス部へのデータアクセスを高速化するデバイスデータアクセス装置であって、プロセッサと前記外部デバイス部が、メインメモリを介してデータをやりとりする際、前記外部デバイス部から前記メインメモリへのデータ転送の完了を検知するデータ転送完了検知部と、前記データ転送完了検知部が検知したデータ転送完了時点で、転送が完了した前記メインメモリのデータを、前記プロセッサと前記メインメモリの間にあるメモリキャッシュへプリフェッチするプリフェッチ指示部と、備えることを特徴とするデバイスデータアクセス装置とした。
本発明によれば、既存のアプリケーションやハードウェアを変更することなく、外部デバイス部が転送したデータへのアクセスを、短時間で処理することができる。
以下、図面を参照して本発明を実施するための形態(以下、「本実施形態」という)におけるデバイスデータ高速アクセスシステム等について説明する。
(第1の実施形態)
図1は、本発明の第1の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図18と同一構成部分には、同一符号を付している。
(第1の実施形態)
図1は、本発明の第1の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図18と同一構成部分には、同一符号を付している。
図1に示すように、デバイスデータ高速アクセスシステム1000は、ハードウェア10と、OS20上に配置されたデバイスデータアクセス装置100と、ユーザ空間30上にユーザアプリケーション部31と、を備える。
[ハードウェア10]
ハードウェア10は、CPU11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、外部デバイス部14と、を備える。
ハードウェア10は、CPU11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、外部デバイス部14と、を備える。
<CPU11>
CPU11は、サーバ型コンピュータに搭載される一般的なCPUであり、複数の演算コアと、割り込みによる外部デバイス部14との通信機能を持つ。
CPU11は、サーバ型コンピュータに搭載される一般的なCPUであり、複数の演算コアと、割り込みによる外部デバイス部14との通信機能を持つ。
<メモリキャッシュ12>
メモリキャッシュ12は、CPU11内、もしくはCPU11から独立した機能部であり、メモリ13のデータを一時的にキャッシュして保持する。
メモリキャッシュ12は、メモリ13に比べ、高速な応答が可能な素子で構成される。例えば、メモリ13は、電荷型のDRAM(Dynamic Random Access Memory)で構成され、メモリキャッシュ12は、SRAM(Static Random Access Memory)で構成される。
メモリキャッシュ12は、CPU11内、もしくはCPU11から独立した機能部であり、メモリ13のデータを一時的にキャッシュして保持する。
メモリキャッシュ12は、メモリ13に比べ、高速な応答が可能な素子で構成される。例えば、メモリ13は、電荷型のDRAM(Dynamic Random Access Memory)で構成され、メモリキャッシュ12は、SRAM(Static Random Access Memory)で構成される。
<メモリ13>
メモリ13は、DRAMなどの素子で構成される機能部であり、外部デバイス部14からのデータ転送を受け付け、記録する。また、メモリ13は、CPU11からの要求に応じて、記録しているデータを応答する。
メモリ13は、DRAMなどの素子で構成される機能部であり、外部デバイス部14からのデータ転送を受け付け、記録する。また、メモリ13は、CPU11からの要求に応じて、記録しているデータを応答する。
<外部デバイス部14>
外部デバイス部14は、NICと、アクセラレータ(ACC)と、を有する。NICとアクセラレータ(ACC)は、データをメモリ13に転送する機能を持つ。また、転送の完了時には、CPUに対して割り込みにより通知を行うことができる。
本実施形態では、外部デバイス部14が、NICとアクセラレータ(ACC)を備える例であるが、NICとアクセラレータのいずれか一方(アクセラレータもしくはNIC)を備えるものでもよい。また、NICとアクセラレータの種類、個数はどのようなものでもよい。例えば、アクセラレータは、FPGA/GPU/ASICの他、AI(Artificial Intelligence:人工知能)アクセラレータも含まれる。
外部デバイス部14は、PCI Expressなどのバスを介して、サーバに接続される。
外部デバイス部14は、メモリ13との間でCPU11を介さずに直接データ転送を行うDMA転送を行う。
外部デバイス部14は、NICと、アクセラレータ(ACC)と、を有する。NICとアクセラレータ(ACC)は、データをメモリ13に転送する機能を持つ。また、転送の完了時には、CPUに対して割り込みにより通知を行うことができる。
本実施形態では、外部デバイス部14が、NICとアクセラレータ(ACC)を備える例であるが、NICとアクセラレータのいずれか一方(アクセラレータもしくはNIC)を備えるものでもよい。また、NICとアクセラレータの種類、個数はどのようなものでもよい。例えば、アクセラレータは、FPGA/GPU/ASICの他、AI(Artificial Intelligence:人工知能)アクセラレータも含まれる。
外部デバイス部14は、PCI Expressなどのバスを介して、サーバに接続される。
外部デバイス部14は、メモリ13との間でCPU11を介さずに直接データ転送を行うDMA転送を行う。
[ユーザアプリケーション部31]
ユーザアプリケーション部31は、外部デバイス部14からデータ受信を行うアプリケーションである。
データ受信のトリガとなる方法としては、ユーザアプリケーション部31からメモリ13に対し、一定間隔でアクセスを行う「ポーリング方式」や、外部デバイス部14からの割り込みを契機とした方法がある。
また、データ受信の方法としては、ユーザアプリケーション部31からメモリ13に直接アクセスする方法に加え、OS20を介してアクセスする方法がある。
ユーザアプリケーション部31は、外部デバイス部14からデータ受信を行うアプリケーションである。
データ受信のトリガとなる方法としては、ユーザアプリケーション部31からメモリ13に対し、一定間隔でアクセスを行う「ポーリング方式」や、外部デバイス部14からの割り込みを契機とした方法がある。
また、データ受信の方法としては、ユーザアプリケーション部31からメモリ13に直接アクセスする方法に加え、OS20を介してアクセスする方法がある。
[デバイスデータアクセス装置100]
デバイスデータアクセス装置100は、プロセッサと外部デバイス部14が、メモリ(メインメモリ)13を介してデータをやりとりする際、ユーザアプリケーション部31から外部デバイス部14へのデータアクセスを高速化する。
デバイスデータアクセス装置100は、プロセッサと外部デバイス部14が、メモリ(メインメモリ)13を介してデータをやりとりする際、ユーザアプリケーション部31から外部デバイス部14へのデータアクセスを高速化する。
デバイスデータアクセス装置100は、データ転送完了検知部110と、プリフェッチ指示部120と、割込ハンドリング部130と、ポーリング部140と、データアクセス抑制部150と、割込抑制部160と、ポーリング抑制部170と、データ転送完了検知実行コア選定部180と、プリフェッチ対象キャッシュ選定部190と、デバイス・データ利用コア対応記録部200と、を備える。
<データ転送完了検知部110>
データ転送完了検知部110は、外部デバイス部14からメモリ(メインメモリ)13へのデータ転送の完了を検知する。具体的には、データ転送完了検知部110は、データ転送完了を、外部デバイス部14からの割込み(図6乃至図8)、または、CPU11(プロセッサ)からのポーリング処理(図9乃至図11)により検知する。
データ転送完了検知部110は、外部デバイス部14からメモリ(メインメモリ)13へのデータ転送の完了を検知する。具体的には、データ転送完了検知部110は、データ転送完了を、外部デバイス部14からの割込み(図6乃至図8)、または、CPU11(プロセッサ)からのポーリング処理(図9乃至図11)により検知する。
データ転送完了検知部110は、ポーリング部140や割込ハンドリング部130を介して、外部デバイス部14からメモリ13へのデータ転送の完了を検知する。
データ転送完了検知部110は、データ転送の完了を検知したのち、プリフェッチ指示部に対し、転送が完了したデータの”サイズ” “メモリアドレス” “デバイスのID”を通知する。
データ転送完了検知部110は、データ転送の完了を検知したのち、プリフェッチ指示部に対し、転送が完了したデータの”サイズ” “メモリアドレス” “デバイスのID”を通知する。
<プリフェッチ指示部120>
プリフェッチ指示部120は、データ転送完了検知部110が検知したデータ転送完了時点で、転送が完了したメモリ(メインメモリ)13のデータを、CPU11(プロセッサ)とメモリ(メインメモリ)13の間にあるメモリキャッシュ12へプリフェッチする。
プリフェッチ指示部120は、データ転送完了検知部110が検知したデータ転送完了時点で、転送が完了したメモリ(メインメモリ)13のデータを、CPU11(プロセッサ)とメモリ(メインメモリ)13の間にあるメモリキャッシュ12へプリフェッチする。
プリフェッチ指示部120は、CPU11に対し、メモリ上のデータの、キャッシュへのロードを指示する。具体的には、プリフェッチ指示部120は、メモリアドレス・物理コア・メモリキャッシュ階層(図18左図)をもとに、CPU11に対し、メモリプリフェッチ命令の発行を指示する。
指示する対象の物理コア・メモリキャッシュ階層については、プリフェッチ対象キャッシュ選定部190に問い合わせる形でもよい。
発行する命令は、Intel CPUを例にとると、ロード対象のキャッシュの異なる複数種プリフェッチ命令から、指定されたメモリキャッシュ階層に適合する命令を選び、発行を指示する。
指示する対象の物理コア・メモリキャッシュ階層については、プリフェッチ対象キャッシュ選定部190に問い合わせる形でもよい。
発行する命令は、Intel CPUを例にとると、ロード対象のキャッシュの異なる複数種プリフェッチ命令から、指定されたメモリキャッシュ階層に適合する命令を選び、発行を指示する。
<割込ハンドリング部130>
割込ハンドリング部130は、外部デバイス部14からの、データ転送完了の通知割り込みにより、データ転送の完了を検知する。
割込ハンドリング部130は、外部デバイス部14からの、データ転送完了の通知割り込みにより、データ転送の完了を検知する。
<ポーリング部140>
ポーリング部140は、メモリ13への、一定周期でのアクセスの繰り返しにより、データ転送の完了を検知する。
ポーリング部140は、メモリ13への、一定周期でのアクセスの繰り返しにより、データ転送の完了を検知する。
<データアクセス抑制部150>
データアクセス抑制部150は、メモリキャッシュへのプリフェッチが完了するまで、メモリアクセスを抑制する。具体的には、データアクセス抑制部150は、プリフェッチ指示部120によるプリフェッチ指示が完了するまで、ポーリング抑制部170および、割込抑制部160を通じ、ユーザアプリケーション部31からの、データアクセスを抑制する。
データアクセス抑制部150は、プリフェッチ指示部120からの指示によりデータアクセスを抑制し、同じくプリフェッチ指示部120からの指示により、解除する。例えば、データアクセス抑制部150は、メモリ13上にロードされた、外部デバイス部14から転送されたデータへの、ユーザアプリケーション部31からのアクセスを抑制する。
データアクセス抑制部150は、メモリキャッシュへのプリフェッチが完了するまで、メモリアクセスを抑制する。具体的には、データアクセス抑制部150は、プリフェッチ指示部120によるプリフェッチ指示が完了するまで、ポーリング抑制部170および、割込抑制部160を通じ、ユーザアプリケーション部31からの、データアクセスを抑制する。
データアクセス抑制部150は、プリフェッチ指示部120からの指示によりデータアクセスを抑制し、同じくプリフェッチ指示部120からの指示により、解除する。例えば、データアクセス抑制部150は、メモリ13上にロードされた、外部デバイス部14から転送されたデータへの、ユーザアプリケーション部31からのアクセスを抑制する。
<割込抑制部160>
割込抑制部160は、メモリアクセスの抑制と解除を、割り込み処理のマスク、またはマスク解除によって行う。具体的には、割込抑制部160は、抑制が指示されている期間は、外部デバイス部14からの割り込みによる通知を抑制する。割り込みの抑制方法としては、当該デバイスからの割り込み通知を、CPUの割り込みコントローラへのマスク設定により、一時的に無効化する方法がある。
割込抑制部160は、メモリアクセスの抑制と解除を、割り込み処理のマスク、またはマスク解除によって行う。具体的には、割込抑制部160は、抑制が指示されている期間は、外部デバイス部14からの割り込みによる通知を抑制する。割り込みの抑制方法としては、当該デバイスからの割り込み通知を、CPUの割り込みコントローラへのマスク設定により、一時的に無効化する方法がある。
<ポーリング抑制部170>
ポーリング抑制部170は、メモリアクセスの抑制と解除を、受信側のpollingスレッドの停止または起動によって行う。具体的には、ポーリング抑制部170は、抑制が指示されている期間は、ポーリングによるメモリアクセスを抑制する。
ポーリングの抑制方法としては、2つの例がある。
例1:ユーザアプリケーションの持つポーリングスレッドへの演算時間の割り当てを、スケジューラ設定によりゼロとする方法。
例2:ポーリングスレッド内に、ポーリング抑制用の制御フラグを持ち、該当制御フラグに応じてポーリングを抑制する方法。
ポーリング抑制部170は、メモリアクセスの抑制と解除を、受信側のpollingスレッドの停止または起動によって行う。具体的には、ポーリング抑制部170は、抑制が指示されている期間は、ポーリングによるメモリアクセスを抑制する。
ポーリングの抑制方法としては、2つの例がある。
例1:ユーザアプリケーションの持つポーリングスレッドへの演算時間の割り当てを、スケジューラ設定によりゼロとする方法。
例2:ポーリングスレッド内に、ポーリング抑制用の制御フラグを持ち、該当制御フラグに応じてポーリングを抑制する方法。
<データ転送完了検知実行コア選定部180>
データ転送完了検知実行コア選定部180は、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。
データ転送完了検知実行コア選定部180は、デバイス名をもとに、デバイス・データ利用コア対応記録部200に問い合わせを行い、該当デバイスを利用するプロセスが動作するコアの情報を得て、データ転送完了の検知が実行されるように設定する。
データ転送完了検知実行コア選定部180は、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。
データ転送完了検知実行コア選定部180は、デバイス名をもとに、デバイス・データ利用コア対応記録部200に問い合わせを行い、該当デバイスを利用するプロセスが動作するコアの情報を得て、データ転送完了の検知が実行されるように設定する。
例1:先回りの方法が割り込みの場合
データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
例2:先回りの方法がポーリングの場合
データ転送完了検知部110のとる検知方法がポーリングの場合には、ポーリングを行うプロセスを、Linux tasksetコマンドなどにより当該コアに固定する。
データ転送完了検知部110のとる検知方法がポーリングの場合には、ポーリングを行うプロセスを、Linux tasksetコマンドなどにより当該コアに固定する。
<プリフェッチ対象キャッシュ選定部190>
プリフェッチ対象キャッシュ選定部190は、データ転送元デバイスのIDをもとに、そのデータを利用するプロセスが稼働している物理コアの情報を特定することで、プリフェッチする対象のメモリキャッシュを選定する。
ここで、デバイスのIDと、データを利用するプロセス、そのプロセスの物理コアの関係は、ユーザアプリケーション部31より取得する。
プリフェッチ対象キャッシュ選定部190は、データ転送元デバイスのIDをもとに、そのデータを利用するプロセスが稼働している物理コアの情報を特定することで、プリフェッチする対象のメモリキャッシュを選定する。
ここで、デバイスのIDと、データを利用するプロセス、そのプロセスの物理コアの関係は、ユーザアプリケーション部31より取得する。
<デバイス・データ利用コア対応記録部200>
デバイス・データ利用コア対応記録部200は、データ転送を行うデバイスと、該当デバイスが転送するデータにアクセスするプロセス名、さらにそのプロセスが動作する物理コア番号を保持する。
デバイス・データ利用コア対応記録部200は、データ転送を行うデバイスと、該当デバイスが転送するデータにアクセスするプロセス名、さらにそのプロセスが動作する物理コア番号を保持する。
図2乃至図4を参照して、デバイス・データ利用コア対応記録部200が記憶するデータ構造の例について述べる。
汎用サーバ上で、CPUの同時マルチスレッディング(SMT:Simultaneous Multi Threading)を活用して論理的にCPUコアを増加させ、データ処理を並列実行するシステムがある。CPUは、同時マルチスレッディング(SMT)機能を有し、1つの物理コアを複数の論理コアに分離して動作することが可能である。例えば、Intel Hyper Threading等のSMTは、CPUのマイクロ命令の演算器を論理コア間で共有させ、演算器の稼働率を上げる。
汎用サーバ上で、CPUの同時マルチスレッディング(SMT:Simultaneous Multi Threading)を活用して論理的にCPUコアを増加させ、データ処理を並列実行するシステムがある。CPUは、同時マルチスレッディング(SMT)機能を有し、1つの物理コアを複数の論理コアに分離して動作することが可能である。例えば、Intel Hyper Threading等のSMTは、CPUのマイクロ命令の演算器を論理コア間で共有させ、演算器の稼働率を上げる。
図2は、CPUの同時マルチスレッディングを用いて、論理的にCPUコアを増加させ、論理コアにデータ処理スレッドを割当ててデータ処理を並列実行するデバイスデータ高速アクセスシステムのハードウェア構成を示す図である。
図2に示すハードウェア10は、CPU11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、を備える。
図2に示すハードウェア10は、CPU11と、メモリキャッシュ12と、メモリ(メインメモリ)13と、を備える。
CPU11は、物理コア♯Aと物理コア♯B(物理コア15)を有する。物理コア♯Aは、論理コア♯1と論理コア♯2(論理コア16)に分離して動作可能であり、物理コア♯Bは、論理コア♯3と論理コア♯4(論理コア16)に分離して動作可能である。
論理コア♯1と論理コア♯2は、NICがアクセスするプロセス名router_process(図3)が動作するコアであり、論理コア♯3と論理コア♯4は、アクセラレータがアクセスするプロセス名acc_process_1(図3)が動作するコアである。
論理コア♯1と論理コア♯2は、NICがアクセスするプロセス名router_process(図3)が動作するコアであり、論理コア♯3と論理コア♯4は、アクセラレータがアクセスするプロセス名acc_process_1(図3)が動作するコアである。
メモリキャッシュ12は、物理コア♯Aに対応するL2キャッシュ[コア個別]12Aと、物理コア♯Bに対応するL2キャッシュ[コア個別]12Aと、メモリキャッシュ-L3[コア間共通]12Bと、を有する。
図3は、デバイス・データ利用コア対応記録部200が備える、デバイス名と、該当デバイスから転送するデータにアクセスするプロセス名の対応関係テーブル210を示す図である。
デバイス名「NIC」は、デバイスから転送するデータにアクセスするプロセス名「router_process」に対応付けられている。デバイス名「Accelerator」は、デバイスから転送するデータにアクセスするプロセス名「acc_process_1」に対応付けられている。
プロセス名の対応関係テーブル210は、アプリケーションやシステムごとに事前に決まるため、設計者が事前に設定する。
デバイス名「NIC」は、デバイスから転送するデータにアクセスするプロセス名「router_process」に対応付けられている。デバイス名「Accelerator」は、デバイスから転送するデータにアクセスするプロセス名「acc_process_1」に対応付けられている。
プロセス名の対応関係テーブル210は、アプリケーションやシステムごとに事前に決まるため、設計者が事前に設定する。
図4は、デバイス・データ利用コア対応記録部200が備える、プロセス名と、動作する論理コアIDの対応関係テーブル220を示す図である。
プロセス名「router_process」は、動作する論理コアIDの「1,2」(論理コア♯1と論理コア♯2)に対応し、プロセス名「acc _process」は、動作する論理コアIDの「3,4」(論理コア♯3と論理コア♯4)に対応する。
論理コアIDの対応関係テーブル220は、各プロセスの動作する可能性のあるコア(affinity設定)を、OS20(図1)から動的に取得し、テーブルに反映する。
プロセス名「router_process」は、動作する論理コアIDの「1,2」(論理コア♯1と論理コア♯2)に対応し、プロセス名「acc _process」は、動作する論理コアIDの「3,4」(論理コア♯3と論理コア♯4)に対応する。
論理コアIDの対応関係テーブル220は、各プロセスの動作する可能性のあるコア(affinity設定)を、OS20(図1)から動的に取得し、テーブルに反映する。
プリフェッチ対象キャッシュ選定部190(図1)は、デバイス・データ利用コア対応記録部200のプロセス名の対応関係テーブル210を参照して、デバイス名から該当デバイスから転送するデータにアクセスするプロセス名を得、そしてこのプロセス名から論理コアIDの対応関係テーブル220を参照して動作する論理コアIDを特定することで、プリフェッチする対象のメモリキャッシュ(L2キャッシュ[コア個別]12A、L3[コア間共通]12B)を選定する。
以下、上述のように構成されたデバイスデータアクセス装置100の動作を説明する。
(原理説明)
まず、本発明の基本的な考え方について説明する。
本発明は、外部デバイス部からメインメモリへのデータ転送の完了時点で、転送が完了したメインメモリのデータを、メモリキャッシュへプリフェッチする。
図5は、デバイスデータ高速アクセスシステム1000のデバイスデータアクセス装置100の基本動作を説明する図である。図5は、図18の技術背景および課題の説明図と対比して示される。
図5に示すユーザアプリケーション部31は、デバイスIOを要するアプリケーション、ここでは外部デバイス部14からデータ受信を行うアプリケーションである。
OS20上にデバイスデータアクセス装置100が配置される。デバイスデータアクセス装置100は、外部デバイス部14からメモリ(メインメモリ)13へのデータ転送の完了時点で、転送が完了したメモリ(メインメモリ)13のデータを、メモリキャッシュ12へプリフェッチする。
(原理説明)
まず、本発明の基本的な考え方について説明する。
本発明は、外部デバイス部からメインメモリへのデータ転送の完了時点で、転送が完了したメインメモリのデータを、メモリキャッシュへプリフェッチする。
図5は、デバイスデータ高速アクセスシステム1000のデバイスデータアクセス装置100の基本動作を説明する図である。図5は、図18の技術背景および課題の説明図と対比して示される。
図5に示すユーザアプリケーション部31は、デバイスIOを要するアプリケーション、ここでは外部デバイス部14からデータ受信を行うアプリケーションである。
OS20上にデバイスデータアクセス装置100が配置される。デバイスデータアクセス装置100は、外部デバイス部14からメモリ(メインメモリ)13へのデータ転送の完了時点で、転送が完了したメモリ(メインメモリ)13のデータを、メモリキャッシュ12へプリフェッチする。
デバイスデータアクセス装置100は、外部デバイス部14からのデータ転送完了を先回りして検知し、プリフェッチによるメモリキャッシュ12への事前ロードを行うことで、CPU11のメモリアクセスのオーバヘッドを削減する。
デバイスデータアクセス装置100は、転送完了を、外部デバイス部14からの割り込み、または、CPU11からのポーリング処理により検知する。
pollingによるアクセス、または、外部デバイス部14からの割り込みによるアクセスは、ユーザアプリケーション部31のアプリケーションの形態により決定される。
以下、<割り込みによる先回り・プリフェッチ>(図6乃至図8)と、<Pollingによる先回り・プリフェッチ>(図9乃至図11)とに分けて、それぞれ、デバイスデータアクセス装置100の先回りしたプリフェッチによる動作を説明する。
pollingによるアクセス、または、外部デバイス部14からの割り込みによるアクセスは、ユーザアプリケーション部31のアプリケーションの形態により決定される。
以下、<割り込みによる先回り・プリフェッチ>(図6乃至図8)と、<Pollingによる先回り・プリフェッチ>(図9乃至図11)とに分けて、それぞれ、デバイスデータアクセス装置100の先回りしたプリフェッチによる動作を説明する。
[割り込みによる先回り・プリフェッチ](図6乃至図8)
<割り込みによる先回り・プリフェッチ概要>(図6)
図6は、デバイスデータアクセス装置100の割り込みによる先回り・プリフェッチ動作を説明する図である。図5と同一構成部分には、同一符号を付している。
デバイスデータアクセス装置100は、ハードウェア10からの割り込み検知をトリガ(契機)に、メモリキャッシュ12へのプリフェッチを行う(図6の「Prefetch指示」参照)。これにより、デバイスデータアクセス装置100は、既存のアプリケーションやハードウェアを変更することなく、外部デバイス部が転送したデータへのアクセスを、短時間で処理することができる。
<割り込みによる先回り・プリフェッチ概要>(図6)
図6は、デバイスデータアクセス装置100の割り込みによる先回り・プリフェッチ動作を説明する図である。図5と同一構成部分には、同一符号を付している。
デバイスデータアクセス装置100は、ハードウェア10からの割り込み検知をトリガ(契機)に、メモリキャッシュ12へのプリフェッチを行う(図6の「Prefetch指示」参照)。これにより、デバイスデータアクセス装置100は、既存のアプリケーションやハードウェアを変更することなく、外部デバイス部が転送したデータへのアクセスを、短時間で処理することができる。
<割り込みによる先回り・プリフェッチ動作>(図7)
図7は、割込トリガによる、先回りしたプリフェッチ動作を、適用前のpolling方式と対比して説明する図である。図7上図は、本実施形態の適用前の比較例のアプリケーションの挙動を示し、図7下図は、本実施形態の適用後の、割込トリガによる、先回りしたプリフェッチ動作を示す。
図7上図に示すように、polling(図7上図の符号a1)とpolling(図7上図の符号a2)との間のポーリング間隔(図7上図の白抜き矢印b)が、1つ目のオーバヘッド(オーバヘッド♯1)である。また、DRAMで構成されるメモリ13のアクセス速度はSRAM等のメモリキャッシュ12に比べて遅く、かつこのDRAMアクセスは複数回繰り返されることが2つ目のオーバヘッド(オーバヘッド♯2)(図7上図の網掛矢印c)である。
適用前の比較例のアプリケーションの挙動(polling方式)の問題は、下記である。すなわち、polling後のメモリアクセスは、すべてキャッシュミスするため、DRAMアクセス時間が長い(オーバヘッド♯2)。
図7は、割込トリガによる、先回りしたプリフェッチ動作を、適用前のpolling方式と対比して説明する図である。図7上図は、本実施形態の適用前の比較例のアプリケーションの挙動を示し、図7下図は、本実施形態の適用後の、割込トリガによる、先回りしたプリフェッチ動作を示す。
図7上図に示すように、polling(図7上図の符号a1)とpolling(図7上図の符号a2)との間のポーリング間隔(図7上図の白抜き矢印b)が、1つ目のオーバヘッド(オーバヘッド♯1)である。また、DRAMで構成されるメモリ13のアクセス速度はSRAM等のメモリキャッシュ12に比べて遅く、かつこのDRAMアクセスは複数回繰り返されることが2つ目のオーバヘッド(オーバヘッド♯2)(図7上図の網掛矢印c)である。
適用前の比較例のアプリケーションの挙動(polling方式)の問題は、下記である。すなわち、polling後のメモリアクセスは、すべてキャッシュミスするため、DRAMアクセス時間が長い(オーバヘッド♯2)。
本実施形態の適用後の、割込トリガによる、先回りしたプリフェッチ動作について述べる。
図7下図のCPUコア#1(先回り)に示すように、本実施形態では、データ転送の完了時に、転送完了割込切替(図7下図の符号d)をトリガとして、メモリキャッシュへ12のプリフェッチ(ここでは、3回)(図7下図の符号e)を行う。また、メモリキャッシュへ12のプリフェッチは、ポーリング間隔(図7下図の符号a1とa2)内で行われる。上記ポーリング間隔は、オーバヘッド(オーバヘッド♯1)の要因であるが、このポーリング間隔を使って、このポーリング間隔内にメモリキャッシュへ12のプリフェッチ(図7下図の符号e)を行う。ポーリング間隔(図7下図の符号a1とa2)内にプリフェッチ(図7下図の符号e)が行われていることで、そのあとのpolling(図7下図の符号a2)でのメモリアクセス(図7下図の符号f)は、すべてキャッシュヒット(図7下図の符号g)する。
このため、pollingスレッドのメモリアクセス時間を短縮できる。その結果、DRAMアクセス時間が長いことで発生するオーバヘッド♯2を短縮することができる。本発明者らの試算では、1Packet 9000bytesへのアクセスで、最大17usとなり、約15usを短縮することができた。
図7下図のCPUコア#1(先回り)に示すように、本実施形態では、データ転送の完了時に、転送完了割込切替(図7下図の符号d)をトリガとして、メモリキャッシュへ12のプリフェッチ(ここでは、3回)(図7下図の符号e)を行う。また、メモリキャッシュへ12のプリフェッチは、ポーリング間隔(図7下図の符号a1とa2)内で行われる。上記ポーリング間隔は、オーバヘッド(オーバヘッド♯1)の要因であるが、このポーリング間隔を使って、このポーリング間隔内にメモリキャッシュへ12のプリフェッチ(図7下図の符号e)を行う。ポーリング間隔(図7下図の符号a1とa2)内にプリフェッチ(図7下図の符号e)が行われていることで、そのあとのpolling(図7下図の符号a2)でのメモリアクセス(図7下図の符号f)は、すべてキャッシュヒット(図7下図の符号g)する。
このため、pollingスレッドのメモリアクセス時間を短縮できる。その結果、DRAMアクセス時間が長いことで発生するオーバヘッド♯2を短縮することができる。本発明者らの試算では、1Packet 9000bytesへのアクセスで、最大17usとなり、約15usを短縮することができた。
<割り込みによる先回り・プリフェッチ動作フローチャート>(図8)
図8は、割り込みによる先回り・プリフェッチ処理を示すフローチャートである。
本フローは、割込により先回り検知を行う方式で、ユーザアプリケーション部31が、ポーリングでデータ到着検知を行っている場合の例である。
本フローの処理に先立って、事前に、データ転送完了検知実行コア選定部180が、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。また、データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
図8は、割り込みによる先回り・プリフェッチ処理を示すフローチャートである。
本フローは、割込により先回り検知を行う方式で、ユーザアプリケーション部31が、ポーリングでデータ到着検知を行っている場合の例である。
本フローの処理に先立って、事前に、データ転送完了検知実行コア選定部180が、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。また、データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
ステップS11で外部デバイス部14は、転送完了すると、デバイスデータアクセス装置100に割込通知を行う。
ステップS12でデータ転送完了検知部110は、ポーリング部140および割込ハンドリング部130を介して、外部デバイス部14からメモリ13へのデータ転送の完了を検知する。
ステップS13で割込ハンドリング部130は、外部デバイス部14からの、データ転送完了の通知割込により、データ転送の完了を検知する。
ステップS14でプリフェッチ指示部120は、CPU11に対し、メモリ13上のデータの、キャッシュへのロードを指示する。
ステップS15でデータアクセス抑制部150は、プリフェッチ指示部120によるプリフェッチ指示が完了するまで、ポーリング抑制部170および割込抑制部160を通じ、ユーザアプリケーション部31からのデータアクセスを抑制する。
ステップS16でポーリング抑制部170は、抑制が指示されている期間は、ポーリングによるメモリアクセスを抑制する。
ステップS17でプリフェッチ対象キャッシュ選定部190は、データ転送元デバイスのIDをもとに、そのデータを利用するプロセスが稼働している物理コアの情報を特定することで、プリフェッチする対象のメモリキャッシュを選定する。
ステップS18でデバイス・データ利用コア対応記録部200は、データ転送を行うデバイスと、該当デバイスが転送するデータにアクセスするプロセス名、さらにそのプロセスが動作する物理コア番号を保持する。
ステップS19でプリフェッチ指示部120は、プリフェッチ対象コアに対し、プリフェッチ命令を発行する。
ステップS20でユーザアプリケーション部31は、ポーリング契機でデータ受信を検知し、メモリアクセスを行って本フローの処理を終了する。
以上、割り込みによる先回り・プリフェッチについて説明した。次に、Pollingによる先回り・プリフェッチについて説明する。
以上、割り込みによる先回り・プリフェッチについて説明した。次に、Pollingによる先回り・プリフェッチについて説明する。
[Pollingによる先回り・プリフェッチ](図9乃至図11)
< Pollingによる先回り・プリフェッチ概要>(図9)
図9は、デバイスデータアクセス装置100のPollingによる先回り・プリフェッチ動作を説明する図である。図5と同一構成部分には、同一符号を付している。
デバイスデータアクセス装置100は、ハードウェア10からのデータ転送完了をpollingにより検知することをトリガ(契機)に、メモリキャッシュ12へのプリフェッチを行う(図9の「Prefetch指示」参照)。
< Pollingによる先回り・プリフェッチ概要>(図9)
図9は、デバイスデータアクセス装置100のPollingによる先回り・プリフェッチ動作を説明する図である。図5と同一構成部分には、同一符号を付している。
デバイスデータアクセス装置100は、ハードウェア10からのデータ転送完了をpollingにより検知することをトリガ(契機)に、メモリキャッシュ12へのプリフェッチを行う(図9の「Prefetch指示」参照)。
< Pollingによる先回り・プリフェッチ動作>(図9)
図10は、Pollingによる、先回りしたプリフェッチ動作を、適用前の割込方式と対比して説明する図である。図10上図は、本実施形態の適用前の比較例の割込方式のアプリケーションの挙動を示し、図10下図は、本実施形態の適用後の割込トリガによる、先回りしたプリフェッチ動作を示す。
図10上図の白抜き矢印に示すように、転送完了割込切替(図10上図の符号h)が、1つ目のオーバヘッド(オーバヘッド♯3)(図10上図の符号i)である。また、DRAMで構成されるメモリ13のDRAMアクセス(図10上図の符号j)はアクセス速度が遅く、かつ複数回繰り返されることが2つ目のオーバヘッド(オーバヘッド♯2)(図10上図の網掛矢印k)である。
図10は、Pollingによる、先回りしたプリフェッチ動作を、適用前の割込方式と対比して説明する図である。図10上図は、本実施形態の適用前の比較例の割込方式のアプリケーションの挙動を示し、図10下図は、本実施形態の適用後の割込トリガによる、先回りしたプリフェッチ動作を示す。
図10上図の白抜き矢印に示すように、転送完了割込切替(図10上図の符号h)が、1つ目のオーバヘッド(オーバヘッド♯3)(図10上図の符号i)である。また、DRAMで構成されるメモリ13のDRAMアクセス(図10上図の符号j)はアクセス速度が遅く、かつ複数回繰り返されることが2つ目のオーバヘッド(オーバヘッド♯2)(図10上図の網掛矢印k)である。
本実施形態の適用後の、割込トリガによる、先回りしたプリフェッチ動作について述べる。
図10下図に示すように、物理コアはCPUコア#1(先回り)とCPUコア#2(アプリケーション)に分離して動作する。
本実施形態では、CPUコア#1(先回り)において、メモリキャッシュへ12のプリフェッチ(ここでは、3回)(図10下図の符号l)に先立って、このプリフェッチに対応する数の、短い間隔のpolling(ここでは、3回)(図10下図の符号m)を実行しておく。すなわち、後記転送完了割込切替(図10下図の符号n)の前に、短い間隔でpolling(図10下図の符号m)を実行しておくことで、メモリキャッシュへ12のプリフェッチ(図10下図の符号l)が可能になる。
図10下図に示すように、物理コアはCPUコア#1(先回り)とCPUコア#2(アプリケーション)に分離して動作する。
本実施形態では、CPUコア#1(先回り)において、メモリキャッシュへ12のプリフェッチ(ここでは、3回)(図10下図の符号l)に先立って、このプリフェッチに対応する数の、短い間隔のpolling(ここでは、3回)(図10下図の符号m)を実行しておく。すなわち、後記転送完了割込切替(図10下図の符号n)の前に、短い間隔でpolling(図10下図の符号m)を実行しておくことで、メモリキャッシュへ12のプリフェッチ(図10下図の符号l)が可能になる。
ここで、アプリケーションが割込により外部デバイス部14と通信する場合、短い間隔のpollingの方がオーバヘッドが小さく、先回りができ、プリフェッチにより高速化できるケースがある。
CPUコア#2(アプリケーション)において、データ転送の完了時に、転送完了割込切替(図10下図の符号n)をトリガとして、メモリキャッシュへ12のプリフェッチ(図10下図の符号l)を行う。CPUコア#1(先回り)において、プリフェッチ(図10下図の符号l)が行われていることで、そのあとのpolling(図10下図の符号o)でのメモリアクセスはキャッシュヒット(図10下図の符号p)する。このため、pollingスレッドのメモリアクセス時間を短縮できる。その結果、DRAMアクセス時間が長いことで発生するオーバヘッド♯2(図10下図の符号q)を短縮(図10下図の破線矢印r)することができる。
CPUコア#2(アプリケーション)において、データ転送の完了時に、転送完了割込切替(図10下図の符号n)をトリガとして、メモリキャッシュへ12のプリフェッチ(図10下図の符号l)を行う。CPUコア#1(先回り)において、プリフェッチ(図10下図の符号l)が行われていることで、そのあとのpolling(図10下図の符号o)でのメモリアクセスはキャッシュヒット(図10下図の符号p)する。このため、pollingスレッドのメモリアクセス時間を短縮できる。その結果、DRAMアクセス時間が長いことで発生するオーバヘッド♯2(図10下図の符号q)を短縮(図10下図の破線矢印r)することができる。
< Pollingによる先回り・プリフェッチ動作フローチャート>(図11)
図11は、Pollingによる先回り・プリフェッチ処理を示すフローチャートである。
本フローは、ポーリングにより先回り検知を行う方式で、ユーザアプリケーション部31が、割込でデータ到着検知を行う場合の例である。
本フローの処理に先立って、事前に、データ転送完了検知実行コア選定部180が、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。また、データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
図11は、Pollingによる先回り・プリフェッチ処理を示すフローチャートである。
本フローは、ポーリングにより先回り検知を行う方式で、ユーザアプリケーション部31が、割込でデータ到着検知を行う場合の例である。
本フローの処理に先立って、事前に、データ転送完了検知実行コア選定部180が、外部デバイス部14の、データ転送完了検知を行うコアを選定し、該当コアでデータ転送完了検知が行われるように設定する。また、データ転送完了検知部110のとる検知方法が割り込みの場合には、CPUの割り込みマスクの設定により、該当コアで検知のための割り込みハンドラが起動するようにする。
ステップS21で外部デバイス部14は、データをメモリ13に転送するとともに、転送の完了時には、CPU11に対して割込みにより通知を行う。
ステップS22でデータ転送完了検知部110は、ポーリング部140および割込ハンドリング部130を介して、外部デバイス部14からメモリ13へのデータ転送の完了を検知する。
ステップS23でポーリング部140は、メモリ13への、一定周期でのアクセスの繰り返しにより、データ転送の完了を検知する。
ステップS24でプリフェッチ指示部120は、CPUに対し、メモリ13上のデータの、キャッシュへのロードを指示する。
ステップS25でデータアクセス抑制部150は、プリフェッチ指示部120によるプリフェッチ指示が完了するまで、ポーリング抑制部170および割込抑制部160を通じ、ユーザアプリケーション部31からのデータアクセスを抑制する。
ステップS26で割込抑制部160は、抑制が指示されている期間において、外部デバイス部からの割込みによる通知を抑制する。
ステップS27でプリフェッチ対象キャッシュ選定部190は、データ転送元デバイスのIDをもとに、そのデータを利用するプロセスが稼働している物理コアの情報を特定することで、プリフェッチする対象のメモリキャッシュを選定する。
ステップS28でデバイス・データ利用コア対応記録部200は、データ転送を行うデバイスと、該当デバイスが転送するデータにアクセスするプロセス名、さらにそのプロセスが動作する物理コア番号を保持する。
ステップS29でプリフェッチ指示部120は、プリフェッチ対象コアに対し、プリフェッチ命令を発行する。
ステップS30でユーザアプリケーション部31は、割込みを受け、メモリアクセスを行って本フローの処理を終了する。
以上、Pollingによる先回り・プリフェッチについて説明した。
以上、Pollingによる先回り・プリフェッチについて説明した。
(第2の実施形態)
図12は、本発明の第2の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図5と同一構成部分には、同一符号を付している。
図5に示すように、デバイスデータ高速アクセスシステム1000Aは、ハードウェア10と、OS20と、ユーザ空間30上にユーザアプリケーション部31と、を備え、OS20上には、デバイスデータアクセス装置100と、アクセス抑制部230と、スケジューラ240と、が配置される。
アクセス抑制部230は、デバイスデータアクセス装置100が、プリフェッチを完了するまで、アプリケーションからのメモリ領域へのアクセスを抑制する。
アクセス抑制部230は、デバイスデータアクセス装置100から、「スケジューラ220への通知/CPU設定によるアプリケーションからのpolling抑止」(抑制方法1)と、「割り込みマスク設定による割込の一時停止」(抑制方法2)とを受け付ける。
図12は、本発明の第2の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図5と同一構成部分には、同一符号を付している。
図5に示すように、デバイスデータ高速アクセスシステム1000Aは、ハードウェア10と、OS20と、ユーザ空間30上にユーザアプリケーション部31と、を備え、OS20上には、デバイスデータアクセス装置100と、アクセス抑制部230と、スケジューラ240と、が配置される。
アクセス抑制部230は、デバイスデータアクセス装置100が、プリフェッチを完了するまで、アプリケーションからのメモリ領域へのアクセスを抑制する。
アクセス抑制部230は、デバイスデータアクセス装置100から、「スケジューラ220への通知/CPU設定によるアプリケーションからのpolling抑止」(抑制方法1)と、「割り込みマスク設定による割込の一時停止」(抑制方法2)とを受け付ける。
デバイスデータアクセス装置100は、アクセス抑制部230を備えることで、プリフェッチ完了前に、アプリケーションからのデバイスアクセスが発生することを防ぐことができる。
プリフェッチ完了まで、ユーザアプリケーション部31を待たせることで、アプリケーション側リソース削減を図ることができる。
(第3の実施形態)
本発明の第3の実施形態では、デバイスの転送したデータを利用するコアの同定による、プリフェッチ対象キャッシュと、階層の選定を記載する。
図13は、本発明の第3の実施形態に係るデバイスデータ高速アクセスシステム1000Bの概略構成図である。図2、図5および図18と同一構成部分には、同一符号を付している。図13は、図5のデバイスデータアクセス装置100から該当する各部(プリフェッチ指示部120、データ転送完了検知実行コア選定部180、プリフェッチ対象キャッシュ選定部190、およびデバイス・データ利用コア対応記録部200)を抽出して示している。
本発明の第3の実施形態では、デバイスの転送したデータを利用するコアの同定による、プリフェッチ対象キャッシュと、階層の選定を記載する。
図13は、本発明の第3の実施形態に係るデバイスデータ高速アクセスシステム1000Bの概略構成図である。図2、図5および図18と同一構成部分には、同一符号を付している。図13は、図5のデバイスデータアクセス装置100から該当する各部(プリフェッチ指示部120、データ転送完了検知実行コア選定部180、プリフェッチ対象キャッシュ選定部190、およびデバイス・データ利用コア対応記録部200)を抽出して示している。
図14は、図13に示すデバイス・データ利用コア対応記録部200の構成例である。図13に示すデバイス・データ利用コア対応記録部200は、データ転送を行うデバイスと、該当デバイスが転送するデータにアクセスするプロセス名、さらにそのプロセスが動作する物理コア番号を保持に加えて、図14に示すデータ利用コアとデバイスとを記憶する。例えば、データ利用コアは、物理コア♯BでデバイスはNIC、物理コア♯Bでデバイスはアクセラレータである。
本実施形態では、プリフェッチ完了前に、アプリケーションからのデバイスアクセスが発生することを防ぐために、プリフェッチ指示部120が、プリフェッチを完了するまで、アプリケーションからのメモリ領域へのアクセスを抑制する。具体的には、プリフェッチ指示部120から、「スケジューラへの設定によるアプリケーションからのpolling抑止」、または「割り込みマスク設定による割込の一時停止」を行う。
ここで、メインメモリデータのプリフェッチに際しては、そのデータにアクセスするCPUコアに、可能な限り近いキャッシュへのプリフェッチが望ましい。図13左拡大図に示すように、CPUコアに近い、例えばL3(2-4mb程度)よりもL2(256kb程度)へのプリフェッチ、またL2(256kb程度)よりもL1(64kb程度) へのプリフェッチが望ましい。
そこで、本実施形態では、デバイスデータアクセス装置100は、デバイスとデータ利用コアの対応関係を記録する「デバイス・データ利用コア対応記録部200」の情報をもとに、プリフェッチする対象のキャッシュを選定して、データを利用するコアに近い箇所へのプリフェッチを実現する。
さらに、本実施形態では、第1および第2の実施形態で述べた先回りプリフェッチ動作を、該当プリフェッチ対象コアで起動させる。プリフェッチ命令の実行を、データを利用するコアに近いコアで実行可能とすることで、コア間の遷移によるオーバヘッドをより一層抑制する。
さらに、本実施形態では、第1および第2の実施形態で述べた先回りプリフェッチ動作を、該当プリフェッチ対象コアで起動させる。プリフェッチ命令の実行を、データを利用するコアに近いコアで実行可能とすることで、コア間の遷移によるオーバヘッドをより一層抑制する。
(第4の実施形態)
本発明の第4の実施形態は、アプリケーションの具体例を記載する。
図15は、本発明の第4の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図5と同一構成部分には、同一符号を付している。
図15に示すデバイスデータ高速アクセスシステム1000Cは、ユーザ空間30上に、Webサーバアプリケーション31Aと、デバイスデータアクセス装置100とが配置される。
Webサーバアプリケーション31Aは、ネットワークを介し、クライアントからのリクエスト受信と、応答を行う。Webサーバアプリケーションは、例えばApache (アパッチ)やNginx (エンジンエックス)である。
Webサーバアプリケーション31Aにおけるリクエストは、NICを介したパケットの形で受信する。NICからのパケット受信処理は、「割り込みを契機としたメモリアクセス」により行う。
本発明の第4の実施形態は、アプリケーションの具体例を記載する。
図15は、本発明の第4の実施形態に係るデバイスデータ高速アクセスシステムの概略構成図である。図5と同一構成部分には、同一符号を付している。
図15に示すデバイスデータ高速アクセスシステム1000Cは、ユーザ空間30上に、Webサーバアプリケーション31Aと、デバイスデータアクセス装置100とが配置される。
Webサーバアプリケーション31Aは、ネットワークを介し、クライアントからのリクエスト受信と、応答を行う。Webサーバアプリケーションは、例えばApache (アパッチ)やNginx (エンジンエックス)である。
Webサーバアプリケーション31Aにおけるリクエストは、NICを介したパケットの形で受信する。NICからのパケット受信処理は、「割り込みを契機としたメモリアクセス」により行う。
本実施形態では、第1乃至第3の実施形態で述べた先回りプリフェッチ動作(pollingによる先回りしてのメモリプリフェッチ)により、Webサーバアプリケーションからメモリへのアクセスに先回りすることで、Webサーバアプリケーションのメモリアクセス時にキャッシュがヒットし、アクセス時間を短縮することができる。
[ハードウェア構成]
上記実施形態に係るデバイスデータアクセス装置100(図1)は、例えば図16に示すような構成のコンピュータ900によって実現される。
図16は、デバイスデータアクセス装置100の機能を実現するコンピュータ900の一例を示すハードウェア構成図である。
デバイスデータアクセス装置100は、CPU901、RAM902、ROM903、HDD904、アクセラレータ905、入出力インターフェイス(I/F)906、メディアインターフェイス(I/F)907、および通信インターフェイス(I/F:Interface)908を有する。アクセラレータ905は、図1の外部デバイス部14のアクセラレータに対応する。
上記実施形態に係るデバイスデータアクセス装置100(図1)は、例えば図16に示すような構成のコンピュータ900によって実現される。
図16は、デバイスデータアクセス装置100の機能を実現するコンピュータ900の一例を示すハードウェア構成図である。
デバイスデータアクセス装置100は、CPU901、RAM902、ROM903、HDD904、アクセラレータ905、入出力インターフェイス(I/F)906、メディアインターフェイス(I/F)907、および通信インターフェイス(I/F:Interface)908を有する。アクセラレータ905は、図1の外部デバイス部14のアクセラレータに対応する。
アクセラレータ905は、通信I/F908からのデータ、または、RAM902からのデータの少なくとも一方のデータを高速に処理するアクセラレータ(外部デバイス部14)(図1)である。なお、アクセラレータ905として、CPU901またはRAM902からの処理を実行した後にCPU901またはRAM902に実行結果を戻すタイプ(Look-Aside型)を用いてもよい。一方、アクセラレータ905として、通信I/F908とCPU901またはRAM902との間に入って、処理を行うタイプ(In-line型)を用いてもよい。
アクセラレータ905は、通信I/F908を介して外部装置915と接続される。入出力I/F906は、入出力装置916と接続される。メディアI/F907は、記録媒体917からデータを読み書きする。
CPU901は、ROM903またはHDD904に格納されたプログラムに基づいて動作し、RAM902に読み込んだプログラム(アプリケーションや、その略のアプリとも呼ばれる)を実行することにより、図1に示すデバイスデータアクセス装置100の各部の制御を行う。そして、このプログラムは、通信回線を介して配布したり、CD-ROM等の記録媒体917に記録して配布したりすることも可能である。
ROM903は、コンピュータ900の起動時にCPU901によって実行されるブートプログラムや、コンピュータ900のハードウェアに依存するプログラム等を格納する。
ROM903は、コンピュータ900の起動時にCPU901によって実行されるブートプログラムや、コンピュータ900のハードウェアに依存するプログラム等を格納する。
CPU901は、入出力I/F906を介して、マウスやキーボード等の入力部、および、ディスプレイやプリンタ等の出力部からなる入出力装置916を制御する。CPU901は、入出力I/F906を介して、入出力装置916からデータを取得するともに、生成したデータを入出力装置916へ出力する。なお、プロセッサとしてCPU901とともに、GPU(Graphics Processing Unit)等を用いてもよい。
HDD904は、CPU901により実行されるプログラムおよび当該プログラムによって使用されるデータ等を記憶する。通信I/F908は、通信網(例えば、NW(Network))を介して外部装置915からデータを受信してCPU901へ出力し、また、CPU901が生成したデータを、通信網を介して外部装置915へ送信する。
メディアI/F907は、記録媒体917に格納されたプログラムまたはデータを読み取り、RAM902を介してCPU901へ出力する。CPU901は、目的の処理に係るプログラムを、メディアI/F907を介して記録媒体917からRAM902上にロードし、ロードしたプログラムを実行する。記録媒体917は、DVD(Digital Versatile Disc)、PD(Phase change rewritable Disk)等の光学記録媒体、MO(Magneto Optical disk)等の光磁気記録媒体、磁気記録媒体、導体メモリテープ媒体又は半導体メモリ等である。
例えば、コンピュータ900が本実施形態に係る一装置として構成されるデバイスデータアクセス装置100(図1)として機能する場合、コンピュータ900のCPU901は、RAM902上にロードされたプログラムを実行することによりデバイスデータアクセス装置100の機能を実現する。また、HDD904には、RAM902内のデータが記憶される。CPU901は、目的の処理に係るプログラムを記録媒体917から読み取って実行する。この他、CPU901は、外部装置915から通信網を介して目的の処理に係るプログラムを読み込んでもよい。
[効果]
以上説明したように、アプリケーション部(ユーザアプリケーション部31)から外部デバイス部14へのデータアクセスを高速化するデバイスデータアクセス装置100(図1)であって、プロセッサ(CPU11)と外部デバイス部14が、メインメモリ(メモリ13)を介してデータをやりとりする際、外部デバイス部14からメインメモリ(メモリ13)へのデータ転送の完了を検知するデータ転送完了検知部110と、データ転送完了検知部110が検知したデータ転送完了時点で、転送が完了したメインメモリのデータを、プロセッサ(CPU11)とメインメモリ(メモリ13)の間にあるメモリキャッシュ12へプリフェッチするプリフェッチ指示部120と、備える。
以上説明したように、アプリケーション部(ユーザアプリケーション部31)から外部デバイス部14へのデータアクセスを高速化するデバイスデータアクセス装置100(図1)であって、プロセッサ(CPU11)と外部デバイス部14が、メインメモリ(メモリ13)を介してデータをやりとりする際、外部デバイス部14からメインメモリ(メモリ13)へのデータ転送の完了を検知するデータ転送完了検知部110と、データ転送完了検知部110が検知したデータ転送完了時点で、転送が完了したメインメモリのデータを、プロセッサ(CPU11)とメインメモリ(メモリ13)の間にあるメモリキャッシュ12へプリフェッチするプリフェッチ指示部120と、備える。
このようにすることにより、デバイスデータアクセス装置100は、外部デバイス部14からのデータ転送完了を先回りして検知し、プリフェッチによるメモリキャッシュ12への事前ロードを行うことで、CPU11のメモリアクセスのオーバヘッドを削減することができる。このため、既存のアプリケーションやハードウェアを変更することなく、外部デバイス部14が転送したデータへのアクセスを、短時間で処理することができる。
よって、デバイスデータアクセス装置100は、要件1:(アクセス時間)アプリケーションからメインメモリへのアクセスが高速化されること(キャッシュミスによる、メインメモリへの直接アクセスが少ないこと)を満たすことができる。また、デバイスデータアクセス装置100は、要件2:(アプリ透過性)既存のアプリケーションの変更が不要であることを満たすことができる。さらに、デバイスデータアクセス装置100は、要件3:(ハードウェア汎用性)ハードウェアに、キャッシュへの直接ロードなどの特別な機能が不要であることを満たすことができる。
デバイスデータアクセス装置100(図1)において、データ転送完了検知部110は、データ転送完了を、外部デバイス部14からの割込み、または、プロセッサからのポーリング処理により検知する。
このようにすることにより、デバイスデータアクセス装置100は、データ転送完了検知部110が、データ転送完了の検知時にプリフェッチを開始することで、ユーザアプリケーションと独立し、先回りしてプリフェッチを行う。これにより、デバイスデータアクセス装置100は、「要件1:アクセス時間」および「要件2:アプリ透過性」を満たすことができる。また、データ転送完了の検知は、ポーリングや割込などのハードウェアの汎用機能で実現できるため、「要件3:ハードウェア汎用性」を満たすことができる。
デバイスデータアクセス装置100(図1)において、メモリキャッシュ12へのプリフェッチが完了するまで、メモリアクセスを抑制するデータアクセス抑制部150を備える。
このようにすることにより、データアクセス抑制部150は、プリフェッチ指示部120からプリフェッチ指示が完了するまで、ポーリング抑制部170および、割込抑制部160を通じ、ユーザアプリケーション部31からの、データアクセスを抑制することができる。
デバイスデータアクセス装置100(図1)において、メモリアクセスの抑制と解除を、受信側のpollingスレッドの停止または起動によって行うポーリング抑制部170を備える。
このようにすることにより、ポーリング抑制部170は、抑制が指示されている期間は、ポーリングによるメモリアクセスを抑制することができる。
デバイスデータアクセス装置100(図1)において、メモリアクセスの抑制と解除を、割り込み処理のマスク、またはマスク解除によって行う割込抑制部160を備える。
このようにすることにより、抑制が指示されている期間は、外部デバイス部14からの割り込みによる通知を抑制することができる。
デバイスデータアクセス装置100(図1)において、プロセッサの物理コアが、プリフェッチ専用コアと、データアクセスを行うCPUコアとに分離する。
このようにすることにより、割込トリガによる、先回りしたプリフェッチ動作について、図7下図のCPUコア#1(先回り)に示すポーリング間隔を使って、このポーリング間隔内にメモリキャッシュへ12のプリフェッチ(図7下図の符号e)を行い、ポーリング間隔(図7下図の符号a1とa2)内にプリフェッチ(図7下図の符号e)を行う。これにより、そのあとのpolling(図7下図の符号a2)でのメモリアクセス(図7下図の符号f)は、すべてキャッシュヒット(図7下図の符号g)する効果を得ることができる。
また、CPUコア#2(アプリケーション)において、データ転送の完了時に、転送完了割込切替(図10下図の符号n)をトリガとして、メモリキャッシュへ12のプリフェッチ(図10下図の符号l)を行う。CPUコア#1(先回り)において、プリフェッチ(図10下図の符号l)が行われていることで、そのあとのpolling(図10下図の符号o)でのメモリアクセスはキャッシュヒット(図10下図の符号p)する効果を得ることができる。
また、上記実施形態および変形例において説明した各処理のうち、自動的に行われるものとして説明した処理の全部または一部を手動的に行うこともでき、あるいは、手動的に行われるものとして説明した処理の全部又は一部を公知の方法で自動的に行うこともできる。この他、上述文書中や図面中に示した処理手順、制御手順、具体的名称、各種のデータやパラメータを含む情報については、特記する場合を除いて任意に変更することができる。
また、図示した各装置の各構成要素は機能概念的なものであり、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部又は一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。
また、図示した各装置の各構成要素は機能概念的なものであり、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部又は一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的又は物理的に分散・統合して構成することができる。
また、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行するためのソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、IC(Integrated Circuit)カード、SD(Secure Digital)カード、光ディスク等の記録媒体に保持することができる。
10 ハードウェア
11 CPU
20 OS
30 ユーザ空間
31 ユーザアプリケーション部(アプリケーション部)
31A Webサーバアプリケーション
12 メモリキャッシュ
13 メモリ(メインメモリ)
14 外部デバイス部
100 デバイスデータアクセス装置
110 データ転送完了検知部
120 プリフェッチ指示部
130 割込ハンドリング部
140 ポーリング部
150 データアクセス抑制部
160 割込抑制部
170 ポーリング抑制部
180 データ転送完了検知実行コア選定部
190 プリフェッチ対象キャッシュ選定部
200 デバイス・データ利用コア対応記録部
230 アクセス抑制部
240 スケジューラ
1000,1000A,1000B,1000C デバイスデータ高速アクセスシステム
11 CPU
20 OS
30 ユーザ空間
31 ユーザアプリケーション部(アプリケーション部)
31A Webサーバアプリケーション
12 メモリキャッシュ
13 メモリ(メインメモリ)
14 外部デバイス部
100 デバイスデータアクセス装置
110 データ転送完了検知部
120 プリフェッチ指示部
130 割込ハンドリング部
140 ポーリング部
150 データアクセス抑制部
160 割込抑制部
170 ポーリング抑制部
180 データ転送完了検知実行コア選定部
190 プリフェッチ対象キャッシュ選定部
200 デバイス・データ利用コア対応記録部
230 アクセス抑制部
240 スケジューラ
1000,1000A,1000B,1000C デバイスデータ高速アクセスシステム
Claims (8)
- アプリケーション部から外部デバイス部へのデータアクセスを高速化するデバイスデータアクセス装置であって、
プロセッサと前記外部デバイス部が、メインメモリを介してデータをやりとりする際、
前記外部デバイス部から前記メインメモリへのデータ転送の完了を検知するデータ転送完了検知部と、
前記データ転送完了検知部が検知したデータ転送完了時点で、転送が完了した前記メインメモリのデータを、前記プロセッサと前記メインメモリの間にあるメモリキャッシュへプリフェッチするプリフェッチ指示部と、備える
ことを特徴とするデバイスデータアクセス装置。 - 前記データ転送完了検知部は、データ転送完了を、前記外部デバイス部からの割込み、または、前記プロセッサからのポーリング処理により検知する
ことを特徴とする請求項1に記載のデバイスデータアクセス装置。 - 前記メモリキャッシュへのプリフェッチが完了するまで、メモリアクセスを抑制するデータアクセス抑制部を備える
ことを特徴とする請求項1に記載のデバイスデータアクセス装置。 - 前記メモリアクセスの抑制と解除を、受信側のpollingスレッドの停止または起動によって行うポーリング抑制部を備える
ことを特徴とする請求項3に記載のデバイスデータアクセス装置。 - 前記メモリアクセスの抑制と解除を、割り込み処理のマスク、またはマスク解除によって行う割込抑制部を備える
ことを特徴とする請求項3に記載のデバイスデータアクセス装置。 - 前記プロセッサの物理コアが、プリフェッチ専用コアと、データアクセスを行うCPUコアとに分離する
ことを特徴とする請求項3に記載のデバイスデータアクセス装置。 - アプリケーション部から外部デバイス部へのデータアクセスを高速化するデバイスデータアクセス装置のデバイスデータアクセス方法であって、
前記デバイスデータアクセス装置は、
プロセッサと前記外部デバイス部が、メインメモリを介してデータをやりとりする際、
前記外部デバイス部から前記メインメモリへのデータ転送の完了を検知するデータ転送完了検知ステップと、
前記データ転送完了検知ステップが検知したデータ転送完了時点で、転送が完了した前記メインメモリのデータを、前記プロセッサと前記メインメモリの間にあるメモリキャッシュへプリフェッチするステップと、を実行する
ことを特徴とするデバイスデータアクセス方法。 - コンピュータを、請求項1乃至6いずれか一項に記載のデバイスデータアクセス装置として機能させるためのプログラム。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2024/014580 WO2025215775A1 (ja) | 2024-04-10 | 2024-04-10 | デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラム |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/JP2024/014580 WO2025215775A1 (ja) | 2024-04-10 | 2024-04-10 | デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラム |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025215775A1 true WO2025215775A1 (ja) | 2025-10-16 |
Family
ID=97349616
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2024/014580 Pending WO2025215775A1 (ja) | 2024-04-10 | 2024-04-10 | デバイスデータアクセス装置、デバイスデータアクセス方法およびプログラム |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2025215775A1 (ja) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011039666A (ja) * | 2009-08-07 | 2011-02-24 | Hitachi Ltd | バリア同期方法及び計算機 |
| US20150324293A1 (en) * | 2014-05-06 | 2015-11-12 | Google Inc. | Controlled cache injection of incoming data |
| JP2015222538A (ja) * | 2014-05-23 | 2015-12-10 | 富士通株式会社 | 演算処理装置及び演算処理装置の制御方法 |
-
2024
- 2024-04-10 WO PCT/JP2024/014580 patent/WO2025215775A1/ja active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2011039666A (ja) * | 2009-08-07 | 2011-02-24 | Hitachi Ltd | バリア同期方法及び計算機 |
| US20150324293A1 (en) * | 2014-05-06 | 2015-11-12 | Google Inc. | Controlled cache injection of incoming data |
| JP2015222538A (ja) * | 2014-05-23 | 2015-12-10 | 富士通株式会社 | 演算処理装置及び演算処理装置の制御方法 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5951582B2 (ja) | 外部キャッシュデバイスでのハイパーバイザのi/oステージング | |
| JP4322259B2 (ja) | マルチプロセッサシステムにおけるローカルメモリへのデータアクセスを同期化する方法および装置 | |
| US20080235477A1 (en) | Coherent data mover | |
| JP3309425B2 (ja) | キャッシュ制御装置 | |
| US8230179B2 (en) | Administering non-cacheable memory load instructions | |
| US7849327B2 (en) | Technique to virtualize processor input/output resources | |
| CN104461735B (zh) | 一种虚拟化场景下分配cpu资源的方法和装置 | |
| US8140825B2 (en) | Systems and methods for selectively closing pages in a memory | |
| JP2020523674A (ja) | システム内のキャッシュ転送のオーバーヘッドの削減 | |
| JP2024511751A (ja) | プロセッシングインメモリ同時処理システム及び方法 | |
| JP2006518053A (ja) | ハードウェア・スカウト・スレッディングを通してコードを推測で実行することによるプリフェッチの生成 | |
| US10713173B2 (en) | Memory controller with pre-loader | |
| TWI828307B (zh) | 用於記憶體管理機會與記憶體交換任務之運算系統及管理其之方法 | |
| CN102968395B (zh) | 用于微处理器的内存拷贝加速方法及装置 | |
| WO2024237963A1 (en) | Address range based memory hints for prefetcher, cache and memory controller | |
| KR102695529B1 (ko) | 프로세싱 장치 및 이의 동작 방법과 이를 포함하는 전자 장치 | |
| KR20190130570A (ko) | 슈퍼-스레드 프로세서 | |
| CN114721975B (zh) | 链表处理方法、装置、加速器、电路板、设备和存储介质 | |
| Zhong et al. | Dpc: Dpu-accelerated high-performance file system client | |
| WO2013075627A1 (zh) | 一种数据的缓存方法、装置和服务器 | |
| CN103207763B (zh) | 基于xen虚拟磁盘设备的前端缓存方法 | |
| US11579920B2 (en) | Virtual processor interrupt tracking | |
| JP5254710B2 (ja) | データ転送装置、データ転送方法およびプロセッサ | |
| WO2024064776A1 (en) | Address translation service management | |
| JPH01159746A (ja) | ディスクキャッシュ制御方式 |
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: 24935154 Country of ref document: EP Kind code of ref document: A1 |