Task processing device and method, electronic equipment and computer readable storage medium
By introducing task processing devices into the computer operating system, using task information units, mapping relationship units and processing units, the problem of low efficiency in conversion of virtual address to physical address is solved, efficient address conversion and resource optimization are achieved, and the computer system is improved performance.
Patent Information
- Application Number
- CN202411581646.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-18
AI Technical Summary
When processing tasks, computer operating systems need to convert virtual addresses to physical addresses. However, due to the limited cache space of TLB, uncached mapping relationships require time-consuming memory access, which increases hardware resource consumption and chip design complexity. This may lead to waste of resources and increase in chip size.
A task processing device is provided, including a task information unit, a mapping relationship unit and a processing unit. The task information unit stores the target tasks to be processed, and the mapping relationship unit stores the object mapping relationship and the prefetch mapping relationship from the virtual address to the physical address. The processing unit sets or querys the object mapping relationship in the mapping relationship unit according to the virtual address in the target task. To get the physical address and pre-set the prefetch mapping relationship.
Through this device, it is possible to achieve efficient conversion of virtual addresses and physical addresses with lower hardware resource overhead, reduce request blockage, shorten the execution cycle of address conversion, optimize resource utilization, and thus improve the overall performance of the computer system.
Smart Images

Figure CN119473938A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to a task processing apparatus and method, an electronic device, and a computer-readable storage medium. Background Art
[0002] When a computer operating system processes a task, it needs to convert the virtual address used by the application into a physical address. For example, the cache space of the Translation Lookaside Buffer (TLB) is limited and cannot store all the mapping relationships between virtual addresses and physical addresses. When encountering an uncached mapping relationship, the system still needs to perform time-consuming memory access operations. In addition, the introduction of cache increases the consumption of hardware resources and the complexity of chip design. Over-reliance on cache may also lead to resource waste and increased chip size. Summary of the invention
[0003] At least one embodiment of the present disclosure provides a task processing device, including a task information unit, a mapping relationship unit and a processing unit. The task information unit is configured to store a target task to be processed; the mapping relationship unit is configured to store an object mapping relationship and a pre-fetch mapping relationship from a virtual address to a physical address corresponding to the target task; the processing unit is configured to set or query the object mapping relationship in the mapping relationship unit according to the target virtual address included in the target task to obtain a target physical address corresponding to the target task, and pre-set the pre-fetch mapping relationship according to the target task.
[0004] For example, in a task processing device provided in an embodiment of the present disclosure, the task processing device further includes: a waiting request unit. The waiting request unit is configured to temporarily store the target task so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
[0005] For example, in a task processing device provided in one embodiment of the present disclosure, the processing unit is also configured to temporarily store the target task in the request unit to be sent in response to the target virtual address included in the target task existing in the virtual page included in the object mapping relationship and the target physical address corresponding to the target task not being obtained.
[0006] For example, in a task processing device provided in an embodiment of the present disclosure, the processing unit is also configured to start an initial mapping relationship in response to the mapping relationship unit not setting a mapping relationship corresponding to the target task, obtain the target physical address, and set the object mapping relationship based on the initial mapping relationship according to the target virtual address and the target physical address.
[0007] For example, in a task processing device provided by an embodiment of the present disclosure, the processing unit is further configured to send a first request to a memory management unit to obtain the target physical address.
[0008] For example, in a task processing device provided in an embodiment of the present disclosure, the processing unit is also configured to set a first tag for the first request, associate the first tag with the initial mapping relationship, and after obtaining the target physical address, use the first tag to provide the target physical address to the initial mapping relationship to set the target mapping relationship.
[0009] For example, in the task processing device provided in one embodiment of the present disclosure, the processing unit is also configured to obtain a prefetch virtual address and a prefetch physical address corresponding to the prefetch virtual address based on the target virtual address in the process of starting the object mapping relationship, and start the prefetch mapping relationship based on the prefetch virtual address and the prefetch physical address.
[0010] For example, in a task processing device provided in an embodiment of the present disclosure, the processing unit is also configured to, in response to the object mapping relationship being no longer able to be obtained when querying the mapping relationship unit, convert the prefetch mapping relationship into a new object mapping relationship, and pre-set a new prefetch mapping relationship according to the target task.
[0011] For example, in a task processing device provided by an embodiment of the present disclosure, the target task includes a plurality of subtasks that are executed separately; and the processing unit is further configured to start the object mapping relationship according to a first subtask among the plurality of subtasks.
[0012] For example, in the task processing device provided by an embodiment of the present disclosure, the processing unit is also configured to query the object mapping relationship in the mapping relationship unit based on the target virtual addresses included in other subtasks among the multiple subtasks except the first subtask, so as to obtain the target physical addresses corresponding to the other subtasks.
[0013] For example, in a task processing device provided in an embodiment of the present disclosure, the processing unit is further configured to invalidate the object mapping relationship after the target task processing is completed.
[0014] For example, in a task processing device provided in an embodiment of the present disclosure, the target task has virtual address task information, and the virtual address task information includes starting virtual address information, request data length information or task type information.
[0015] For example, in a task processing device provided by an embodiment of the present disclosure, the object mapping relationship and the prefetch mapping relationship include a mapping relationship between a virtual page and a physical page.
[0016] For example, in a task processing device provided by an embodiment of the present disclosure, the page number of the virtual page included in the object mapping relationship and the page number of the virtual page included in the prefetch mapping relationship are adjacent.
[0017] At least one embodiment of the present disclosure provides a task processing method, comprising: storing a target task to be processed; storing an object mapping relationship and a prefetch mapping relationship from a virtual address to a physical address corresponding to the target task; setting or querying the object mapping relationship in the mapping relationship unit according to a target virtual address included in the target task to obtain a target physical address corresponding to the target task; and pre-setting the prefetch mapping relationship according to the target task.
[0018] For example, in a task processing method provided in one embodiment of the present disclosure, the task processing method further includes: temporarily storing the target task so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
[0019] At least one embodiment of the present disclosure provides a task processing device, including a processor and a memory, wherein the memory stores at least one computer program, and when the at least one computer program is executed by the processor, the task processing method provided by any embodiment of the present disclosure is implemented.
[0020] At least one embodiment of the present disclosure provides an electronic device, including the task processing device provided by any embodiment of the present disclosure.
[0021] At least one embodiment of the present disclosure provides a non-transitory computer-readable storage medium for non-temporarily storing computer-readable instructions. When the computer-readable instructions are executed by a computer, the task processing method provided by any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.
[0023] Figure 1 A schematic diagram of an address translation process is shown;
[0024] Figure 2 A schematic block diagram of a task processing device provided by at least one embodiment of the present disclosure is shown;
[0025] Figure 3 A schematic block diagram of another task processing device provided by at least one embodiment of the present disclosure is shown;
[0026] Figure 4 A schematic block diagram of an application of a task processing device provided by at least one embodiment of the present disclosure is shown;
[0027] Figure 5 It shows that at least one embodiment of the present disclosure provides Figure 4 The application schematic diagram of the task processing device shown;
[0028] Figure 6 A flowchart of a task processing method provided by at least one embodiment of the present disclosure is shown;
[0029] Figure 7 A flowchart showing another task processing method provided by at least one embodiment of the present disclosure is shown;
[0030] Figure 8 A schematic block diagram of another task processing device provided by at least one embodiment of the present disclosure is shown;
[0031] Fig. 9 A schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure is shown; and
[0032] Fig.10 A schematic diagram of a computer-readable storage medium provided by at least one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0034] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0035] In the field of computer technology, one of the important functions of computer operating systems is memory management. In a multi-process operating system, each process has its own virtual address space and can use any virtual address (Virtual Address) within the range specified by the system. The address used by the central processing unit (CPU) when executing an application is a virtual address. When the operating system allocates memory to a process, it needs to map the used virtual address to the physical address (Physical Address), which is the real physical memory access address. By distinguishing addresses into virtual addresses and physical addresses, program compilation can be simplified, allowing the compiler to compile programs based on continuous and sufficient virtual address space, and the virtual addresses of different processes are assigned to different physical addresses, so that the system can run multiple processes at the same time and avoid conflicts between processes, thereby improving the operating efficiency of the entire computer system and the efficiency of memory use.
[0036] When a computer operating system processes a task, it needs to convert the virtual address used by the application into a physical address, so that memory access can be performed based on the physical address to obtain data. The process of converting a virtual address into a physical address is called address translation.
[0037] The memory management unit (MMU) and the page table work together to convert virtual addresses into physical addresses. The MMU is a hardware unit in the processor core. For example, each processor core may include an MMU. For example, the MMU includes two parts: the translation lookaside buffer (TLB) and the table walk unit (or page table walker). Each process has its own page table, which stores the mapping relationship between the virtual address and the physical address in the process. After receiving the virtual address from the CPU, the MMU starts to query the page table to determine whether the mapping exists and whether the read and write permissions are normal. For example, the TLB can also be referred to as a "fast table" to store the page table conversion relationship. The cache stores the page table entries that are most likely to be accessed at present, so its content is a copy of some page table entries. Only when the TLB cannot complete the address translation task, the page table lookup unit will query the page table in the memory, which reduces the processor performance degradation caused by the page table query and improves the efficiency of the page table conversion. For example, the TLB may include a translation lookaside buffer for instructions (ITLB) and a translation lookaside buffer for data (DTLB).
[0038] For example, the page table can be single-level or multi-level. If the memory capacity is large, for example, according to the page size of 4KB, the number of page table entries (PTE) will be very large. In order to solve this problem, for example, in current 32 / 64-bit processors, multi-level page tables can be used. For multi-level page tables, if the number of page table levels is smaller, the mapping of virtual addresses to physical addresses is faster, but more page table entries need to be managed, and the address space that can be supported is more limited accordingly. On the contrary, if the number of page table levels is larger, less page table data needs to be stored, and a larger address space can be supported, but the mapping of virtual addresses to physical addresses will be slower.
[0039] In a multi-level page table system, each level of the page table can be regarded as a conversion from a "virtual address" to a "physical address", except that the "virtual address" here is a bit field subset of the virtual address to be converted. Except for the last level page table PTE which directly points to the physical page, the "physical address" in other levels of page tables all points to the starting address of the corresponding next level page table.
[0040] Figure 1 A schematic diagram of an address translation process is shown.
[0041] Figure 1 Figure 2 shows the address translation process of the four-level page table. Figure 1As shown, a virtual address is divided into several segments, for example, respectively represented as EXT, OFFSET_lvl4, OFFSET_lvl3, OFFSET_lvl2, OFFSET_lvl1, and OFFSET_pg. In this example, the high-order virtual address segment EXT is not used. The virtual address segments OFFSET_lvl4, OFFSET_lvl3, OFFSET_lvl2, and OFFSET_lvl1 respectively represent the offset values of the four-level page table, that is, the virtual address segment OFFSET_lvl4 represents the offset value of the fourth-level page table, the virtual address segment OFFSET_lvl3 represents the offset value of the third-level page table, the virtual address segment OFFSET_lvl2 represents the offset value of the second-level page table, and the virtual address segment OFFSET_lvl1 represents the offset value of the first-level page table.
[0042] The initial address of the highest level page table (also known as the fourth level page table) is stored in the architecture register REG_pt, and its content is set by the operating system and cannot be changed by the application. In the second level page table, the third level page table, and the fourth level page table, the page table entry of each level page table stores the starting address of the next level page table. The first level page table entry (Page Table Entry, PTE) stores the high bits of the physical address of the corresponding memory page, which is combined with the virtual address offset (OFFSET_pg) to obtain the physical address corresponding to the virtual address. Therefore, by obtaining the starting address of the next level page table step by step in this way, the first level page table entry (PTE) can be obtained, and the corresponding physical address can be further obtained, realizing the translation from virtual address to physical address.
[0043] It should be noted that although Figure 1 A 4-level page table is shown, but it is not limited thereto, and any number of multi-level page tables may be used, such as a 2-level page table, a 3-level page table, a 5-level page table, etc. For example, a system may support pages of different sizes, and the size of each page is represented by the number of bits of the virtual address offset OFFSET_pg. In the same system, the larger the page, the fewer address translation levels are required.
[0044] The inventors of the present disclosure have noticed that although MMU can simplify memory management, the conversion process from virtual address to physical address still faces many problems. For example, since the page table is stored in the memory, the system may need to access the memory multiple times to obtain the necessary mapping information each time an address conversion is performed. For example, in large systems such as supercomputers, due to the complexity of the architecture and the physical distance between the execution unit and the memory, this memory access delay problem is particularly prominent, which seriously affects the overall performance of the system.
[0045] The inventors of the present disclosure also noted that, although, for example, a cache can be used to store recently used mapping relationships, when the same page or adjacent pages are accessed continuously, the mapping results can be directly obtained from the cache, thereby reducing repeated memory accesses, but this approach has obvious limitations. For example, due to limited cache space, it is impossible to store all mapping relationships. When encountering a mapping that is not cached, the system still needs to perform time-consuming memory access operations. In addition, the cache also increases the consumption of hardware resources and the complexity of chip design, further leading to problems of resource waste and increased chip size. In addition, when the system cannot obtain the required physical address in a timely manner, the related processing request may be blocked, and it is necessary to wait for the conversion to be completed before continuing to execute, which increases the delay of the execution cycle.
[0046] Therefore, the inventors of the present disclosure believe that there is an urgent need for an efficient and stable task processing method to solve the above-mentioned technical problems of low conversion efficiency and large memory access delay.
[0047] At least one embodiment of the present disclosure provides a task processing device. The task processing device includes a task information unit, a mapping relationship unit, and a processing unit. The task information unit is configured to store a target task to be processed; the mapping relationship unit is configured to store an object mapping relationship and a pre-fetch mapping relationship from a virtual address to a physical address corresponding to the target task; the processing unit is configured to set or query an object mapping relationship in the mapping relationship unit according to a target virtual address included in the target task, so as to obtain a target physical address corresponding to the target task, and pre-set a pre-fetch mapping relationship according to the target task. The task processing device can achieve efficient conversion of virtual addresses and physical addresses with low hardware resource overhead, reduce request blocking, shorten the execution cycle of address conversion, and optimize resource utilization, thereby improving the overall performance of the computer system.
[0048] Accordingly, at least one embodiment of the present disclosure further provides a task processing method, an electronic device, and a computer-readable storage medium corresponding to the above-mentioned task processing device.
[0049] Figure 2 A schematic block diagram of a task processing device provided by at least one embodiment of the present disclosure is shown.
[0050] like Figure 2 As shown, the task processing device 100 includes a task information unit 110 , a mapping relationship unit 120 and a processing unit 130 .
[0051] The task information unit 110 is configured to store target tasks to be processed. For example, the task information unit 110 may store multiple tasks to be processed.
[0052] In the embodiments of the present disclosure, a “target task” is any task to be processed that is a description object in the present disclosure, but the embodiments of the present disclosure are not limited to processing a single target task.
[0053] The mapping unit 120 is configured to store the object mapping relationship and pre-fetch mapping relationship from the virtual address to the physical address corresponding to the target task. For example, the mapping unit 120 can be configured to store the corresponding object mapping relationship and pre-fetch mapping relationship for each of the multiple tasks to be processed stored in the task information unit 110, so the mapping unit 120 can store multiple sets of object mapping relationships and pre-fetch mapping relationships.
[0054] The processing unit 130 is configured to set or query the object mapping relationship in the mapping relationship unit 120 according to the target virtual address included in the target task to obtain the target physical address corresponding to the target task, and pre-set the pre-fetch mapping relationship according to the target task.
[0055] For example, the task information unit 110 may serve as an input and storage area for tasks, and the task information unit 110 may be configured to receive and store target tasks to be processed.
[0056] For example, the target task may come from a scheduler of an operating system, a request of an application program, or other system components, etc., and the embodiments of the present disclosure are not limited in this regard.
[0057] For example, the target task may include a data reading task, a data writing task, an image processing task, a neural or data loading task, etc., which is not limited in the embodiments of the present disclosure.
[0058] For example, the target task has virtual address task information.
[0059] For example, virtual address task information may include starting virtual address information (for example, information used to indicate the starting position of the task in the virtual address space), requested data length information (for example, information used to indicate the amount of data that the task needs to process), task type information (for example, used to indicate task types such as reading data, writing data, or executing specific instructions), priority information or timestamp information, etc. The embodiments of the present disclosure are not limited to this.
[0060] For example, the task information unit 110 may use a queue, a linked list, or other data structures to manage and / or store the target tasks, which is not limited in the embodiments of the present disclosure.
[0061] For example, the mapping relationship unit 120 may be configured to record the mapping relationship between the virtual page and the physical page in a table manner.
[0062] For example, the mapping relationship unit 120 may be configured to store at least two types of mapping relationships, for example, an object mapping relationship and a pre-fetch mapping relationship. For example, the two mapping relationships may be distinguished by a mapping relationship sequence number, which may be recorded using seq_num, for example, the sequence number of the object mapping relationship may be set to seq_num=0, and the sequence number of the pre-fetch mapping relationship may be set to seq_num=1.
[0063] For example, the object mapping relationship and the prefetch mapping relationship each include a mapping relationship between virtual pages and physical pages.
[0064] For example, the page number of the virtual page included in the object mapping relationship may be adjacent to the page number of the virtual page included in the prefetch mapping relationship, that is, the two are virtual memory pages with consecutive numbers (but the physical memory pages corresponding to the two may not be consecutively numbered). Exemplarily, assuming that the page number of the virtual page included in the object mapping relationship is 0, the page number of the virtual page included in the prefetch mapping relationship is 1.
[0065] For example, the object mapping relationship may be used to represent the mapping relationship between the virtual page currently in use and the physical page, and the prefetch mapping relationship may be used to represent the mapping relationship between the virtual page to be used subsequently and the physical page.
[0066] For example, the processing unit 130 may be configured to parse task information, query a mapping relationship, or set a mapping relationship, etc., which is not limited in the embodiments of the present disclosure.
[0067] For example, the processing unit 130 may be configured to obtain a target task to be processed from the task information unit 110 , and parse information such as virtual address task information carried by the target task.
[0068] For example, the processing unit 130 may be configured to query the target physical address corresponding to the target virtual address in the mapping relationship unit 120 according to the target virtual address included in the target task, for example, query the physical page where the target physical address corresponding to the virtual page where the target virtual address is located is located, thereby using the physical address of the physical page plus the offset part in the target virtual address (for example, see Figure 1 ) to obtain the corresponding target physical address itself. If the processing unit 130 queries a valid mapping relationship in the mapping relationship unit 120 (ie, the target physical address corresponding to the target virtual address can be obtained thereby), the target physical address can be used for subsequent operations.
[0069] For example, if the processing unit 130 does not query in the mapping relationship unit 120 to obtain the target physical address corresponding to the target virtual address, the processing unit 130 may continue to search for a mapping relationship corresponding to the virtual address and the physical address included in the request in the pre-fetch mapping relationship stored in the mapping relationship unit 120. For example, the processing unit 130 may be configured to continue to query the physical address corresponding to the target virtual address in the physical page corresponding to the pre-fetch mapping relationship stored in the mapping relationship unit 120, thereby using the physical address of the physical page plus the offset part in the target virtual address to obtain the corresponding target physical address itself.
[0070] For example, when the processing unit 130 continues to search the prefetch mapping relationship in the mapping relationship unit 120 to see whether there is a mapping relationship corresponding to the virtual address and physical address included in the request, the processing unit 130 can also invalidate the current object mapping relationship and set the prefetch mapping relationship to a new object mapping relationship, thereby triggering the replacement of the object mapping relationship and the creation of a new prefetch mapping relationship.
[0071] For example, the processing unit 130 may be further configured to, in response to the query of the object mapping relationship in the mapping relationship unit 120 no longer being able to obtain the target physical address, convert the prefetch mapping relationship into a new object mapping relationship, and pre-set a new prefetch mapping relationship according to the target task.
[0072] Exemplarily, the adjacent virtual page (i.e., the next page) and the corresponding physical page corresponding to the virtual page included in the current prefetch mapping relationship can be obtained through a memory management unit (MMU) or through a page table storage unit (such as a TLB or memory), thereby obtaining a new prefetch mapping relationship. For example, in the case where the processing unit 130 does not query in the mapping relationship unit 120 to obtain the target physical address corresponding to the target virtual address, the processing unit 130 can be configured to invalidate the current object mapping relationship, set the prefetch mapping relationship to a new object mapping relationship, and modify the mapping relationship sequence number of the prefetch mapping relationship to seq_num=0. In addition, the processing unit 130 can also be configured to set the mapping relationship sequence number of the new prefetch mapping relationship to seq_num=1, and so on.
[0073] Figure 3 A schematic block diagram of another task processing device provided by at least one embodiment of the present disclosure is shown.
[0074] like Figure 3 As shown, in some embodiments of the present disclosure, the task processing device 100 further includes a request-to-send unit 140 .
[0075] The pending request unit 140 may be configured to temporarily store the target task so that the target task waits for the processing unit 130 to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit 130 obtains the target physical address.
[0076] For example, the downstream of the task processing flow may include task execution (eg, memory access operations), etc., which is not limited in the embodiments of the present disclosure.
[0077] For example, the pending request unit 140 can better manage the waiting and sending process of the task, improve the efficiency and flexibility of task processing, and also help reduce task processing delays caused by resource contention or busy downstream modules.
[0078] For example, the pending request unit 140 may be configured to temporarily store target tasks that have been processed by the processing unit 130 but have not yet obtained a target physical address, or target tasks that have obtained a target physical address but cannot be immediately sent to a downstream task processing flow.
[0079] For example, when the processing unit 130 receives a new target task and converts the virtual address of the target task into a target physical address, if the corresponding target physical address cannot be obtained immediately (for example, the physical address corresponding to the target virtual address included in the target task does not exist in the object mapping relationship), the processing unit 130 can temporarily store the target task in the request unit 140 to be sent.
[0080] For example, the waiting request unit 140 may be configured to maintain the waiting state of the target task until the processing unit 130 obtains the target physical address required by the target task. For another example, in some cases (e.g., due to the busyness of the downstream module or resource limitations, etc.), even if the processing unit 130 has obtained the target physical address required by the target task, the processing unit 130 may not be able to immediately send the target task to the downstream task processing flow. In this case, the processing unit 130 may temporarily store the target task in the waiting request unit 140 and wait for an appropriate time to send it.
[0081] For example, the pending request unit 140 may include an effective task queue or list to manage the stored target tasks.
[0082] For example, the pending request unit 140 may be configured to determine the order in which tasks are sent according to the priority, arrival time, data length or other factors of the tasks, which is not limited in the embodiments of the present disclosure.
[0083] For example, when the downstream module is ready to receive tasks, the pending request unit 140 can send the corresponding tasks to the downstream in a predetermined order, further improving the efficiency and orderliness of the task processing flow.
[0084] For example, the pending request unit 140 may be configured to monitor the status of the task and the availability of the downstream module. When the processing unit 130 obtains the target physical address or the downstream module becomes available, the pending request unit 140 may update the status of the task accordingly.
[0085] In some embodiments of the present disclosure, the processing unit 130 may also be configured to temporarily store the target task in the request unit to be sent 140 in response to the target virtual address included in the target task existing in the virtual page included in the object mapping relationship and the target physical address corresponding to the target task not being obtained.
[0086] For example, the processing unit 130 may be configured to query, based on the target virtual address included in the target task, whether the target virtual address exists in the virtual page included in the object mapping relationship in the mapping relationship unit 120. If the target virtual address exists in the object mapping relationship, but the target physical address corresponding to the target task has not been retrieved by the processing unit 130, the processing unit 130 may temporarily store the target task in the pending request unit 140 to wait for subsequent processing.
[0087] For example, the situation where the target physical address corresponding to the target task has not been retrieved by the processing unit 130 may include page table miss, memory access delay or other reasons, and the embodiments of the present disclosure are not limited to this.
[0088] For example, when the processing unit 130 obtains the target physical address corresponding to the target virtual address, the processing unit 130 may be configured to match the target task in the pending request unit 140 and send the target task to the downstream of the task processing flow.
[0089] For example, the processing unit 130 may be configured to set a first tag using a physical address request and a target task, and after acquiring the target physical address, use the first tag to match the target task in the to-be-sent request unit 140 .
[0090] In at least one embodiment of the present disclosure, the processing unit 130 can effectively manage tasks that cannot be processed or sent immediately due to waiting for the target physical address. The waiting request unit 140 acts as an intermediate buffer to further improve the order and efficiency of multiple tasks during processing.
[0091] In some embodiments of the present disclosure, the processing unit 130 may also be configured to start an initial mapping relationship, obtain a target physical address, and set an object mapping relationship based on the initial mapping relationship in response to the mapping relationship unit 120 not setting a mapping relationship corresponding to a target task, according to the target virtual address and the target physical address.
[0092] For example, when the processing unit 130 processes a target task, the processing unit 130 may be configured to first query whether the target virtual address of the target task already has a corresponding mapping relationship in the mapping relationship unit 120. If the mapping relationship corresponding to the target task is not set in the mapping relationship unit 120, the processing unit 130 may set a corresponding mapping relationship so as to obtain the target physical address.
[0093] For example, the processing unit 130 queries the mapping relationship of the target virtual address in the mapping relationship unit 120 and finds that the corresponding mapping relationship is not set in the mapping relationship unit 120. Then, the processing unit 130 can start the process of establishing the initial mapping relationship.
[0094] For example, in the process of establishing the initial mapping relationship, the processing unit 130 may interact with a memory management unit (MMU) or a page table storage unit (such as a TLB or a memory) to request the memory management unit to provide a corresponding physical address, for example, the physical address plus the offset portion in the target virtual address (for example, see Figure 1 ) to get the corresponding target physical address itself.
[0095] For example, the processing unit 130 may be configured to send a first request to a memory management unit (MMU) or a page table storage unit (eg, TLB or memory) to obtain a target physical address corresponding to the target virtual address.
[0096] For example, the first request may include a physical address request.
[0097] For example, after obtaining the target physical address, the processing unit 130 may also be configured to set a corresponding object mapping relationship in the mapping relationship unit 120 according to a mapping relationship (ie, an initial mapping relationship) between the target virtual address and the target physical address.
[0098] For example, the mapping relationship corresponding to the virtual page where the initial mapping relationship is located may be set as an object mapping relationship.
[0099] In at least one embodiment of the present disclosure, the processing unit 130 can effectively establish a mapping relationship when the mapping relationship unit 120 has not set a mapping relationship corresponding to the target task.
[0100] In some embodiments of the present disclosure, the processing unit 130 may also be configured to set a first tag for the first request, associate the first tag with the initial mapping relationship, and after obtaining the target physical address, use the first tag to provide the target physical address to the initial mapping relationship to set the target mapping relationship, that is, use the first tag as an auxiliary tool for retrieval.
[0101] For example, the processing unit 130 may be configured to assign a unique first tag to the first request.
[0102] For example, the first tag may include a simple identifier for tracking the status of the first request during subsequent processing.
[0103] For example, the processing unit 130 may be configured to associate the first tag with the initial mapping relationship.
[0104] For example, the processing unit 130 may be configured to send the first request to a memory management unit or a page table storage unit (such as a TLB or a memory) to obtain a corresponding physical address, which also carries the first tag. For example, the physical address plus the offset portion of the target virtual address (see, for example, Figure 1 ) to obtain the corresponding target physical address itself, which also carries the first label.
[0105] For example, after acquiring the target physical address, the processing unit 130 may be configured to use the first tag to determine the mapping relationship in the mapping relationship unit 120, and modify the mapping relationship to complete the creation of a new target mapping relationship, which is the object mapping relationship.
[0106] In at least one embodiment of the present disclosure, by using the first tag to associate and manage the mapping relationship, the processing unit 130 can more efficiently process multiple concurrent requests while further improving the accuracy and consistency of the mapping relationship.
[0107] In some embodiments of the present disclosure, the processing unit 130 may also be configured to obtain a prefetch virtual address and a prefetch physical address corresponding to the prefetch virtual address based on the target virtual address during the process of starting the object mapping relationship, and to start the prefetch mapping relationship based on the prefetch virtual address and the prefetch physical address.
[0108] For example, the prefetched virtual address may be used to indicate that during the execution of the target task, as the target virtual address increases, when the current object mapping relationship can no longer provide a corresponding physical address, the target virtual address will be changed to a new virtual address.
[0109] Exemplarily, the target task may include multiple subtasks, and the target virtual addresses of the multiple subtasks correspond to multiple continuous virtual pages, and the corresponding physical addresses also involve multiple physical pages, thus requiring multiple mapping relationships. For example, as the processing unit 130 processes the multiple subtasks, the target virtual addresses corresponding to the processed subtasks gradually increase from one virtual page to another adjacent virtual page. If the current object mapping relationship cannot continue to provide the corresponding physical address for the current subtask, then the next adjacent virtual page is used as the pre-fetched virtual address, and the physical page corresponding to the virtual page is used as the pre-fetched physical address.
[0110] For example, the processing unit 130 may be configured to determine whether the prefetch physical address corresponding to the prefetch virtual address is stored in the prefetch mapping relationship, and activate the prefetch mapping relationship if the prefetch physical address is stored in the prefetch mapping relationship.
[0111] For example, the processing unit 130 may be configured to query the mapping unit 120 for a prefetch physical address corresponding to the prefetch virtual address according to the prefetch virtual address.
[0112] In some embodiments of the present disclosure, the target task includes a plurality of subtasks that are executed separately. The processing unit 130 may also be configured to start the object mapping relationship according to the first subtask among the plurality of subtasks.
[0113] For example, the target task may include multiple subtasks, each of which may represent a smaller task request (eg, the size of the subtask may be 64 bytes, 128 bytes, etc.).
[0114] For example, a target task may include multiple subtasks that may be logically continuous, but these multiple subtasks may be continuous in virtual memory but may be scattered in physical memory, for example, they may involve or span multiple virtual pages, and of course, they may also involve multiple physical pages (for example, the size of each page may be 4KB).
[0115] For example, when the target task starts to be executed, the processing unit 130 may be configured to start the object mapping relationship according to the first subtask.
[0116] For example, the method for the processing unit 130 to start the object mapping relationship according to the first subtask can also refer to the relevant description about starting the initial mapping relationship in the above embodiment, which will not be repeated here.
[0117] For example, during the execution of the first subtask, the processing unit 130 may be configured to predict the page corresponding to the mapping relationship that the next subtask (ie, the second subtask) will access.
[0118] For example, as multiple subtasks are executed, the pages corresponding to the mapping relationship may change accordingly to reflect the pages currently being used (ie, the object mapping relationship) and the pre-fetched pages (ie, the pre-fetch mapping relationship).
[0119] For example, after the first subtask is completed, the processing unit 130 may continue to execute subsequent subtasks according to the task description or dependency relationship, and for each subsequent subtask, the processing unit 130 may repeat the above-mentioned mapping relationship search, use and update steps.
[0120] For example, when the subtask address is accumulated and enters the page corresponding to the next mapping relationship (e.g., the next 4KB page), the mapping relationship sequence number of the object mapping relationship and the mapping relationship sequence number of the pre-fetch mapping relationship can be updated accordingly. Exemplarily, the processing unit 130 can be configured to invalidate the object mapping relationship with the current mapping relationship sequence number seq_num=0, and set the mapping relationship sequence number seq_num=1 of the pre-fetch mapping relationship to seq_num=0, which becomes the new object mapping relationship.
[0121] In at least one embodiment of the present disclosure, by starting the object mapping relationship according to the first subtask among multiple subtasks, and combining the pre-fetching and recycling mechanism of the mapping relationship, the processing unit 130 can efficiently process the target task across multiple pages, reduce the number of accesses to the high-level mapping table (such as the aforementioned multi-level page table), reduce the memory access delay, and improve the overall performance of the system. At the same time, by dynamically updating and pre-fetching the mapping relationship, the processing unit 130 can adapt to the changing task requirements and memory usage patterns, and improve flexibility and adaptability.
[0122] In some embodiments of the present disclosure, the processing unit 130 may also be configured to query the object mapping relationship in the mapping relationship unit 120 based on the target virtual addresses included in other subtasks except the first subtask in the multiple subtasks to obtain the target physical addresses corresponding to other subtasks.
[0123] For example, when the processing unit 130 needs to execute other subtasks except the first subtask, the processing unit 130 may initiate a query request to the mapping unit 120 according to the target virtual addresses included in these subtasks, and search in the object mapping relationship stored in the mapping unit 120 to obtain the physical addresses corresponding to these subtasks. The method of obtaining the corresponding target physical address according to the physical address may also refer to the relevant description of the aforementioned embodiment, which will not be repeated here.
[0124] In some embodiments of the present disclosure, the processing unit 130 may also be configured to invalidate the object mapping relationship after the target task processing is completed.
[0125] For example, after the target task (the plurality of subtasks included in the target task) is completed, the processing unit 130 may also invalidate (also referred to as cancel or release) the object mapping relationship previously established for executing the target task.
[0126] For example, the processing unit 130 can determine whether the target task (the multiple subtasks included in the target task) have all been executed. When confirming that the target tasks have all been executed, the processing unit 130 can send a corresponding signal or command to the mapping relationship unit 120, instructing the mapping relationship unit 120 to invalidate the mapping relationship related to the completed target task.
[0127] For example, after the processing unit 130 invalidates the object mapping relationship, the processing unit 130 processes a new target task and needs to restart the initial mapping relationship (ie, start again from the initial state).
[0128] In at least one embodiment of the present disclosure, the security, resource effectiveness and data consistency of the system are improved through the invalid object mapping relationship.
[0129] In the embodiments of the present disclosure, Figure 2 and Figure 3 The task information unit 110, mapping unit 120, processing unit 130 and request unit 140 shown can be hardware, software, firmware and any feasible combination thereof. For example, the task information unit 110, mapping unit 120, processing unit 130 and request unit 140 can be dedicated or general circuits, chips or devices, etc., or a combination of a processor and a memory. The embodiments of the present disclosure do not limit the specific implementation forms of the above-mentioned units.
[0130] It should be noted that, in the embodiment of the present disclosure, the various units of the task processing device 100 may also correspond to the various steps of the task processing method (described below) provided in the embodiment of the present disclosure, for example. Figure 2 and Figure 3 The components and structures of the task processing device 100 shown are merely exemplary and not restrictive. The task processing device 100 may further include other components and structures as required.
[0131] Figure 4 A schematic block diagram of an application of a task processing device provided by at least one embodiment of the present disclosure is shown.
[0132] like Figure 4 As shown, the task processing device 200 includes a task information unit 210, a mapping unit 220, and a request unit 230. The task processing device 200 is coupled to a memory management unit 240. The mapping unit 220 stores multiple sets of mapping relationships.
[0133] For example, the task information unit 210 is configured to store target tasks to be processed.
[0134] For example, the task information unit 210 may store a plurality of tasks to be processed.
[0135] For example, the mapping relationship unit 220 is configured to store an object mapping relationship and a prefetch mapping relationship from a virtual address to a physical address corresponding to a target task, wherein a set of mapping relationships includes an object mapping relationship and a prefetch mapping relationship.
[0136] For example, the mapping unit 220 may be configured to store a corresponding object mapping relationship and a pre-fetch mapping relationship for each of the multiple tasks to be processed stored in the task information unit 210 , so the mapping unit 220 may store multiple sets of object mapping relationships and pre-fetch mapping relationships.
[0137] For example, the task processing device 200 may further include a processing unit (not shown in the figure). The processing unit may be configured to set or query an object mapping relationship in the mapping relationship unit 220 according to the target virtual address included in the target task to obtain a target physical address corresponding to the target task, and pre-set a pre-fetch mapping relationship according to the target task. For example, the method for the processing unit to obtain a target physical address corresponding to the target task according to the target virtual address included in the target task may refer to the relevant description of the processing unit 130 in the aforementioned embodiment, which will not be repeated here.
[0138] For example, the pending request unit 230 may be configured to temporarily store the target task so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
[0139] For example, the processing unit can also be configured to start an initial mapping relationship, obtain the target physical address, and set the object mapping relationship based on the initial mapping relationship in response to the mapping relationship unit 220 not setting the mapping relationship corresponding to the target task, according to the target virtual address and the target physical address.
[0140] For example, the processing unit may also be configured to send a first request to the memory management unit 240 to obtain the target physical address.
[0141] Figure 5 It shows that at least one embodiment of the present disclosure provides Figure 4 The application diagram of the task processing device shown.
[0142] like Figure 5 As shown, the task processing device 200 may be configured to perform the following steps:
[0143] Step 1: Task splitting and mapping search.
[0144] For example, the task information unit 210 may be configured to select a task to be executed (i.e., a target task), such as reading 16KB of data starting from address 0. For example, the maximum length of a bus request is set to 64B, and the target task may be split into 256 subtasks (16KB / 64B=256 subtasks).
[0145] For example, the virtual address (VA) of each subtask can be searched for the corresponding physical address (PA) in the mapping relationship unit 220 by the processing unit. If the corresponding physical address cannot be found or the physical address request has not been completed and the physical address request has not been sent, the tag number of the subtask is recorded, and then step 2 and step 4 are executed; if the physical address request has been sent, the tag number of the subtask is recorded, and then step 4 is executed.
[0146] Step 2: Request the physical address.
[0147] For example, the processing unit may be configured to generate a physical address request for each subtask requiring a physical address, and send the physical address request to the memory management unit 240 .
[0148] For example, each physical address request may be assigned a unique tag number to track the status of each physical address request.
[0149] For example, for the first subtask, the mapping relationship sequence number of the mapping relationship corresponding to the first subtask may be set to seq_num=0.
[0150] Step 2': Prefetch physical address request.
[0151] For example, the processing unit may be configured to pre-fetch a physical address request for the next page.
[0152] For example, each prefetch physical address request can be assigned a unique tag number and recorded.
[0153] For example, after the currently used page (the page of the current object mapping relationship) is switched as the virtual addresses corresponding to the multiple subtasks increase, the mapping relationship sequence number (ie, seq_num) of the object mapping relationship may be rotated to trigger a new round of prefetching operations.
[0154] For example, for a prefetch operation, the current object mapping relationship may be invalidated, and the prefetch mapping relationship may be replaced with the object mapping relationship, that is, the mapping relationship sequence number (seq_num=1) of the prefetch mapping relationship may be modified to seq_num=0 to become a new object mapping relationship. Furthermore, a new physical address may be further obtained from the memory management unit to create a new mapping relationship, the mapping relationship may be set as a new prefetch mapping relationship, and the mapping relationship sequence number of the new prefetch mapping relationship may be modified to seq_num=1, and so on.
[0155] Step 3: Receive physical address response.
[0156] For example, the memory management unit 240 returns a response of the physical address, and the physical address is obtained according to the mapping relationship of the corresponding tag.
[0157] For example, the processing unit may be configured to search for a corresponding physical address in the mapping unit 220 according to the returned tag number.
[0158] Step 3': The request unit to be sent is updated.
[0159] For example, the processing unit may be configured to provide a corresponding physical address for the subtask stored in the pending request unit 230 according to the returned tag number. After the subtask stored in the pending request unit 230 obtains the physical address, the subtask may be ready to be sent to the downstream module for further processing.
[0160] Step 4: Query the mapping relationship.
[0161] For example, the processing unit may be configured to query the physical address of the subtask in the mapping unit 220. If the physical address already exists, the physical address is directly obtained. If the physical address has not been obtained, its tag number is recorded and the physical address is waited for to be returned. In addition, the subtask is temporarily stored in the request unit 230 to be sent.
[0162] Step 5: Send the subtask.
[0163] For example, the waiting request unit 230 can be configured to check whether each subtask stored therein meets the sending condition, such as confirming whether each subtask has obtained a physical address. Subtasks that meet the sending condition will be sent to the downstream module of task processing for subsequent processing.
[0164] Step 6: Task completion and mapping relationship reset.
[0165] For example, when all subtasks of a target task have been processed, the object mapping relationship may be invalidated by the processing unit, and the related mapping relationship may be reset to the initial state to prepare for processing new tasks.
[0166] In at least one embodiment of the present disclosure, by executing the above steps, the task processing device 200 can further reduce the waiting delay, and alternately use the mapping relationship to continuously perform pre-fetch operations, and provide the task with a continuously updated physical address with less physical resource consumption. At the same time, through the cooperation of the request unit 230 to be sent, the subtask is not blocked for the next step of processing, saving the time for re-querying, and can support multiple requests to obtain physical addresses at the same time, realizing uninterrupted processing and providing higher bandwidth performance. It can further reduce delays, reduce physical resource consumption, improve the operating efficiency of the computer system, and reduce the chip area.
[0167] For the relevant contents of the functions or beneficial effects of the task processing device 200 and each step executed by the task processing device 200 provided in any of the above embodiments of the present disclosure, for example, reference may also be made to the relevant description of the task processing device 100 provided in any of the above embodiments, and no further details will be given here.
[0168] In the embodiment of the present disclosure, the task information unit 210, the mapping relationship unit 220, the processing unit and the request unit to be sent 230, and the memory management unit 240 included in the task processing device 200 can be hardware, software, firmware, and any feasible combination thereof. For example, the task information unit 210, the mapping relationship unit 220, the processing unit and the request unit to be sent 230, and the memory management unit 240 included in the task processing device 200 can be a dedicated or general circuit, chip or device, etc., or a combination of a processor and a memory. The embodiment of the present disclosure does not limit the specific implementation form of each of the above units.
[0169] It should be noted that, in the embodiment of the present disclosure, the various units of the task processing device 200 may also correspond to the various steps of the task processing method (described below) provided in the embodiment of the present disclosure, for example. Figure 4 and Figure 5 The components and structures of the task processing device 200 shown are merely exemplary and non-limiting. The task processing device 200 may further include other components and structures as required.
[0170] Figure 6 A flowchart of a task processing method provided by at least one embodiment of the present disclosure is shown.
[0171] like Figure 6 As shown, in some embodiments of the present disclosure, the task processing method includes steps S300-S330. For example, the task processing method can be applied to the task processing device 100 or the task processing device 200 provided in the above embodiments, and the embodiments of the present disclosure are not limited to this.
[0172] Step S300: storing the target tasks to be processed.
[0173] For example, step S300 may be applied to the task information unit 110 or the task information unit 210 provided in the aforementioned embodiment, and the embodiments of the present disclosure are not limited to this.
[0174] Step S310: storing the object mapping relationship and pre-fetch mapping relationship from the virtual address to the physical address corresponding to the target task.
[0175] For example, step S310 may be applied to the mapping relationship unit 120 or the mapping relationship unit 220 provided in the aforementioned embodiments, and the embodiments of the present disclosure are not limited to this.
[0176] Step S320: according to the target virtual address included in the target task, an object mapping relationship is set or queried in the mapping relationship unit to obtain a target physical address corresponding to the target task.
[0177] Step S330: pre-set a pre-fetch mapping relationship according to the target task.
[0178] For example, step S320 and step S330 may be applied to the processing unit provided in the aforementioned embodiment, and the embodiments of the present disclosure are not limited to this.
[0179] Figure 7 A flowchart of another task processing method provided by at least one embodiment of the present disclosure is shown.
[0180] like Figure 7 As shown, in some embodiments of the present disclosure, the task processing method may further include step S340.
[0181] Step S340: temporarily storing the target task.
[0182] For step S340 , the target task is temporarily stored so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
[0183] For example, step S340 may be applied to the request-to-be-sent unit 140 or the request-to-be-sent unit 230 provided in the aforementioned embodiments, and the embodiments of the present disclosure are not limited to this.
[0184] In some embodiments of the present disclosure, step S340 may further include step S341.
[0185] Step S341: In response to the target virtual address included in the target task existing in the virtual page included in the object mapping relationship, and the target physical address corresponding to the target task is not obtained, temporarily storing the target task in the request unit to be sent.
[0186] In some embodiments of the present disclosure, step S320 may further include step 321 .
[0187] Step 321: In response to the mapping relationship unit not setting a mapping relationship corresponding to the target task, start the initial mapping relationship, obtain the target physical address, and set the object mapping relationship based on the initial mapping relationship according to the target virtual address and the target physical address.
[0188] In some embodiments of the present disclosure, step S321 may further include step 3211.
[0189] Step 3211: Send a first request to the memory management unit to obtain a target physical address.
[0190] In some embodiments of the present disclosure, step S3211 may further include step 32111.
[0191] Step 32111: Set a first tag for the first request, associate the first tag with the initial mapping relationship, and after obtaining the target physical address, use the first tag to provide the target physical address to the initial mapping relationship to set the target mapping relationship.
[0192] In some embodiments of the present disclosure, step S330 may further include step 331 .
[0193] Step S331: in the process of starting the object mapping relationship, based on the target virtual address, a prefetch virtual address and a prefetch physical address corresponding to the prefetch virtual address are obtained, and a prefetch mapping relationship is started based on the prefetch virtual address and the prefetch physical address.
[0194] In some embodiments of the present disclosure, step S330 may further include step 332 .
[0195] Step S332: In response to the query of the object mapping relationship in the mapping relationship unit and the inability to obtain the target physical address, the prefetch mapping relationship is converted into a new object mapping relationship, and the new prefetch mapping relationship is pre-set according to the target task.
[0196] In some embodiments of the present disclosure, the target task includes a plurality of subtasks that are executed separately. Step S330 may further include step 333 .
[0197] Step S333: starting an object mapping relationship according to the first subtask among the multiple subtasks.
[0198] In some embodiments of the present disclosure, step S333 may further include step 3331.
[0199] Step S3331: According to the target virtual addresses included in the other subtasks except the first subtask among the multiple subtasks, query the object mapping relationship in the mapping relationship unit to obtain the target physical addresses corresponding to the other subtasks.
[0200] In some embodiments of the present disclosure, the task processing method may further include step S350.
[0201] Step S350: After the target task processing is completed, invalidate the object mapping relationship.
[0202] In some embodiments of the present disclosure, the target task has virtual address task information, and the virtual address task information includes starting virtual address information, request data length information, or task type information.
[0203] In some embodiments of the present disclosure, the object mapping relationship and the prefetch mapping relationship include a mapping relationship between a virtual page and a physical page.
[0204] In some embodiments of the present disclosure, the page number of the virtual page included in the object mapping relationship and the page number of the virtual page included in the prefetch mapping relationship are adjacent.
[0205] It should be noted that, for the relevant contents of the functions or beneficial effects of each step in the task processing method provided in any of the above embodiments of the present disclosure, for example, reference can be made to the relevant description of the task processing device provided in any of the above embodiments, and will not be repeated here.
[0206] Figure 8 A schematic block diagram of another task processing device provided by at least one embodiment of the present disclosure is shown.
[0207] like Figure 8 As shown, at least one embodiment of the present disclosure further provides a task processing device 400, which can be, for example, the task processing device provided by any embodiment of the present disclosure.
[0208] For example, the task processing device 400 may include a processor 410 and a memory 420. The memory 420 may be used to store computer-readable instructions (e.g., one or more computer program modules) in a non-temporary manner. The processor 410 may be used to execute the computer-readable instructions, and when the computer-readable instructions are executed by the processor 410, one or more steps in the task processing method described above may be executed. The memory 420 and the processor 410 may be interconnected through a bus or link, in a wired, wireless, and / or other form of communication medium, etc., and the embodiments of the present disclosure are not limited to this.
[0209] For example, the processor 410 may be a central processing unit (CPU), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities. For example, the central processing unit (CPU) may be a RISC, X86, or ARM architecture, etc., which is not limited in the embodiments of the present disclosure. The processor 410 may be a general-purpose processor or a special-purpose processor, and may control other components in the task processing device 400 to perform desired functions.
[0210] For example, the memory 420 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 410 may run one or more computer program modules to implement various functions of the task processing device 400. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0211] It should be noted that, in the embodiments of the present disclosure, the specific functions and technical effects of the task processing device 400 can be referred to the above description of the task processing device and the task processing method, and will not be repeated here.
[0212] Fig. 9 A schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure is shown.
[0213] At least some embodiments of the present disclosure also provide an electronic device, such as Fig. 9 As shown, the electronic device 500 includes a task processing device 508. For example, the task processing device 508 may be a task processing device provided by any embodiment of the present disclosure, for example, it may be implemented as a sender or receiver of tasks / instructions / data, and may be a processor, a memory, or an I / O device, etc.
[0214] The electronic device 500 in the embodiment of the present disclosure may include mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., as well as any devices such as digital TVs, desktop computers, servers, etc., and may also be a combination of any data processing devices and hardware, which is not limited by the embodiments of the present disclosure.
[0215] Fig. 9 The electronic device 500 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0216] For example, Fig. 9 As shown, in some examples, the electronic device 500 includes a processor 501 (such as a central processing unit, a graphics processing unit, etc.), which may include a processor or a processing unit involved in any embodiment of the present disclosure, and the processor 501 can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device (not shown in the figure) to a random access memory (RAM) 503. Various programs and data required for the operation of the computer system are also stored in RAM503. The processor 501, ROM502 and RAM503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0217] For example, the following components may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509 which may also include, for example, a network interface card such as a LAN card, a modem, etc. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data, performing communication processing via a network such as the Internet. The drive 510 is also connected to the I / O interface 505 as needed. Removable media 511, such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive 510 as needed, so that the computer program read therefrom can be installed into the storage device as needed. Although Fig. 9 The electronic device 500 is shown to include various devices, but it should be understood that it is not required to implement or include all the devices shown. More or fewer devices may be implemented or included instead.
[0218] For example, the electronic device 500 may further include a peripheral interface (not shown in the figure), etc. The peripheral interface may be various types of interfaces, such as a USB interface, a lightning interface, etc. The communication device 509 may communicate with a network and other devices through wireless communication, such as the Internet, an intranet and / or a wireless network such as a cellular phone network, a wireless local area network (LAN) and / or a metropolitan area network (MAN). Wireless communication may use any of a variety of communication standards, protocols, and techniques, including, but not limited to, Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wi-Fi (e.g., based on IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, and / or IEEE 802.11n standards), Voice over Internet Protocol (VoIP), Wi-MAX, protocols for email, instant messaging, and / or Short Message Service (SMS), or any other suitable communication protocol.
[0219] It should be noted that in the embodiments of the present disclosure, the specific functions and technical effects of the electronic device 500 can be referred to the above descriptions on the task processing device and the task processing method, and will not be repeated here.
[0220] At least one embodiment of the present disclosure further provides a non-transitory computer-readable storage medium, which is used to non-transitorily store computer-readable instructions. When the computer-readable instructions are executed by a computer, the above-mentioned task processing method can be implemented.
[0221] Fig.10 A schematic diagram of a computer-readable storage medium provided by at least one embodiment of the present disclosure is shown.
[0222] like Fig.10 As shown, the computer-readable storage medium 600 is used to store computer-readable instructions 610. For example, when the computer-readable instructions 610 are executed by a computer, one or more steps in the task processing method described above can be performed.
[0223] For example, the computer-readable storage medium 600 can be applied to a task processing device or an electronic device provided in any embodiment of the present disclosure.
[0224] For example, the relevant description of the computer readable storage medium 600 can also be referred to Fig. 9 The storage device in the electronic device 500 shown in FIG. Figure 8 The corresponding description of the memory 420 in the task processing device 400 is shown and will not be repeated here.
[0225] It should be noted that, in the embodiments of the present disclosure, the specific functions and technical effects of the computer-readable storage medium 600 can be referred to the above description of the task processing device and the task processing method, and will not be repeated here.
[0226] There are a few points to note:
[0227] (1) The drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure. Other structures may refer to the general design.
[0228] (2) In the absence of conflict, the embodiments of the present disclosure and the features therein may be combined with each other to obtain new embodiments.
[0229] The above description is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto. The protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A task processing device, comprising: A task information unit, configured to store target tasks to be processed; A mapping relationship unit, configured to store an object mapping relationship and a pre-fetch mapping relationship from a virtual address to a physical address corresponding to the target task; as well as The processing unit is configured to set or query the object mapping relationship in the mapping relationship unit according to the target virtual address included in the target task to obtain the target physical address corresponding to the target task, and pre-set the prefetch mapping relationship according to the target task.
2. The task processing device according to claim 1, further comprising: The request unit to be sent is configured to temporarily store the target task so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
3. The task processing device according to claim 2, wherein: The processing unit is further configured to temporarily store the target task in the request to be sent unit in response to the target virtual address included in the target task existing in the virtual page included in the object mapping relationship and the target physical address corresponding to the target task not being acquired.
4. The task processing device according to claim 1, wherein: The processing unit is also configured to, in response to the mapping relationship unit not setting a mapping relationship corresponding to the target task, start an initial mapping relationship, obtain the target physical address, and set the object mapping relationship based on the initial mapping relationship according to the target virtual address and the target physical address.
5. The task processing device according to claim 4, wherein: The processing unit is further configured to send a first request to a memory management unit to obtain the target physical address.
6. The task processing device according to claim 5, wherein: The processing unit is further configured to set a first tag for the first request, associate the first tag with the initial mapping relationship, and after acquiring the target physical address, use the first tag to provide the target physical address to the initial mapping relationship to set the target mapping relationship.
7. The task processing device according to claim 1, wherein: The processing unit is further configured to, in the process of starting the object mapping relationship, obtain a pre-fetch virtual address and a pre-fetch physical address corresponding to the pre-fetch virtual address based on the target virtual address, and The prefetch mapping relationship is enabled based on the prefetch virtual address and the prefetch physical address.
8. The task processing device according to claim 1, wherein: The processing unit is further configured to, in response to the object mapping relationship being no longer able to obtain the target physical address when querying the mapping relationship unit, convert the prefetch mapping relationship into a new object mapping relationship, and pre-set a new prefetch mapping relationship according to the target task.
9. The task processing device according to claim 1, wherein: The target task includes a plurality of subtasks to be executed separately; and The processing unit is further configured to start the object mapping relationship according to a first subtask among the multiple subtasks.
10. The task processing device according to claim 9, wherein: The processing unit is further configured to query the object mapping relationship in the mapping relationship unit according to the target virtual addresses included in other subtasks among the multiple subtasks except the first subtask, so as to obtain the target physical addresses corresponding to the other subtasks.
11. The task processing device according to any one of claims 1 to 10, wherein: The processing unit is further configured to invalidate the object mapping relationship after the target task processing is completed.
12. The task processing device according to any one of claims 1 to 10, wherein: The target task has virtual address task information, and the virtual address task information includes starting virtual address information, request data length information or task type information.
13. The task processing device according to any one of claims 1 to 10, wherein: The object mapping relationship and the pre-fetch mapping relationship include a mapping relationship between a virtual page and a physical page.
14. The task processing device according to claim 13, wherein: The page number of the virtual page included in the object mapping relationship and the page number of the virtual page included in the prefetch mapping relationship are adjacent.
15. A task processing method, comprising: Store target tasks to be processed; Storing an object mapping relationship and a pre-fetch mapping relationship from a virtual address to a physical address corresponding to the target task; According to the target virtual address included in the target task, setting or querying the object mapping relationship in the mapping relationship unit to obtain the target physical address corresponding to the target task; and The pre-fetch mapping relationship is preset according to the target task.
16. The task processing method according to claim 15, further comprising: The target task is temporarily stored so that the target task waits for the processing unit to obtain the target physical address, or so that the target task waits to be sent to the downstream of the task processing flow after the processing unit obtains the target physical address.
17. A task processing device, comprising: processor; as well as A memory, wherein the memory stores at least one computer program, and when the at least one computer program is executed by the processor, the task processing method according to any one of claims 15 to 16 is implemented.
18. An electronic device comprising the task processing device according to any one of claims 1 to 14 and 17.
19. A non-transitory computer-readable storage medium, used for non-temporarily storing computer-readable instructions, which, when executed by a computer, implements the task processing method according to any one of claims 15 to 16.
Citation Information
Cited By
Direct memory access control method and system, electronic equipment and storage medium
CN120179588A
Data processing method, data processing device, processing cluster and related products
CN121728059A