Access request processing method and electronic device
By dividing dynamic and inherent storage units in the cache space of the memory management unit, the dynamic storage unit is used to store any type of access request, which solves the problem of insufficient storage space when the memory management unit is processed by processing a large number of access requests, and improves the processing efficiency of access requests.
Patent Information
- Application Number
- CN202411565403.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-11-04
AI Technical Summary
When the memory management unit processes a large number of read or write access requests, it may not be able to cache and process some type of access requests in time due to insufficient storage space.
By dividing the dynamic storage unit and the inherent storage unit in the cache space of the memory management unit, the dynamic storage unit can be used to store any type of access request and dynamically allocate the storage space according to the request type.
It realizes the rational allocation of storage space according to the number of different types of access requests, reduces the problem of access requests that cannot be processed in time due to unreasonable allocation of storage space, and improves the efficiency of access request processing.
Smart Images

Figure CN119065861B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an access request processing method and an electronic device. Background Art
[0002] The memory management unit in the electronic device can obtain access requests (such as read requests or write requests) issued by processing units such as a processor or a display unit in the electronic device, and perform address mapping and permission control on the access requests.
[0003] The memory management unit can process both read and write access requests at the same time. After receiving an access request, the memory management unit will cache the access request to the storage space corresponding to the request type of the access request. However, the number of read requests and write requests that the memory management unit needs to process at different times is not fixed. If the number of a certain type of access request that the memory management unit needs to process is large at a certain moment, but the storage space corresponding to this type in the memory management unit is insufficient, the memory management unit will not be able to cache and process this type of access request in time. Summary of the invention
[0004] On the one hand, the present application provides an access request processing method, comprising:
[0005] The memory management unit obtains a first access request to be cached, and determines a request type of the first access request, wherein the cache space of the memory management unit includes at least one dynamic storage unit, and the dynamic storage unit in an idle state is classified as a storage unit in the dynamic cache area;
[0006] In the case where a first condition is met, determining a target dynamic storage unit in the dynamic cache area for storing the first access request, and in the case where the first condition is met, the dynamic cache area includes at least one dynamic storage unit;
[0007] storing the first access request in the target dynamic storage unit;
[0008] The target dynamic storage unit is assigned to a storage queue corresponding to the request type of the first access request.
[0009] In a possible implementation, the cache space further includes: at least one inherent storage unit corresponding to each of different request types;
[0010] The access request processing method further includes:
[0011] In the case where the second condition is met, determining a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit corresponding to the request type of the first access request and in an idle state;
[0012] storing the first access request in the target inherent storage unit;
[0013] The target inherent storage unit is assigned to a storage queue corresponding to the request type of the first access request.
[0014] In yet another possible implementation, the classifying the target intrinsic storage unit into a storage queue corresponding to the request type of the first access request includes:
[0015] The tail pointer of the first linked list is pointed to the target inherent storage unit, and the first linked list is used to manage each storage unit in the storage queue corresponding to the request type of the first access request.
[0016] In yet another possible implementation manner, after determining a target intrinsic storage unit for storing the first access request, the method further includes:
[0017] If the head pointer of the first linked list points to a null address, the head pointer of the first linked list is pointed to the target inherent storage unit.
[0018] In another possible implementation, the dynamic cache area further includes: inherent storage units corresponding to different request types and in an idle state;
[0019] The step of determining a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit that corresponds to the request type of the first access request and is in an idle state comprises:
[0020] Determine the target inherent storage unit that is the frontmost in the second linked list corresponding to the dynamic cache area and corresponds to the request type of the first access request, and obtain the target inherent storage unit for storing the first access request;
[0021] After determining a target intrinsic storage unit for storing the first access request, the method further includes:
[0022] The target inherent storage unit is removed from the second linked list.
[0023] In yet another possible implementation, the assigning the target dynamic storage unit to a storage queue corresponding to the request type of the first access request includes:
[0024] Pointing a tail pointer of a first linked list to the target dynamic storage unit, wherein the first linked list is used to manage each storage unit in a storage queue corresponding to the request type of the first access request;
[0025] The target dynamic storage unit is removed from the second linked list corresponding to the dynamic cache area.
[0026] In yet another possible implementation, determining a target dynamic storage unit in the dynamic cache area for storing the first access request includes:
[0027] Determine the dynamic storage unit pointed to by the head pointer of the second linked list corresponding to the dynamic cache area as the target dynamic storage unit for storing the first access request;
[0028] The removing the target dynamic storage unit from the second linked list corresponding to the dynamic cache area comprises:
[0029] The head pointer of the second linked list is pointed to the next dynamic storage unit after the target dynamic storage unit.
[0030] In yet another possible implementation, the method further includes:
[0031] In response to a data acquisition instruction, determining a request type to which an access request to be retrieved by the data acquisition instruction belongs;
[0032] The first stored second access request is retrieved from the storage queue corresponding to the request type to which the access request to be retrieved belongs.
[0033] In yet another possible implementation, the cache space further includes: at least one inherent storage unit corresponding to each of the different request types;
[0034] The taking out the first stored second access request from the storage queue corresponding to the request type to which the access request to be taken out belongs comprises:
[0035] Determine a target storage unit pointed to by a head pointer in a first linked list corresponding to a request type to which the access request to be retrieved belongs, wherein the first linked list is used to manage each storage unit in a storage queue corresponding to the request type of the access request to be retrieved;
[0036] Retrieving a second access request stored in the target storage unit;
[0037] After determining the target storage unit, the method further includes:
[0038] If the target storage unit belongs to the inherent storage unit corresponding to the request type of the second access request, point the head pointer of the first linked list to the next storage unit in the first linked list that is located after the target storage unit;
[0039] If the target storage unit belongs to a dynamic storage unit, the tail pointer of the second linked list corresponding to the dynamic cache area is pointed to the target storage unit, and the head pointer of the first linked list is pointed to the next storage unit in the first linked list after the target storage unit.
[0040] In yet another aspect, the present application further provides an electronic device, comprising: a memory management unit, wherein a cache space of the memory management unit comprises at least one dynamic storage unit, and a dynamic storage unit in an idle state is classified as a storage unit in a dynamic cache area;
[0041] The memory management unit is used to obtain a first access request to be cached and determine a first request type of the first access request; when a first condition is met, determine a target dynamic storage unit in the dynamic cache area for storing the first access request, and when the first condition is met, the dynamic cache area includes at least one dynamic storage unit; store the first access request in the target dynamic storage unit; and assign the target dynamic storage unit to a storage queue corresponding to the first request type. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0043] Figure 1 A flowchart of the access request processing method provided by this application;
[0044] Figure 2 A diagram of the implementation framework for obtaining and caching access requests for the memory management unit;
[0045] Figure 3 A schematic diagram of another flow chart of the access request processing method provided by the present application;
[0046] Figure 4 A schematic diagram of another flow chart of the access request processing method provided by the present application;
[0047] Figure 5 An example relationship between a storage unit and a linked list of a cache space in this application;
[0048] Figure 6 is another example relationship between the storage unit and the linked list of the cache space in this application;
[0049] Figure 7 A schematic diagram of an implementation flow of retrieving an access request from a cache space provided by the present application;
[0050] Figure 8 is another example relationship between the storage unit and the linked list of the cache space in this application;
[0051] Fig. 9 An example diagram of an inherent storage unit having a write request in the second linked list;
[0052] Fig.10 This is an example diagram after removing the inherent storage unit of the write request from the second linked list;
[0053] Fig.11 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0054] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation mode of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0055] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0056] like Figure 1 , showing a flow chart of the access request processing method provided by the present application, the method of this embodiment can be applied to an electronic device having a memory management unit (Memory Manage Unit, MMU), such as, the memory management unit can be any memory management unit in the electronic device, such as, the memory management unit can be a memory management unit of a system on chip (System on Chip, SOC), and can also be a memory management unit of other systems.
[0057] It is understandable that different memory management units in an electronic device can serve different processing units in the electronic device, and the present application does not limit which processing unit the memory management unit serves. For example, the memory management unit can be a memory management unit serving a display unit of an electronic device, which is mainly responsible for caching, address mapping, and address control of access requests related to the display unit; the memory management unit can also be a memory management unit serving an image processing unit, which is mainly responsible for processing access requests related to the image processing unit.
[0058] The access request processing method of this embodiment may include the following steps S101 to S104:
[0059] S101: A memory management unit obtains a first access request to be cached and determines a request type of the first access request.
[0060] The first access request is an access request that requires the memory management unit to perform address mapping and other processing.
[0061] It is understandable that, since the memory management unit needs to process the obtained access requests in sequence, and the memory management unit may have multiple access requests to be processed, the memory management unit needs to cache the obtained access requests. Based on this, it can be known that the first access request is actually an access request obtained by the memory management unit and waiting to be processed.
[0062] For example, the memory management unit may include: a bus interface module and a translation execution module, and the bus interface module and the translation execution module are connected via an internal bus.
[0063] Among them, the bus interface module will be connected to other hardware modules other than the memory management unit in the electronic device through the external bus, so the bus interface module can obtain the access request transmitted by the processing unit (such as an image processing unit or a display unit, etc.). The bus interface module will send the obtained access request to the translation execution module for address mapping and other processing. Correspondingly, after receiving the access request, the translation execution module will first cache the access request, and process each access request in the order in which the access request is received. Based on this, if the translation execution module obtains the first access request transmitted by the bus interface module through the internal bus, it is confirmed that the first access request to be cached is obtained.
[0064] It can be understood that, since the translation execution module is responsible for caching access requests and mapping the addresses of access requests, etc., the access request processing method in the present application can be executed by the translation execution module.
[0065] In the present application, request types may include read requests and write requests. Accordingly, the request type of an access request may be a read request or a write request.
[0066] In the present application, the cache space of the memory management unit includes at least one dynamic storage unit, and the dynamic storage unit in an idle state is classified as a storage unit in the dynamic cache area.
[0067] The cache space is a storage space in the memory management unit for caching access requests. For example, the cache space can be a storage space in the memory management unit for caching access requests waiting to be processed by the translation execution module.
[0068] Different from a storage unit fixedly used to store a certain type of access request, a dynamic storage unit is a storage unit that can be used to store access requests of any request type. Based on this, according to the storage requirements of the access request, the dynamic storage unit can be flexibly used to store read requests or write requests.
[0069] In order to more efficiently determine the dynamic storage units that are currently in an idle state, the present application classifies the dynamic storage units that are in an idle state into a dynamic cache area, so that all the dynamic storage units in the dynamic cache area can be used to store access requests.
[0070] S102: When a first condition is met, determine a target dynamic storage unit in the dynamic cache area for storing a first access request.
[0071] Wherein, when the first condition is met, the dynamic cache area includes at least one dynamic storage unit. Since each dynamic storage unit in the dynamic cache area is in an idle state, if the dynamic cache area includes at least one dynamic storage unit, then the dynamic cache area has a dynamic storage unit that can be used to store the access request. Based on this, the first condition may include: the dynamic cache area includes at least one dynamic storage unit.
[0072] In this application, for the sake of distinction, the dynamic storage unit used to cache the first access request is referred to as the target dynamic storage unit. There are many ways to determine the target dynamic storage unit, such as randomly determining a dynamic storage unit from the dynamic cache area as the target dynamic storage unit; or determining the dynamic storage unit that is earliest assigned to the dynamic cache area as the target dynamic storage unit.
[0073] S103: Store the first access request into the target dynamic storage unit.
[0074] S104: classify the target dynamic storage unit into a storage queue corresponding to the request type of the first access request.
[0075] For example, if the request type of the first access request is a read request, the memory management unit assigns the target dynamic storage unit to the storage queue corresponding to the read request; if the request type of the first access request is a write request, the memory management unit assigns the target dynamic storage unit to the storage queue corresponding to the write request.
[0076] In the present application, each storage unit storing the same type of access request is maintained by a storage queue. The storage queue is a logical relationship formed in sequence by each storage unit storing the same type of access request. Therefore, after the dynamic storage unit is assigned to the storage queue, the position or address of the dynamic storage unit in the cache space will not change, but it is only logically assigned to the storage queue so that the access request can be directly taken out of the storage queue and processed later. Based on this, the storage queue corresponding to the request type of the first access request can include each storage unit that caches the first access request and other access requests of the same request type as the first access request.
[0077] It can be understood that assigning the target dynamic storage unit to the storage queue corresponding to the request type of the first access request is actually to remove the target dynamic storage unit from the dynamic cache area and use it as a storage unit in the storage queue. Accordingly, after assigning the target dynamic storage unit to the storage queue, the target dynamic storage unit can be used to store the first access request of the request type corresponding to the storage queue.
[0078] In the present application, there may be many possibilities for the specific implementation of assigning the target dynamic storage unit to the storage queue, and no limitation is imposed on this.
[0079] For example, in a possible implementation, the memory management unit determines that a storage unit belongs to a storage queue or a dynamic cache area by maintaining the association relationship between different storage units and the storage queue or the dynamic cache area. In this case, the present application can release the association relationship between the target dynamic storage unit and the dynamic cache area, and establish an association relationship between the target dynamic storage unit and the storage queue corresponding to the request type of the first access request.
[0080] In another possible implementation, in order to improve the management flexibility of the storage unit and improve the efficiency of assigning the dynamic storage unit to the storage queue, the present application can also manage the storage queue and the storage units in the dynamic cache area through a linked list. Based on this, for the sake of distinction, the linked list used to manage the storage units in the storage queue is called the first linked list, and the linked list used to manage the storage units in the dynamic cache area (such as at least including the idle dynamic storage units) is called the second linked list.
[0081] Correspondingly, the tail pointer of the first linked list corresponding to the request type of the first access request can be pointed to the target dynamic storage unit, so that the target dynamic storage unit belongs to the storage unit managed by the first linked list, that is, belongs to the storage unit in the storage queue corresponding to the request type of the first access request.
[0082] In addition, in order to avoid the target dynamic storage unit still belonging to the dynamic cache area after storing the access request, which causes storage anomalies in subsequent access requests, after determining the target dynamic storage unit, the present application will also remove the target dynamic storage unit from the second linked list corresponding to the dynamic cache area. For example, the pointer in the second linked list pointing to the target dynamic storage unit is moved to the next dynamic storage unit in the target dynamic storage unit.
[0083] Furthermore, if the storage queue is empty (i.e., does not include any storage unit) before adding the target dynamic storage unit, then the head pointer of the first linked list will point to an empty address. Based on this, after determining the target dynamic storage unit, if the head pointer of the first linked list points to an empty address, the head pointer of the first linked list also needs to be pointed to the target dynamic storage unit.
[0084] It can be understood that after the dynamic storage unit in the dynamic cache area is determined as the target dynamic storage unit for storing an access request, the dynamic storage unit will be moved out of the dynamic cache area and assigned to the storage queue corresponding to the request type of the access request. Therefore, the number of dynamic storage units included in the dynamic cache area will also change dynamically with the number of cached access requests.
[0085] It should be noted that in this application, the order of the above steps S103 and S104 is not limited to Figure 1 As shown, in actual application, step S103 may be performed first and then step S104; or, steps S103 and S104 may be performed synchronously.
[0086] From the above content, it can be seen that the cache space of the memory management unit in the present application includes at least one dynamic storage unit, and the idle dynamic storage unit will be classified into the dynamic cache area. On this basis, after obtaining the first access request to be cached, the memory management unit can store the first access request in the idle target dynamic storage unit in the dynamic cache area, and classify the target dynamic storage unit into the storage queue corresponding to the request type of the first access request, so as to reasonably allocate the storage space corresponding to the different request types according to the number of access requests of different request types to be processed, thereby reducing the situation that the access requests of certain request types cannot be cached and processed in time due to the unreasonable allocation of storage space corresponding to different request types, and realizing more reasonable use of the storage resources of the memory management unit, thereby improving the processing efficiency of the access request.
[0087] In addition, since different memory management units in electronic devices serve different processing units, and the read and write bandwidth requirements of different processing units vary greatly. For example, the read bandwidth of the display unit is larger, while the write bandwidth of the image processing unit is larger. Therefore, if the storage space allocated for read requests and write requests in the memory management unit is the same, then the storage space corresponding to the read request in the memory management unit serving the display unit may be insufficient, while the storage space corresponding to the write request is relatively idle. The solution of the present application can enable the memory management unit serving any processing unit to use its cache space more flexibly to reasonably cache access requests.
[0088] In a possible implementation, in order to prevent a certain type of access request from occupying all of the cache space of the memory management unit, thereby preventing another type of access request from being cached in the memory management unit, the cache space in the present application may also include: at least one inherent storage unit corresponding to each different request type. Among them, the inherent storage unit corresponding to each request type can only be used to store access requests of that type. For example, the inherent storage unit corresponding to a read request can only be used to store a read request, but not a write request.
[0089] On this basis, according to actual needs, the first access request can be stored in an idle inherent storage unit corresponding to its request type, or the access request can be stored in an idle dynamic storage unit.
[0090] To understand the composition of the cache space, see Figure 2 , Figure 2 The diagram shows the implementation framework of obtaining and caching access requests in the memory management unit.
[0091] Depend on Figure 2 It can be seen that the bus interface module uses virtual channel technology to virtualize the internal bus into two virtual channels, one is the virtual channel R corresponding to the read request; the other is the virtual channel W corresponding to the write request, so that the internal bus between the bus interface module and the translation execution module can be time-shared to transmit the read request and the write request in a time-shared manner.
[0092] On this basis, the cache space in the memory management unit is also the cache space of the translation execution module. The storage units in the cache space are not simply divided into at least one storage unit corresponding to a read request and at least one storage unit corresponding to a write request, but are divided into two categories: dynamic storage units and inherent storage units.
[0093] Among them, the inherent storage unit is further divided into inherent storage units corresponding to different request types. Figure 2 A read request corresponds to an inherent storage unit (such as Figure 2 R in the write request, and the write request corresponds to an inherent storage unit (such as Figure 2 For example, the remaining storage units in the cache space are all used as dynamic storage units (such as Figure 2 Medium dynamic F).
[0094] On this basis, after the translation execution module obtains the read request or write request to be cached through the internal bus, the read request or write request can be stored in an idle dynamic storage unit or a corresponding inherent storage unit.
[0095] The following is an example of an implementation method. Figure 3 , shows another flow chart of the access request processing method provided by the present application. The method of this embodiment can be applied to the electronic device mentioned above. The method of this embodiment may include:
[0096] S301: A memory management unit obtains a first access request to be cached, and determines a request type of the first access request.
[0097] In this embodiment, the cache space of the memory management unit includes: at least one dynamic storage unit and at least one inherent storage unit corresponding to different request types, wherein the dynamic storage unit in an idle state is classified into the dynamic cache area.
[0098] The dynamic cache area is a logical storage area including dynamic storage units in an idle state. Since the dynamic storage units included in the dynamic cache area may also change dynamically, the addresses corresponding to the dynamic storage units included in the dynamic cache area may not be continuous.
[0099] S302: When a first condition is met, determine a target dynamic storage unit in the dynamic cache area for storing a first access request.
[0100] When the first condition is met, the dynamic cache area includes at least one dynamic storage unit.
[0101] For example, the first condition may be that the storage priority of the dynamic storage unit at the current moment is higher than the storage priority of the inherent storage unit (also referred to as the storage priority of the inherent storage unit corresponding to the request type of the first access request), and the dynamic cache area includes at least one dynamic storage unit.
[0102] There are many ways to determine the storage priority of the dynamic storage unit and the storage priority of the inherent storage unit at the current moment, and there is no limitation to this.
[0103] For example, in one possible case, when the access request is preferentially cached in the dynamic storage unit, if there is at least one dynamic storage unit in the dynamic cache area, it is determined that the storage priority of the dynamic storage unit at the current moment is higher than the storage priority of the inherent storage unit; conversely, if there is no dynamic storage unit in the dynamic cache area, it is determined that the storage priority of the inherent storage unit at the current moment is higher than the storage priority of the dynamic storage unit. Accordingly, the first condition may be that the dynamic cache area includes at least one dynamic storage unit.
[0104] In another possible situation, in order to avoid the inherent storage unit corresponding to a certain request type being idle, the dynamic storage unit and the inherent storage unit corresponding to another request type both store access requests, which results in the access requests of the other request type being unable to be cached in the cache space, the present application may give priority to storing the access requests of the corresponding type in the inherent storage unit. On this basis, the priority may be determined in the following manner:
[0105] If there is an inherent storage unit that corresponds to the request type of the first access request and is in an idle state, it is determined that the storage priority of the inherent storage unit at the current moment is higher than the storage priority of the dynamic storage unit; conversely, if there is no inherent storage unit that corresponds to the request type of the first access request and is in an idle state, it is determined that the storage priority of the inherent storage unit at the current moment is lower than the storage priority of the dynamic storage unit.
[0106] Correspondingly, the first condition is specifically that there is no inherent storage unit corresponding to the request type of the first access request and in an idle state, and there is at least one dynamic storage unit in the dynamic cache area.
[0107] In another possible situation, the storage priority of the dynamic storage unit and the storage priority of the inherent storage unit at the current moment can be determined by combining the data storage status of each dynamic storage unit in the cache space and at least one of the data storage statuses of the inherent storage unit corresponding to the request type of the first access request.
[0108] For example, if the number of dynamic storage units in the dynamic cache area (that is, the dynamic cache area in an idle state) exceeds a set number, or the proportion of the dynamic storage units in the dynamic cache area to all dynamic storage units in the cache space exceeds a set threshold, it is determined that the storage priority of the dynamic storage unit at the current moment is higher than the storage priority of the inherent storage unit.
[0109] For another example, if the number of inherent storage units corresponding to the request type of the first access request and in an idle state is not less than a set number, it is determined that the storage priority of the dynamic storage unit at the current moment is lower than the storage priority of the inherent storage unit.
[0110] Of course, there may be other ways to determine the storage priority of the dynamic storage unit and the storage priority of the inherent storage unit, and there is no limitation to this.
[0111] S303: Store the first access request into the target dynamic storage unit.
[0112] S304: assigning the target dynamic storage unit to a storage queue corresponding to the request type of the first access request.
[0113] For the above steps 303 and S304, reference may be made to the related introduction of the previous embodiment, which will not be described again here.
[0114] S305 , when the second condition is met, determine a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit that corresponds to the request type of the first access request and is in an idle state.
[0115] In the case of the second condition, among the inherent storage units corresponding to the request type of the first access request, there is at least one inherent storage unit in an idle state.
[0116] For example, the second condition may be that the storage priority of the inherent storage unit is higher than the storage priority of the dynamic storage unit at the current moment. The specific implementation of determining whether the storage priority of the inherent storage unit is higher than the storage priority of the dynamic storage unit at the current moment can refer to the relevant introduction of the above step S303.
[0117] For example, corresponding to the above-mentioned method of determining storage priority, in the case of caching access requests in the dynamic storage unit first, the second condition may be that there is no idle dynamic storage unit in the dynamic cache area, and there is at least one idle intrinsic storage unit corresponding to the request type of the first access request. For another example, in the case of caching access requests in the intrinsic storage units corresponding to each request type first, the second condition may be that there is an idle intrinsic storage unit in at least one intrinsic storage unit corresponding to the request type of the first access request.
[0118] S306: Store the first access request into the target inherent storage unit.
[0119] S307: Classify the target intrinsic storage unit into a storage queue corresponding to the request type of the first access request.
[0120] The specific implementation of assigning the target inherent storage unit to the storage queue may be similar to the specific implementation of assigning the target dynamic storage unit to the storage queue.
[0121] For example, the memory management unit may release the association relationship between the target inherent storage unit and the dynamic cache area, and establish an association relationship between the target inherent storage unit and a storage queue corresponding to the request type of the first access request.
[0122] For another example, in order to improve the management flexibility of the storage unit, the tail pointer of the first linked list is pointed to the target inherent storage unit. As mentioned above, the first linked list is used to manage each storage unit in the storage queue corresponding to the request type of the first access request.
[0123] Furthermore, if the storage queue is empty (i.e., does not include any storage unit) before adding the target dynamic storage unit, then the head pointer of the first linked list will point to an empty address. Based on this, after determining the target inherent storage unit, if the head pointer of the first linked list points to an empty address, the head pointer of the first linked list also needs to be pointed to the target inherent storage unit.
[0124] For ease of understanding, an implementation method of caching the first access request is taken as an example for description below. Figure 4 Another flow chart of the access request processing method provided by the embodiment of the present application is shown. The method of this embodiment may include:
[0125] S401: A memory management unit obtains a first access request to be cached, and determines a request type of the first access request.
[0126] The cache space of the memory management unit includes: at least one dynamic storage unit and at least one inherent storage unit corresponding to different request types, wherein the dynamic storage unit in an idle state is classified into the dynamic cache area.
[0127] S402: If there is at least one inherent storage unit corresponding to the request type of the first access request and in an idle state, determine a target inherent storage unit for caching the first access request from the at least one inherent storage unit.
[0128] It can be understood that if there are multiple inherent storage units in the idle state among the inherent storage units corresponding to the request type of the first access request, then an inherent storage unit in the idle state can be randomly determined as the target inherent storage unit; or the inherent storage unit with the frontmost corresponding address can be determined as the target inherent storage unit.
[0129] Of course, there are other ways to determine the target intrinsic storage unit, and there is no limitation to this.
[0130] It can be understood that this embodiment is described by taking the second condition that there is at least one inherent storage unit corresponding to the request type of the first access request and in an idle state as an example, but the second condition can be other situations and is also applicable to this embodiment.
[0131] S403: Store the first access request into the target inherent storage unit.
[0132] S404: Point the tail pointer of the first linked list corresponding to the request type of the first access request to the target intrinsic storage unit.
[0133] The first linked list is used to manage the storage units in the storage queue corresponding to the request type of the first access request. Therefore, the storage units pointed to by the pointers in the first linked list are all storage units in the storage queue corresponding to the request type of the first access request.
[0134] It is understandable that, in the initial state, the storage queue corresponding to the request type of the first access request is empty, therefore, the head pointer and the tail pointer of the first linked list both point to an empty address, on this basis, after determining the target intrinsic storage unit that needs to be used to store the first access request, if the head pointer of the first linked list points to an empty address, the head pointer of the first linked list also needs to be pointed to the target intrinsic storage unit. If other storage units already exist in the storage queue before the target intrinsic storage unit is added to the storage queue, then the head pointer of the first linked list will point to the storage unit that was added to the storage queue the earliest, on this basis, it is only necessary to change the tail pointer of the first linked list to point the tail pointer to the target intrinsic storage unit.
[0135] Combination Figure 5 To explain:
[0136] Figure 5 An example relationship between a storage unit and a linked list is shown. Figure 5 The cache space of the memory management unit in the memory management unit includes multiple storage units, such as Figure 5 Each vertical cell in represents a storage unit. For ease of understanding, Figure 5 The R inherent storage unit corresponding to the read request ( Figure 5 The storage unit marked with "intrinsic R" in the middle), and the W intrinsic storage unit corresponding to the write request ( Figure 5 The storage unit marked with "intrinsic W" is taken as an example, and the other storage units in the cache space are all used as dynamic storage units, such as Figure 5 Each storage unit labeled with "dynamic F1", "dynamic F2" to "dynamic F5" is a dynamic storage unit.
[0137] For ease of description, the first access request is taken as a read request as an example. In the initial state, each storage unit in the cache space is empty. Correspondingly, the storage queue corresponding to the read request is also empty, so the head pointer and tail pointer of the first linked list both point to empty addresses. In this case, the read request can be stored in the R inherent storage unit corresponding to the read request, and at the same time, the head pointer Head-R and the tail pointer Tail-R of the first linked list are both pointed to the R inherent storage unit. On this basis, based on the first linked list, it can be determined that only the R inherent storage unit stores the read request.
[0138] It is understandable that in Figure 5 On this basis, if it is assumed that there are multiple inherent storage units corresponding to the read request, then after the next read request is obtained, the read request can be stored in an idle inherent storage unit corresponding to the read request, and then the tail pointer Tail-R of the first linked list only needs to point to the inherent storage unit that stored the read request most recently.
[0139] Of course, if other read requests have been cached in the cache space before the read request is obtained, such as other read requests are stored in a dynamic storage unit or an inherent storage unit corresponding to the read request, then the head pointer of the first linked list has already pointed to a storage unit where the read request is stored. On this basis, it is only necessary to point the tail pointer of the first linked list to the target inherent storage unit that stores the currently received read request.
[0140] Understandably, Figure 5 Each dynamic storage unit in the dynamic buffer is empty, so each dynamic storage unit belongs to the dynamic buffer area. Correspondingly, the pointer in the second linked list corresponding to the dynamic buffer area can point to each dynamic storage unit. Figure 5 In the subsequent figures, the linked list corresponding to the solid line represents the first linked list, and the linked list corresponding to the dotted line represents the second linked list. Figure 5 It can be seen that the second linked list points to each dynamic storage unit in sequence.
[0141] S405: If all inherent storage units corresponding to the request type of the first access request are not in an idle state, determine the dynamic storage unit pointed to by the head pointer of the second linked list corresponding to the dynamic cache area as the target dynamic storage unit.
[0142] It should be noted that this embodiment takes the first condition that all inherent storage units corresponding to the request type of the first access request are not in an idle state as an example for explanation, but the first condition is other situations, which are also applicable to this embodiment.
[0143] S406: Store the first access request into the target dynamic storage unit.
[0144] S407, point the tail pointer of the first linked list to the target dynamic storage unit.
[0145] The first linked list is used to manage each storage unit in the storage queue corresponding to the request type of the first access request.
[0146] It can be understood that, for each inherent storage unit corresponding to the request type of the first access request, if each inherent storage unit is not in an idle state, it means that each inherent storage unit has stored an access request of the corresponding type and has been assigned to the storage queue corresponding to the request type, that is, it has been added to the first linked list. Therefore, the head pointer and the tail pointer of the first linked list both point to the real storage unit.
[0147] On this basis, in order to assign the target dynamic storage unit to the storage queue corresponding to the request type, the tail pointer of the first linked list can be directly pointed to the target dynamic storage unit, so that the target dynamic storage unit becomes the last node in the first linked list.
[0148] S408, pointing the head pointer of the second linked list to the next dynamic storage unit after the target dynamic storage unit.
[0149] The next storage unit after the dynamic storage unit is the next dynamic storage unit after the target storage unit in the second linked list, that is, the dynamic storage unit pointed to by the pointer of the target dynamic storage unit. After the head pointer of the second linked list points to the next dynamic storage unit, the target dynamic storage unit no longer belongs to the dynamic storage unit in the second linked list, and the pointing relationship between the target dynamic storage unit and the next dynamic storage unit will also be eliminated.
[0150] For ease of understanding, combined Figure 5 and Figure 6 For example:
[0151] Assume that Figure 5 Based on the above, a new read request is obtained. Since an R inherent storage unit corresponding to the read request has already stored the read request, the read request can be stored in the dynamic storage unit F1 pointed to by the head pointer Head-F of the second linked list in the dynamic cache area ( Figure 5 The tail pointer of the first linked list points to the dynamic storage unit F1, so that the dynamic storage unit F1 is used as the storage unit in the storage queue corresponding to the read request. At the same time, the head pointer Head-F of the second linked list in the dynamic cache area needs to point to the next dynamic storage unit F2 pointed to by the dynamic storage unit F1 ( Figure 5 and Figure 6The storage unit marked with dynamic F2 in the figure), while the tail pointer Tail-F of the second linked list remains unchanged, so we can get Figure 6 An example diagram of the chain diagram is shown.
[0152] contrast Figure 5 and Figure 6 It can be seen that when the dynamic storage unit F1 is added to the first linked list, the dynamic storage unit is removed from the second linked list, so that the dynamic storage unit F1 becomes the R dynamic storage unit storing the read request (such as Figure 6 The memory cells are marked with a dynamic R).
[0153] It is understandable that, in any of the above embodiments, after the access request is stored in the storage unit of the cache space, when the memory management unit needs to process the access request, the access request can also be retrieved from the storage unit of the cache space. For example, when the translation execution module in the memory management unit needs to perform address mapping and other processing on the read request or the write request, the read request or the write request can be retrieved from the storage queue corresponding to the read request or the write request.
[0154] For example, the memory management unit determines the request type of the access request to be retrieved by the data retrieval instruction in response to the data retrieval instruction, and then retrieves the first stored second access request from the storage queue corresponding to the request type to which the access request to be retrieved belongs.
[0155] The data acquisition instruction may be issued by a processing unit served by the memory management unit, or may be generated by a translation execution module in the memory management unit triggered by the processing unit, and there is no limitation on this.
[0156] Among them, the request type of the access request to be retrieved by the data acquisition instruction can be a read request or a write request. Accordingly, the storage queue corresponding to the request type can be the storage queue where the storage units storing the read requests are located, or the storage queue where the storage units storing the write requests are located.
[0157] The second access request that is stored first refers to the access request that is first added to the storage unit of the storage queue.
[0158] In the present application, there are many possibilities for the specific implementation of determining the second access request stored first in the storage queue, and there is no limitation to this.
[0159] In particular, when using the first linked list to manage each storage unit in the storage queue, the present application can determine the target storage unit pointed to by the head pointer in the first linked list corresponding to the request type to which the access request to be retrieved belongs, and retrieve the second access request stored in the target storage unit.
[0160] The first linked list corresponding to the request type to which the access request to be retrieved belongs is used to manage each storage unit in the storage queue corresponding to the request type of the access request to be retrieved.
[0161] It is understandable that assigning a dynamic storage unit or an inherent storage unit to the storage queue may also mean inserting the dynamic storage unit or the inherent storage unit into the front end of the storage queue. In this case, if the storage queue is managed by a first linked list, the head pointer of the first linked list may point to the dynamic storage unit or the inherent storage unit that needs to be assigned to the storage queue. Accordingly, when it is necessary to retrieve the second access request first stored in the storage queue, the second access request in the target storage unit pointed to by the tail pointer of the first linked list may be retrieved.
[0162] Of course, there may be other possible ways to manage the storage queue through the first linked list. Correspondingly, there may be other possibilities to determine the target storage unit based on the first linked list, which are not limited.
[0163] It is understandable that after the second access request is taken out from the storage unit of the storage queue, the storage unit returns to an idle state, and therefore, the storage unit needs to be removed from the first linked list corresponding to the storage queue.
[0164] Furthermore, if the storage unit is a dynamic storage unit, it is also necessary to classify the dynamic storage unit as a storage unit in the dynamic cache area.
[0165] In order to facilitate the understanding of the implementation process of taking out the cache access request from the cache space, the following is combined with Figure 7 In order to distinguish the request type of the first access request from the request type of the first access request, the request type of the first access request may be referred to as the first request type, and the request type to which the access request to be retrieved belongs may be referred to as the second request type.
[0166] like Figure 7 , shows a schematic diagram of an implementation flow of taking out an access request from a cache space in the access request processing method of the present application. This embodiment may include:
[0167] S701 , in response to a data acquisition instruction, determining a second request type to which an access request to be retrieved by the data acquisition instruction belongs.
[0168] S702: Determine the target storage unit pointed to by the head pointer in the first linked list corresponding to the second request type.
[0169] The first linked list corresponding to the second request type is used to manage each storage unit in the storage queue corresponding to the second request type.
[0170] It is understandable that in the present application, the linked lists corresponding to the storage queues of the storage access requests are all referred to as first linked lists, therefore, if the second request type is the same as the first request type of the first access request obtained previously, then the first linked list corresponding to the second request type is also the first linked list corresponding to the first request type of the first access request previously obtained. Of course, if the second request type is different from the first request type, then the storage queues and first linked lists corresponding to the two request types are different.
[0171] S703: Retrieve the second access request stored in the target storage unit.
[0172] For ease of distinction, the present application refers to the access request cached in the target storage unit as a second access request.
[0173] S704: If the target storage unit is an inherent storage unit corresponding to the second request type, point the head pointer of the first linked list corresponding to the second request type to the next storage unit in the first linked list that is located after the target storage unit.
[0174] In the present application, if the target storage unit is an inherent storage unit, since the inherent storage unit is independent of the dynamic cache area, it is only necessary to point the head pointer of the first linked list corresponding to the second request type to the next storage unit pointed to by the target storage unit to remove the target storage unit from the first linked list.
[0175] For ease of understanding, the second request type is taken as the read request type, and combined with Figure 6 Provide explanation.
[0176] Depend on Figure 6 It can be seen that: in the first linked list corresponding to the read request, the head pointer Head-R of the first linked list points to the R inherent storage unit of the read request. Therefore, to use the R inherent storage unit as the target storage unit, it is necessary to take out the read request cached in the R inherent storage unit. At the same time, since the first linked list corresponding to the read request is only used to maintain the storage units storing the read requests, after determining the R inherent storage unit as the target storage unit or taking out the read request cached in the R inherent storage unit, the head pointer Head-R of the first linked list corresponding to the read request can also be pointed to the next storage unit in the first linked list located at the R inherent storage unit, that is, the head pointer Head-R is pointed to the R dynamic storage unit (the storage unit marked with dynamic R), and the result is Figure 8 An example diagram of the chain diagram is shown.
[0177] contrast Figure 6 and Figure 8It can be seen that after the read request in the R inherent storage unit is taken out, the head pointer Head-R and the tail pointer Tail-R of the first linked list both point to the R dynamic storage unit, and the number of storage units in the first linked list decreases.
[0178] It is understandable that the order of steps S703 and S704 is not limited to Figure 7 As shown, in practical applications, the order of these two steps can be interchanged or performed simultaneously, without limitation.
[0179] S705, if the target storage unit is a dynamic storage unit, point the tail pointer of the second linked list corresponding to the dynamic cache area to the target storage unit, and point the head pointer of the first linked list corresponding to the second request type to the storage unit in the first linked list that is located after the target storage unit.
[0180] In the present application, all idle dynamic storage units need to be assigned to the dynamic cache area. Therefore, if the target storage unit belongs to the dynamic storage unit, after removing the dynamic storage unit from the first linked list corresponding to the second request type, the tail pointer of the second linked list of the dynamic cache area needs to be pointed to the target storage unit, so that the target storage unit becomes the last storage unit in the second linked list of the dynamic cache area, so that the target storage unit can continue to be used to store access requests in the future.
[0181] In the above embodiments of the present application, there are multiple possibilities for determining the inherent storage unit that corresponds to the request type of the first access request and is in an idle state.
[0182] For example, in the first possible implementation, since the inherent storage unit of each request type is fixed, that is, the address of the inherent storage unit corresponding to each request type is fixed, it is possible to maintain the status flags corresponding to different inherent storage units, such as storing the address of the inherent storage unit corresponding to each request type in association with its status flag. The status flag is used to indicate whether the inherent storage unit is in an idle state. On this basis, the present application can query the status flag of the inherent storage unit corresponding to the request type of the first access request, determine whether there is an inherent storage unit in an idle state, and determine the inherent storage unit whose status flag indicates that it is in an idle state.
[0183] In a second possible implementation, the present application may also classify the inherent storage units in an idle state into the dynamic cache area, so that all the storage units in an idle state in the cache space are maintained through the dynamic cache area. Therefore, the dynamic cache area may also include: inherent storage units in an idle state corresponding to different request types.
[0184] The inherent storage unit in the idle state is assigned to the dynamic cache area in the same manner as the above-mentioned inherent storage unit in the idle state is assigned to the dynamic cache area. For example, the inherent storage unit is loaded to the tail of the second linked list. Specifically, the tail pointer of the second linked list can point to the inherent storage unit, so that the inherent storage unit belongs to the storage unit in the second linked list of the dynamic cache area.
[0185] Of course, after the inherent storage unit is added to the tail of the second linked list, if other inherent storage units or dynamic storage units in an idle state are subsequently added to the dynamic cache area, then the newly added inherent storage unit or dynamic storage unit will be located at the tail of the second linked list, and the inherent storage unit previously added to the second linked list will be located in the middle of the second linked list.
[0186] On this basis, the present application can determine the target inherent storage unit that is the frontmost in the second linked list corresponding to the dynamic cache area and corresponds to the request type of the first access request, thereby obtaining the target inherent storage unit for storing the first access request.
[0187] Accordingly, after determining the target intrinsic storage unit or storing the first access request in the target intrinsic storage unit, the present application may also remove the target intrinsic storage unit from the second linked list, such as pointing the pointer in the second linked list to the target intrinsic storage unit to the next storage unit in the second linked list after the target intrinsic storage unit.
[0188] Combination Fig. 9 and Fig.10 illustrate. Fig. 9 An example diagram showing an inherent storage unit with a write request in the second linked list, Fig.10 This is an example diagram after removing the inherent storage unit of the write request from the second linked list.
[0189] exist Fig. 9 and Fig.10 Each cell in represents a storage unit.
[0190] exist Fig. 9 The second linked list includes four free storage units, among which the W inherent storage unit (the storage unit marked with "inherent W") corresponding to the write request is the third node in the second linked list. In the second linked list, the previous storage unit of the W inherent storage unit is storage unit 11, and the next storage unit of the W inherent storage unit is storage unit 12.
[0191] exist Fig. 9On the basis of , if it is necessary to determine the W inherent storage unit as the target inherent storage unit for storing the write request or the write request has been stored in the W inherent storage unit, it is necessary to point the pointer pointing to the W inherent storage unit in the second linked list to the next storage unit after the W inherent storage unit, that is, point the pointer of storage unit 11 to storage unit 12. Accordingly, the second linked list without the W inherent storage unit can be as follows Fig.10 shown.
[0192] In the second possible implementation, the dynamic cache is used to manage the idle inherent storage units, thereby eliminating the need to separately maintain the status flags of the inherent storage units.
[0193] Further, on the basis of the second possible implementation method, in response to obtaining a data acquisition request, after determining the target storage unit from the first linked list corresponding to the second request type to which the access request to be retrieved belongs, if the target storage unit belongs to the inherent storage unit corresponding to the request type of the second access request, in addition to pointing the head pointer of the first linked list to the next storage unit after the target storage unit in the first linked list, the present application also needs to point the tail pointer in the second linked list corresponding to the dynamic cache area to the target storage unit.
[0194] In another aspect, the present application also provides an electronic device. Fig.11 , showing a schematic diagram of the composition structure of an electronic device provided in an embodiment of the present application, the electronic device 11 at least includes: a memory management unit 110, a cache space 111 of the memory management unit includes at least one dynamic storage unit 112, and the dynamic storage unit in an idle state is classified as a storage unit in the dynamic cache area.
[0195] Among them, the memory management unit 110 is used to obtain a first access request to be cached, determine a first request type of the first access request; when a first condition is met, determine a target dynamic storage unit in the dynamic cache area for storing the first access request, when the first condition is met, the dynamic cache area includes at least one dynamic storage unit; store the first access request in the target dynamic storage unit; and assign the target dynamic storage unit to a storage queue corresponding to the first request type.
[0196] For example, the memory management unit may include a bus interface module and a translation execution module, and a bus connection is provided between the bus interface module and the translation execution module. Accordingly, the translation execution module has the cache space. On this basis, the memory management unit obtains the first access request to be cached, and can obtain the first access request transmitted by the bus interface module for the translation execution module.
[0197] It is understandable that the electronic device may further include a processing unit that is in communication with the memory management unit. The processing unit may be any hardware unit that needs to perform address conversion on access requests with the help of the memory management unit, such as an image processing unit or a display unit.
[0198] Correspondingly, the processing unit transmits the first access request to be processed to the memory management unit (such as the bus interface module in the memory management unit), and the memory management unit confirms that there is a first access request to be cached.
[0199] Of course, the electronic device may also include components such as an input unit and a communication module, and there is no limitation to this.
[0200] In one possible implementation, Figure 1 It can be seen that the cache space also includes: at least one inherent storage unit 113 corresponding to each of the different request types;
[0201] Correspondingly, the memory management unit is also used to, when the second condition is met, determine a target inherent storage unit for storing the first access request from at least one inherent storage unit that corresponds to the request type of the first access request and is in an idle state; store the first access request in the target inherent storage unit; and assign the target inherent storage unit to a storage queue corresponding to the request type of the first access request.
[0202] In another possible implementation, when the memory management unit assigns the target inherent storage unit to the storage queue corresponding to the request type of the first access request, it is specifically used to point the tail pointer of the first linked list to the target inherent storage unit, and the first linked list is used to manage each storage unit in the storage queue corresponding to the request type of the first access request.
[0203] In another possible implementation, the memory management unit is further used to, after determining the target inherent storage unit for storing the first access request, if the head pointer of the first linked list points to an empty address, point the head pointer of the first linked list to the target inherent storage unit.
[0204] In yet another possible implementation, the dynamic cache area further includes: inherent storage units corresponding to different request types and in an idle state;
[0205] Accordingly, when determining the target inherent storage unit for storing the first access request, the memory management unit is specifically used to determine the target inherent storage unit that is at the front of the second linked list corresponding to the dynamic cache area and corresponds to the request type of the first access request, and obtain the target inherent storage unit for storing the first access request;
[0206] The memory management unit is further used to, after determining the target inherent storage unit for storing the first access request, remove the target inherent storage unit from the second linked list.
[0207] In another possible implementation, the memory management unit is further used to: determine, in response to a data acquisition instruction, a request type to which an access request to be retrieved by the data acquisition instruction belongs; and retrieve a second access request that is stored first from a storage queue corresponding to the request type to which the access request to be retrieved belongs.
[0208] A computer program product is also provided in an embodiment of the present application, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any access request processing method provided in the embodiment of the present application.
[0209] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any access request processing method provided in an embodiment of the present application.
[0210] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0211] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0212] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0213] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for processing an access request, the method being applied to a memory management unit, the memory management unit comprising: The bus interface module and the translation execution module are connected via an internal bus. The bus interface module uses virtual channel technology to virtualize the internal bus into two virtual channels, one of which is a virtual channel R corresponding to a read request. Another virtual channel W corresponding to a write request, a read request and a write request time-sharing multiplex the internal bus to transmit the read request and the write request in time-sharing, the method comprising: The memory management unit obtains a first access request to be cached, determines a request type of the first access request, the cache space of the memory management unit includes at least one dynamic storage unit, and the dynamic storage unit in an idle state is classified as a storage unit in the dynamic cache area, and the request type includes a read request and a write request; In the case where a first condition is met, determining a target dynamic storage unit in the dynamic cache area for storing the first access request, and in the case where the first condition is met, the dynamic cache area includes at least one dynamic storage unit; storing the first access request in the target dynamic storage unit; assigning the target dynamic storage unit to a storage queue corresponding to the request type of the first access request; Wherein, the cache space also includes: at least one inherent storage unit corresponding to each of different request types; The access request processing method further includes: In the case where the second condition is met, determining a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit corresponding to the request type of the first access request and in an idle state; storing the first access request in the target inherent storage unit; The target inherent storage unit is assigned to a storage queue corresponding to the request type of the first access request.
2. The access request processing method according to claim 1, wherein the step of assigning the target intrinsic storage unit to a storage queue corresponding to a request type of the first access request comprises: The tail pointer of the first linked list is pointed to the target inherent storage unit, and the first linked list is used to manage each storage unit in the storage queue corresponding to the request type of the first access request.
3. The access request processing method according to claim 2, after determining the target intrinsic storage unit for storing the first access request, further comprising: If the head pointer of the first linked list points to a null address, the head pointer of the first linked list is pointed to the target inherent storage unit.
4. The access request processing method according to claim 2 or 3, wherein the dynamic cache area further comprises: Inherent storage units corresponding to different request types and in an idle state; The step of determining a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit that corresponds to the request type of the first access request and is in an idle state comprises: Determine the target inherent storage unit that is the frontmost in the second linked list corresponding to the dynamic cache area and corresponds to the request type of the first access request, and obtain the target inherent storage unit for storing the first access request; After determining a target intrinsic storage unit for storing the first access request, the method further includes: The target inherent storage unit is removed from the second linked list.
5. The access request processing method according to claim 1, wherein the step of assigning the target dynamic storage unit to a storage queue corresponding to a request type of the first access request comprises: Pointing a tail pointer of a first linked list to the target dynamic storage unit, wherein the first linked list is used to manage each storage unit in a storage queue corresponding to the request type of the first access request; The target dynamic storage unit is removed from the second linked list corresponding to the dynamic cache area.
6. The access request processing method according to claim 5, wherein the step of determining a target dynamic storage unit in the dynamic cache area for storing the first access request comprises: Determine the dynamic storage unit pointed to by the head pointer of the second linked list corresponding to the dynamic cache area as the target dynamic storage unit for storing the first access request; The removing the target dynamic storage unit from the second linked list corresponding to the dynamic cache area comprises: The head pointer of the second linked list is pointed to the next dynamic storage unit after the target dynamic storage unit.
7. The access request processing method according to claim 1, further comprising: In response to a data acquisition instruction, determining a request type to which an access request to be retrieved by the data acquisition instruction belongs; The first stored second access request is retrieved from the storage queue corresponding to the request type to which the access request to be retrieved belongs.
8. The access request processing method according to claim 7, wherein the cache space further comprises: At least one inherent storage unit corresponding to each of different request types; The taking out the first stored second access request from the storage queue corresponding to the request type to which the access request to be taken out belongs comprises: Determine a target storage unit pointed to by a head pointer in a first linked list corresponding to a request type to which the access request to be retrieved belongs, wherein the first linked list is used to manage each storage unit in a storage queue corresponding to the request type of the access request to be retrieved; Retrieving a second access request stored in the target storage unit; After determining the target storage unit, the method further includes: If the target storage unit belongs to the inherent storage unit corresponding to the request type of the second access request, point the head pointer of the first linked list to the next storage unit in the first linked list that is located after the target storage unit; If the target storage unit belongs to a dynamic storage unit, the tail pointer of the second linked list corresponding to the dynamic cache area is pointed to the target storage unit, and the head pointer of the first linked list is pointed to the next storage unit in the first linked list after the target storage unit.
9. An electronic device, comprising: A memory management unit, wherein the cache space of the memory management unit includes at least one dynamic storage unit, and the dynamic storage unit in an idle state is classified as a storage unit in the dynamic cache area; The memory management unit comprises: a bus interface module and a translation execution module, the bus interface module and the translation execution module are connected via an internal bus, the bus interface module virtualizes the internal bus into two virtual channels using virtual channel technology, one is a virtual channel R corresponding to a read request; the other is a virtual channel W corresponding to a write request, the read request and the write request time-share multiplex the internal bus to transmit the read request and the write request in a time-shared manner; The memory management unit is used to obtain a first access request to be cached, determine a first request type of the first access request, the request type including a read request and a write request; when a first condition is met, determine a target dynamic storage unit in the dynamic cache area for storing the first access request, when the first condition is met, the dynamic cache area includes at least one dynamic storage unit; store the first access request in the target dynamic storage unit; and assign the target dynamic storage unit to a storage queue corresponding to the first request type; Wherein, the cache space also includes: at least one inherent storage unit corresponding to each of different request types; The memory management unit is also used for: In the case where the second condition is met, determining a target intrinsic storage unit for storing the first access request from at least one intrinsic storage unit corresponding to the request type of the first access request and in an idle state; storing the first access request in the target inherent storage unit; The target inherent storage unit is assigned to a storage queue corresponding to the request type of the first access request.
Citation Information
Patent Citations
Traffic management system and method, chip, and computer-readable storage medium
WO2024222965A1