WO2018201967A1 - Storage processing method and apparatus - Google Patents

Storage processing method and apparatus Download PDF

Info

Publication number
WO2018201967A1
WO2018201967A1 PCT/CN2018/084651 CN2018084651W WO2018201967A1 WO 2018201967 A1 WO2018201967 A1 WO 2018201967A1 CN 2018084651 W CN2018084651 W CN 2018084651W WO 2018201967 A1 WO2018201967 A1 WO 2018201967A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory access
access request
target data
cache
request
Prior art date
Application number
PCT/CN2018/084651
Other languages
French (fr)
Chinese (zh)
Inventor
信恒超
曾红义
夏晶
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018201967A1 publication Critical patent/WO2018201967A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a storage processing method and apparatus.
  • Cache also known as cache
  • processor and memory
  • Memory memory
  • the Cache structure can cache data in the memory in the Cache, and accelerate the process of acquiring data by the multi-core.
  • the data cached in the cache can have two backup states, namely, a shared state (Shared state, referred to as S state) and an exclusive state (Exclusive state, referred to as an E state). If the backup status of a data is Shared, it means that the data may be backed up in multiple caches. If the backup status of a data is Exclusive, it means that the data is only backed up in a certain cache. How to store the data in the shared state or the data in the exclusive state in the cache becomes a hot issue of research.
  • the embodiment of the present application provides a storage processing method and device, which can perform targeted processing on data according to different backup states of data.
  • an embodiment of the present application provides a storage processing method, including: when receiving a memory access request, first detecting a request type of the memory access request, and detecting target data requested by the memory access request a backup state, the request type of the memory access request includes a data request and an instruction request, and the backup state of the target data includes an exclusive state and a shared state; and then performing corresponding response processing on the memory access request according to the detection result, and if the When the memory access request is an instruction request, and the backup state of the target data is detected as an exclusive state, the response processing is performed on the memory access request according to the indication of the first processing policy; if the memory access request is detected as an instruction request, and Detecting that the backup state of the target data is a shared state, performing a response process on the memory access request according to the indication of the second processing policy; wherein the response processing mode indicated by the first processing policy and the response indicated by the second processing policy Different treatment methods.
  • the data can be processed in a targeted manner
  • the response to the memory access request is performed according to the indication of the third processing policy. Processing, so that different processing strategies are adopted for different types of memory access requests, which can save the software and hardware resources of the terminal to a certain extent and improve storage efficiency.
  • the response processing manner indicated by the first processing policy may include: first creating a first directory entry corresponding to the target data according to the memory access request, where the first directory entry records the target The cache identifier of the Cache of the data and the backup state of the target data; and then performing response processing on the target data according to the detected type of the memory access request and the backup state of the target data.
  • the response processing includes reading, writing, modifying, and protocol-defined handshake actions.
  • the response processing manner indicated by the first processing policy may further include: performing broadcast monitoring on the managed Cache according to the identifier of the target data, and receiving a Detect that each Cache returns for the broadcast interception.
  • the identifier of the target data may be a physical memory address of the target data; and then obtaining a first set according to the received listening response, the first set including one or more cache identifiers of the cache storing the target data,
  • the cache identifier may be an address of the cache; if the cache identifier that is not included in the first directory entry is found in the first set, the target data is reclaimed but the cache identifier is not included in the first directory entry.
  • the memory access request is detected as an instruction request, and the backup state of the target data requested by the memory access request is detected as a shared state, the memory access request is directly obtained according to the detection.
  • the type and the backup status of the target data perform response processing on the target data requested by the memory access request, and the response processing includes a reading and a handshake action specified by the protocol.
  • the response processing manner indicated by the third processing policy may include: first creating a second directory entry corresponding to the target data according to the memory access request, where the second directory entry records the target The cache identifier of the Cache of the data and the backup state of the target data; and then performing response processing on the target data according to the detected type of the memory access request and the backup state of the target data.
  • the response processing includes reading, writing, modifying, and protocol-defined handshake actions.
  • the method before detecting the request type of the memory access request, the method further includes: first receiving a memory access request, where the memory access request is sent by the central processing unit, carrying the request type identifier, and then detecting Whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory, where the third directory entry records the cache identifier of the cache storing the target data and the backup status of the target data; If not, determining the miss data, and performing the step of detecting the request type of the memory access request; if the detection result is included, determining the hit data, and obtaining the second set according to the target data, the second set includes a second set Or a cache identifier of the cache that stores the target data; if the cache identifier that is not included in the third directory entry is found in the second set, the third directory entry is updated.
  • the update process includes adding an entry in the third directory entry that corresponds to a cache identifier in the second set that is not included in the third directory entry.
  • an embodiment of the present application provides a storage processing apparatus, including: a detection module, an execution module, a receiving module, and an update module, where each module is used to execute the method described in the above aspects.
  • an embodiment of the present application provides a storage processing apparatus, including: a processor, a memory, the memory, and the memory are connected by a bus, where the memory stores executable program code, and the processor is used by the processor.
  • the executable program code is invoked to execute the storage processing method according to any one of claims 1 to 8.
  • an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores instructions that, when run on a computer, cause the computer to perform the methods described in the above aspects.
  • an embodiment of the present application provides a computer program product comprising instructions, which when executed on a computer, cause the computer to perform the method described in the above aspects.
  • the data when receiving the memory access request, first detecting the request type of the memory access request, and detecting the backup status of the target data requested by the memory access request, and then according to the request type of the memory access request and the target data.
  • Different backup states use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • FIG. 1 is a schematic diagram of a Cache structure provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a hardware structure provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a storage processing method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of another storage processing method provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of still another storage processing method according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of another storage processing apparatus according to an embodiment of the present application.
  • FIG. 1 is a schematic diagram of a Cache structure provided by an embodiment of the present application.
  • the Cache structure described in FIG. 1 is a layered Cache structure, including a level 1 cache L1 (Level 1), a level 2 cache L2 (Level 2), and a level 3 cache L3 (Level 3), wherein L1 adopts a high speed and small capacity.
  • Cache, L2 uses a cache with medium speed and large capacity
  • L3 uses a low-speed and large-capacity Cache.
  • the Home Agent (HA) is a module that maintains data consistency in the processor. It mainly implements serialized access of the processor to the same address and parallel access to different addresses.
  • a storage processing method described in the embodiment of the present application implements multi-core cache coherency through hierarchical maintenance.
  • L2 maintains the consistency between several L1s corresponding to it
  • L3 maintains the consistency between several L2s corresponding to it
  • HA maintains the relationship between several L3s corresponding to it.
  • Consistency maintain consistency across multiple cores by using a directory-based coherency protocol at all levels.
  • the HA records the backup of the data in the upper Cache (for example, L3) by establishing a directory in the directory cache.
  • the directory records the address of the cache in which the data is stored in the upper Cache, and the data is in the directory.
  • the backup status in the Cache If the processor needs to operate on a certain data, the Cache address for storing the certain data may be obtained by querying the directory, and the certain data in the Cache is performed according to the backup status of the certain data and the indication of the operation. Corresponding processing.
  • the on-chip cache of each processor chip can be up to tens of megabytes (Mega Byte, MB), and the total capacity of multiple chips can reach even 100 MB. Therefore, the directory capacity of HA, L1, L2, and L3 is a big problem.
  • HA is taken as an example.
  • the HA directory uses an accurate directory, a Sparse structure, and stores the directory in an on-chip static random access memory (SRAM), but in view of the fact that the processor system usually has fewer modifications to the instructions, the embodiment of the present application
  • SRAM static random access memory
  • the described storage processing method uses different processing strategies for the instruction and data type requests respectively, so as to effectively reduce the directory capacity overhead or increase the effective expansion ratio under the same directory capacity.
  • the storage processing method described in the embodiment of the present application is based on the following ideas: 1.
  • the HA receives a memory access request sent by the processor, and the memory access request carries an instruction or a data type indication. 2.
  • the HA adopts different processing strategies for the memory access request of the instruction and the data type. 3. For the data type access request, whether the state of the target data requested by the memory access request is the E state or the S state, if the HA directory is missed, the new directory entry is newly created and responded to the memory access request. The newly created directory entry is used to record in which cache or caches the target data corresponding to the memory access request is stored. 4.
  • the directory is not created after the query directory is missed, and only the response request is processed in response to the fetch request;
  • the status of the requested target data is E state, the new directory is queried after the HA directory is missed, and the listener is broadcasted and responded to in response to the memory access request.
  • a storage processing method described in the embodiment of the present application can be divided into a request parsing unit, a directory query unit, a directory update/establishment unit, a snooping sending unit, and a request processing unit in hardware implementation, as shown in FIG. 2 .
  • the request parsing unit is configured to parse the request type of the memory access request, determine whether the request type of the memory access request is an instruction type or a data type, and determine whether the backup status of the target data requested by the memory access request is an E state or an S state. Wait.
  • the directory query unit is configured to identify, according to the target data carried by the memory access request, whether the directory corresponding to the target data has been established.
  • the directory update/establishment unit is configured to generate a new directory value according to the request type of the memory access request and in combination with the original directory value.
  • the listening sender unit is used to send a listening request and collect a listening response.
  • the request processing unit is configured to complete the actions specified by the protocol according to the type of request.
  • the execution subject is described by taking the HA as an example. If the execution entities of the caches L1, L2, and L3 implement the storage processing method described in the embodiment of the present application, and so on.
  • FIG. 3 is a storage processing method provided by an embodiment of the present application, and the method may be applied to the Cache structure shown in FIG. 1.
  • the method includes but is not limited to the following steps:
  • the HA detects a request type of the memory access request when receiving the memory access request.
  • the memory access request received by the HA may be sent by a central processing unit (CPU), where the memory access request carries a request type tag, and carries the target requested by the memory access request.
  • the backup status flag for the data includes an instruction type tag, a data type tag; the backup status tag includes a first backup status flag, and a second backup status flag.
  • the first backup state may be an exclusive state E state, and the second backup state may be a shared state S state. It should be noted that the memory access request may also be issued by other types of processors.
  • the HA when receiving the memory access request, the HA detects the request type of the memory access request based on the request type identifier carried by the memory access request.
  • the request type of the memory access request includes a data type (ie, a data request) and an instruction type (ie, an instruction request), and the data type request is used to request data, including for reading data or writing data, etc.;
  • the request is for a request instruction, including for reading an instruction or writing an instruction.
  • the HA detects that the memory access request is an instruction request, and detects that the backup status of the target data requested by the memory access request is an exclusive state, the access is performed according to the indication of the first processing policy.
  • the save request performs response processing.
  • the target data includes a target instruction
  • the HA detects the access request as an instruction request based on the request type tag carried by the memory access request, and based on the backup status of the target data carried by the memory access request
  • the flag detects that the backup state of the target instruction requested by the memory access request is an exclusive state, and performs a response process on the memory access request according to the indication of the first processing policy.
  • the response processing manner indicated by the first processing policy includes: first, the HA establishes a first directory entry corresponding to the target instruction according to the memory access request, where the first directory entry records a cache identifier of the cache storing the target instruction, and the The backup status of the target instruction.
  • the cache identifier may be the address of the Cache that stores the target instruction, or may be the sequence number of the Cache.
  • the HA broadcasts the Cache of the managed Cache according to the identifier of the target instruction, and receives the Cache response of the Cache for the broadcast interception.
  • the identifier of the target instruction may be a physical memory address of the target instruction.
  • the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the cache storing the target instruction, and the cache identifier may be an address of the cache.
  • the HA queries the first directory entry according to the cache identifier in the first set.
  • the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored.
  • the Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction.
  • the HA performs a response process on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the exclusive state specified by the protocol, the response processing including reading, writing, modifying, and protocol-defined actions (eg, handshake Action) and so on.
  • protocol-defined actions eg, handshake Action
  • the HA detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is a shared state, the memory is accessed according to the indication of the second processing policy. Request to perform response processing.
  • the response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy, and the target data includes a target instruction.
  • the backup state of the target instruction is a shared state, and the response processing is performed on the memory access request according to the indication of the second processing policy.
  • the response processing manner indicated by the second processing policy includes: the HA performs a response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the sharing state specified by the protocol, where the response processing includes reading and protocol-specified Handshake action, etc.
  • the HA detects that the memory access request is a data request, whether the backup status of the target data requested by the memory access request is an exclusive state or a shared state, according to the indication of the third processing policy.
  • a response process is performed on the memory access request.
  • the response processing manner indicated by the third processing policy may be the same as the response processing manner indicated by the first processing policy, or may be different from the response processing manner indicated by the first processing policy.
  • the response processing manner indicated by the third processing policy may include: first, the HA creates a second directory entry corresponding to the target data according to the memory access request, where the second directory entry includes a cache identifier of the cache that stores the target data, and The backup status of the target data; then the HA performs response processing on the target data according to an indication of the data request and an operation permitted by the backup status of the target data specified by the protocol, the response processing including reading, writing, modifying, and protocol provisioning The action and so on.
  • the HA when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type and target of the memory access request.
  • the different backup states of the data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • FIG. 4 is another storage processing method provided by an embodiment of the present application, where the method includes but is not limited to the following steps:
  • the HA receives the memory access request.
  • the memory access request received by the HA may be sent by the central processing unit, and the memory access request carries a request type tag, and the request type tag includes an instruction type tag and a data type tag. It should be noted that the memory access request may also be issued by other types of processors.
  • the request type of the memory access request includes a data type, that is, a data request, an instruction type, that is, an instruction request, and a data type request is used for requesting data, including for reading data or writing data, etc.;
  • the request instruction includes a read instruction or a write instruction.
  • step S402. Detect whether the memory access request is an instruction request. If not, perform step S403 and step S404; if yes, perform step S405 and subsequent steps.
  • the HA After receiving the access request, the HA detects the request type of the memory access request based on the request type identifier carried by the memory access request, and if the memory access request is detected as a data request, step S403 and step S404 are performed. If it is detected that the memory access request is an instruction request, step S405 and subsequent steps are performed.
  • the HA creates a second directory entry corresponding to the target data requested by the memory access request according to the memory access request.
  • the backup state of the target data requested by the memory access request is an exclusive state or a shared state, and the new access and the access are performed according to the memory access request.
  • the second directory entry corresponding to the target data requested by the request is stored.
  • the second directory includes a cache identifier of the cache that stores the target data and a backup state of the target data.
  • the cache identifier may be an address of a cache that stores the target data, or may be a sequence number of the cache.
  • the HA searches for the Cache that stores the target data in the Cache managed by the HA according to the identifier of the target data carried in the memory access request, and if yes, returns a cache identifier of the Cache that stores the target data and the cache identifier in the Cache.
  • the backup state of the target data if not, the data corresponding to the target data identifier in the memory is loaded into a cache managed by the HA, and the cache identifier of a certain cache storing the target data is returned, and the target data is The backup status in this Cache.
  • a second directory entry corresponding to the target data is created in the directory of the HA, where the second directory entry includes a cache identifier of the cache that stores the target data and a backup state of the target data in the cache.
  • the HA can perform a broadcast interception on the Cache managed by the HA to query whether the Cache managed by the Cache has a Cache for storing the target data.
  • the identifier of the target data may be a physical memory address of the target data.
  • the HA performs a response process on the target data requested by the memory access request.
  • the HA performs response processing on the target data according to an instruction of the data request and an operation permitted by the backup state of the target data specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • For data whose backup status is E state it is allowed to be read, written, modified, and the actions specified by other protocols; for data whose backup state is S state, it is allowed to read and other operations specified by the protocol, but not Other operations specified by the protocol such as writing, modification, etc. are allowed.
  • the HA detects whether the backup status of the target data requested by the memory access request is an exclusive state. If not, step S406 is performed; if yes, steps S407 to S409 are performed.
  • the memory access request further carries a backup status flag of the target data requested by the memory access request.
  • the backup status flag includes a first backup status flag and a second backup status flag.
  • the first backup state may be an exclusive state E state
  • the second backup state may be a shared state S state.
  • the target data includes target instructions.
  • the HA detects the backup status of the target instruction requested by the memory access request based on the backup status flag of the target data carried by the memory access request. If the HA detects that the backup status of the target instruction is the shared status, the step is performed. S405. If the HA detects that the backup state of the target command is the exclusive state, step S407 to step S409 are performed.
  • the HA performs a response process on the target data requested by the memory access request.
  • the HA detects that the backup state of the target instruction requested by the memory access request is a shared state, performing response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the shared state specified by the protocol.
  • the response processing includes reading and a handshake action specified by the protocol. For an instruction whose backup state is S state, it is allowed to read and other operations specified by the protocol, but other operations specified by the protocol such as writing, modification, etc. are not allowed.
  • the HA newly creates a first directory entry corresponding to the target data according to the memory access request.
  • the HA if the HA detects that the backup status of the target instruction requested by the memory access request is an exclusive state based on the backup status flag of the target data carried in the memory access request, the HA establishes the The first directory entry corresponding to the target instruction, the specific process of this step may refer to the description in step S403, and details are not described herein again.
  • the first directory entry records the cache identifier of the cache storing the target instruction and the backup of the target instruction. status.
  • the HA performs broadcast interception on the managed Cache, and performs recovery processing on the target data according to the received listening response returned by each Cache for the broadcast interception.
  • the HA performs broadcast interception on the Cache managed by the HA according to the identifier of the target instruction, and receives a listening response of each Cache for the broadcast interception. Then, the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the Cache storing the target instruction. Then, the HA queries the first directory entry according to the cache identifier in the first set. If the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored. The Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction.
  • the backup state Take the backup state as the exclusive state E state as an example.
  • data or instructions whose backup state is the E state such data or instructions can only be backed up to a certain cache. Therefore, the purpose of broadcast interception is to query whether there is still The other Caches back up the E-state data or instructions, and if so, the other Caches are reclaimed for the E-state data or instructions, that is, the E-state data or instructions in other Caches are invalidated.
  • the HA performs a response process on the target data requested by the memory access request.
  • the HA performs response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the exclusive state specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • the actions specified by the read, write, modify, and other protocols are allowed.
  • the HA when receiving the access request, the HA may first detect the backup status of the target data requested by the memory access request, and if the backup status of the target data is detected as independent If the state of the target data is detected as a shared state, detecting whether the memory access request is an instruction request, and if yes, executing a response to the target instruction requested by the memory access request Processing, if no, executing steps S403 and S404.
  • the HA when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type and target of the memory access request.
  • the different backup states of the data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • FIG. 5 is still another storage processing method provided by an embodiment of the present application, where the method includes but is not limited to the following steps:
  • the HA receives the memory access request.
  • the memory access request received by the HA may be sent by the central processing unit, and the memory access request carries a request type tag and a backup status flag carrying the target data requested by the memory access request.
  • the request type tag includes an instruction type tag, a data type tag; the backup status tag includes a first backup status flag, and a second backup status flag.
  • the first backup state may be an exclusive state E state, and the second backup state may be a shared state S state. It should be noted that the memory access request may also be issued by other types of processors.
  • the HA detects whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory, and if the detection result is included, determining the hit data, and performing step S503; If not, the miss data is determined, and step S504 and its subsequent steps are performed.
  • the target data may be data or an instruction.
  • the HA queries, according to the target data identifier carried in the memory access request, whether the directory entry existing in the HA preset directory includes a third directory corresponding to the target data requested by the memory access request. If yes, step S503 is performed; if no, step S504 and subsequent steps are performed.
  • the identifier of the target data may be a physical memory address of the target data, and the third directory entry records a cache identifier of the cache storing the target data and a backup status of the target data, where the cache identifier may be the target data.
  • the address of the Cache can also be the sequence number of the Cache.
  • the HA updates the third directory entry according to the memory access request and performs response processing in response to the memory access request.
  • the HA first queries the Cache managed by the HA according to the identifier of the target data, and obtains a second set according to the cached identifier of the Cache that stores the target data, and the second set includes one or more of the target data.
  • Cache identifier of the Cache then the HA queries the third directory entry according to the cache identifier in the second set, and if the second set contains the cache identifier not included in the third directory entry, the first The three directory entries are updated.
  • the update process includes adding an entry in the third directory entry that corresponds to a cache identifier in the second set that is not included in the third directory entry.
  • the HA responds to the target data requested by the memory access request according to the type of the memory access request and the operation of the backup state of the target data specified by the protocol, and the response is processed. Processing includes reading, writing, modifying, and protocol-defined handshake actions.
  • step S505 The HA detects whether the memory access request is an instruction request. If not, step S505 is performed; if yes, step S506 and subsequent steps are performed.
  • the HA detects the request type of the memory access request based on the request type tag carried by the memory access request, and if it is detected that the memory access request is a data request, step S505 is performed; if the memory access request is detected as an instruction request Then, step S506 and subsequent steps are performed.
  • the HA performs a response process on the memory access request according to the indication of the third processing policy.
  • the backup state of the target data requested by the memory access request is an exclusive state or a shared state
  • the new The second directory entry corresponding to the target data requested by the fetch request includes a cache identifier of the cache storing the target data and a backup status of the target data.
  • the HA searches for the Cache that stores the target data in the Cache managed by the HA according to the identifier of the target data carried in the memory access request, and if yes, returns a cache identifier of the Cache that stores the target data and the cache identifier in the Cache.
  • the backup state of the target data if not, the data corresponding to the target data identifier in the memory is loaded into a cache managed by the HA, and the cache identifier of a certain cache storing the target data is returned, and the target data is The backup status in this Cache.
  • a second directory entry corresponding to the target data is created in the directory of the HA, where the second directory entry includes a cache identifier of the cache that stores the target data and a backup state of the target data in the cache.
  • the HA can perform a broadcast interception on the Cache managed by the HA to query whether the Cache managed by the Cache has a Cache for storing the target data.
  • the HA performs response processing on the target data according to an instruction of the data request and an operation permitted by the backup state of the target data specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • the response processing includes reading, writing, modifying, and an action specified by the protocol.
  • For data whose backup status is E state it is allowed to be read, written, modified, and the actions specified by other protocols; for data whose backup state is S state, it is allowed to read and other operations specified by the protocol, but not Other operations specified by the protocol such as writing, modification, etc. are allowed.
  • step S506 The HA detects whether the backup status of the target data requested by the memory access request is an exclusive state. If not, step S507 is performed; if yes, step S508 is performed.
  • the HA detects a backup status of the target instruction requested by the memory access request based on a backup status flag of the target data requested by the memory access request carried by the memory access request. If the HA detects that the backup state of the target command is the shared state, step S507 is performed; if the HA detects that the backup state of the target data is the exclusive backup state, step S508 is performed.
  • the HA performs a response process on the memory access request according to the indication of the second processing policy.
  • the HA detects that the backup state of the target instruction requested by the memory access request is a shared state, performing response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the shared state specified by the protocol.
  • the response processing includes reading and a handshake action specified by the protocol. For an instruction whose backup state is S state, it is allowed to read and other operations specified by the protocol, but other operations specified by the protocol such as writing, modification, etc. are not allowed.
  • the HA performs a response process on the memory access request according to the indication of the first processing policy.
  • the response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy.
  • the response processing manner indicated by the first processing policy includes: first, the HA establishes, according to the memory access request, a first directory entry corresponding to the target instruction requested by the memory access request, where the first directory entry records the target instruction The cache ID of the Cache and the backup status of the target instruction. Secondly, the HA broadcasts the Cache of the managed Cache according to the identifier of the target instruction, and receives the Cache response of the Cache for the broadcast interception. Then, the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the Cache storing the target instruction.
  • the HA queries the first directory entry according to the cache identifier in the first set. If the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored. The Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction. Finally, the HA performs response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the first backup state specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol. It should be noted that, the manner of the response processing indicated by the first processing policy may refer to the description of step S407 to step S409 in the foregoing embodiment, and details are not described herein again.
  • the HA when receiving the access request, the HA first detects whether the preset directory includes a third directory entry corresponding to the target data requested by the memory access request, and if so, And updating the third directory entry according to the memory access request and performing a response process in response to the memory access request; if not, executing step S506, detecting whether the backup state of the target data requested by the memory access request is an exclusive state; And performing a response process on the memory access request according to the indication of the first processing policy; if not, executing step S504, detecting whether the memory access request is an instruction request, and if yes, requesting the memory access according to the indication of the second processing policy Executing a response process; if not, performing a response process on the memory access request according to an indication of the third processing policy.
  • the HA when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to different request types of the memory access request and
  • the different backup states of the target data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • FIG. 6 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present application.
  • the storage processing device shown in FIG. 6 may include a detection module 601, an execution module 602, a receiving module 603, and an update module 604.
  • the detailed description of each module is as follows.
  • the detecting module 601 is configured to detect a request type of the memory access request when receiving the memory access request.
  • the executing module 602 is configured to: if the detecting module 601 detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is an exclusive state, according to the first processing policy The indication performs a response process on the memory access request.
  • the execution module 602 is further configured to: if the detecting module 601 detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is a shared state, according to the second An indication of the processing policy performs a response process on the fetch request.
  • the response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy.
  • the executing module 602 is further configured to: if the detecting module 601 detects that the memory access request is a data request, perform a response to the memory access request according to an indication of a third processing policy. deal with.
  • the executing module 602 includes:
  • the first new unit 6021 is configured to create a first directory entry corresponding to the target data according to the memory access request, where the first directory entry records a cache identifier of the cache storing the target data, and the target data. Backup status.
  • the first processing unit 6022 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  • the executing module 602 further includes:
  • the listening unit 6023 is configured to perform broadcast interception on the managed Cache according to the target data, and receive a listening response returned by each Cache for the broadcast interception.
  • the first obtaining unit 6024 is configured to obtain a first set according to the listening response, where the first set includes one or more cache identifiers of the Cache storing the target data.
  • the first processing unit 6022 is further configured to: if the cache identifier that is not included in the first directory entry is queried in the first set, perform the collection process on the target data.
  • the executing module 602 further includes:
  • the second processing unit 6025 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  • the executing module 602 further includes:
  • a second new unit 6026 configured to create a second directory entry corresponding to the target data according to the memory access request, where the second directory entry records a cache identifier of the cache cache that stores the target data, and the target The backup status of the data;
  • the third processing unit 6027 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  • the apparatus further includes:
  • the receiving module 603 is configured to receive a memory access request.
  • the detecting module 602 is further configured to detect whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory.
  • the detecting module 602 is further configured to: if the detection result is not included, determine the miss data, and perform the step of detecting the request type of the memory access request.
  • the detecting module 602 is further configured to: if the detection result is a third directory entry corresponding to the target data requested by the memory access request, determine hit data, the device further includes :
  • the update module 604 is configured to update the third directory entry according to the memory access request.
  • the update module 604 includes:
  • the second obtaining unit 6041 is configured to obtain a second set according to the target data, where the second set includes one or more cache identifiers of the Cache storing the target data.
  • the updating unit 6042 is configured to perform an update process on the third directory item if the cache identifier that is not included in the third directory entry is queried in the second set.
  • the receiving module 603 when receiving the access request, triggers the detection module 601 to detect the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then triggers the execution module 602.
  • different policies are used to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • FIG. 7 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present disclosure.
  • the storage processing apparatus described in the embodiment of the present application includes: a processor 701 and a memory 702.
  • the processor 701 and the memory 702 can be connected by using a bus or other manners.
  • the embodiment of the present application is exemplified by a bus connection.
  • the processor 701 (for example, a central processing unit (CPU)) is a computing core and a control core of the storage processing device.
  • the memory 702 (Memory) is a memory device of the storage processing device for storing programs and data. It can be understood that the memory 702 herein may be a high speed RAM memory, or may be a non-volatile memory, such as at least one disk memory; optionally, at least one of the processors 701 may be located away from the foregoing processor 701. Storage device.
  • the memory 702 provides a storage space, which stores an operating system and executable program code of the storage processing device, and may include, but is not limited to, a Windows system (an operating system), a Linux (an operating system) system, and the like. The application is not limited.
  • the processor 701 performs the following operations by running the executable program code in the memory 702:
  • the processor 701 is configured to detect a request type of the memory access request when receiving the memory access request.
  • the processor 701 is further configured to: if detecting that the memory access request is an instruction request, and detecting that the backup state of the target data requested by the memory access request is an exclusive state, according to the indication of the first processing policy A response process is performed on the memory access request.
  • the processor 701 is further configured to: if detecting that the memory access request is an instruction request, and detecting that the backup state of the target data requested by the memory access request is a shared state, according to the indication of the second processing policy The memory access request performs a response process.
  • the first processing policy and the second processing policy are different.
  • the processor 701 is further configured to:
  • the response processing is performed on the memory access request according to the indication of the third processing policy.
  • the processor 701 is further configured to:
  • the first directory entry corresponding to the target data is newly created according to the access request, and the first directory entry records a cache identifier of the cache that stores the target data, and a backup state of the target data.
  • the processor 701 is further configured to:
  • the listening response Obtaining a first set according to the listening response, where the first set includes one or more cache identifiers of a cache storing the target data.
  • the target data is recycled.
  • the processor 701 is further configured to:
  • the processor 701 is further configured to:
  • the processor 701 is further configured to:
  • the detection result is a third directory entry corresponding to the target data requested by the memory access request
  • the hit data is determined, and the third directory entry is updated according to the memory access request.
  • the processor 701 is specifically configured to:
  • the second set includes one or more cache identifiers of the cache storing the target data; if the second set of entries in the second set is not included in the third directory entry In the cache identifier, the third directory entry is updated.
  • the processor 701 and the memory 702 described in the embodiment of the present application may be implemented in the process of the storage processing method provided in FIG. 3, FIG. 4 or FIG. 5 of the embodiment of the present application, and may also be implemented.
  • the implementations described in the storage processing apparatus provided in FIG. 6 of the embodiment of the present application are not described herein.
  • the processor 701 when receiving the memory access request, the processor 701 first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type of the memory access request. And different backup states of the target data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wire (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, microwave, etc.).
  • the computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)) or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Disclosed in an embodiment of the present application are a storage processing method and apparatus, said method comprising: when a memory access request is received, detecting the request type of said memory access request; if the memory access request is detected as being an instruction request, and the backup status of target data which is requested by the memory access request is detected as being exclusive, then executing response processing for the memory access request according to an instruction of a first processing strategy; if the memory access request is detected as being an instruction request, and the backup status of the target data which is requested by the memory access request is detected as being shared, then executing response processing for the memory access request according to an instruction of a second processing strategy; the manner of response processing as instructed by the first processing strategy differs from the manner of response processing as instructed by the second processing strategy. By applying the embodiment of the present application, targeted processing of data may be carried out for data having different backup statuses, thus saving software and hardware resources of a terminal to a certain extent, and increasing storage efficiency.

Description

一种存储处理方法及装置Storage processing method and device 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种存储处理方法及装置。The present application relates to the field of computer technologies, and in particular, to a storage processing method and apparatus.
背景技术Background technique
缓存(Cache,也称为高速缓冲存储器)位于处理器和内存(Memory)之间,主要为了解决处理器运算速度和内存读写速度不匹配的问题。在多核处理器(Multi-core)系统中,Cache结构可以将存储器中的数据缓存在Cache中,加速多核获取数据的过程。Cache (also known as cache) is located between the processor and memory (Memory), mainly to solve the problem of processor speed and memory read and write speed mismatch. In a multi-core system (Multi-core) system, the Cache structure can cache data in the memory in the Cache, and accelerate the process of acquiring data by the multi-core.
存储器中的数据缓存到Cache中可以有两种备份状态,分别是共享状态(Shared状态,简称S态)和独享状态(Exclusive状态,简称E态)。若某数据的备份状态为Shared状态,则表示该数据可能在多个Cache中有备份。若某数据的备份状态为Exclusive状态,则表示该数据只在某一个Cache中有备份。如何在缓存中针对处于共享状态的数据或者处于独享状态的数据进行存储处理成为研究的热点问题。The data cached in the cache can have two backup states, namely, a shared state (Shared state, referred to as S state) and an exclusive state (Exclusive state, referred to as an E state). If the backup status of a data is Shared, it means that the data may be backed up in multiple caches. If the backup status of a data is Exclusive, it means that the data is only backed up in a certain cache. How to store the data in the shared state or the data in the exclusive state in the cache becomes a hot issue of research.
发明内容Summary of the invention
本申请实施例提供了一种存储处理方法及装置,可以针对数据的不同备份状态对数据进行针对性处理。The embodiment of the present application provides a storage processing method and device, which can perform targeted processing on data according to different backup states of data.
第一方面,本申请实施例提供了一种存储处理方法,该方法包括:在接收到访存请求时,首先检测该访存请求的请求类型,并检测该访存请求所请求的目标数据的备份状态,该访存请求的请求类型包括数据请求和指令请求,该目标数据的备份状态包括独享状态和共享状态;然后根据检测结果对该访存请求执行相应的响应处理,若检测到该访存请求为指令请求,且检测到该目标数据的备份状态为独享状态,则根据第一处理策略的指示对该访存请求执行响应处理;若检测到该访存请求为指令请求,且检测到该目标数据的备份状态为共享状态,则根据第二处理策略的指示对该访存请求执行响应处理;其中,该第一处理策略指示的响应处理方式和该第二处理策略指示的响应处理方式不同。采用本申请实施例,可以针对数据的不同备份状态对数据进行针对性处理,从而在一定程度上节省终端的软硬件资源,提高存储效率。In a first aspect, an embodiment of the present application provides a storage processing method, including: when receiving a memory access request, first detecting a request type of the memory access request, and detecting target data requested by the memory access request a backup state, the request type of the memory access request includes a data request and an instruction request, and the backup state of the target data includes an exclusive state and a shared state; and then performing corresponding response processing on the memory access request according to the detection result, and if the When the memory access request is an instruction request, and the backup state of the target data is detected as an exclusive state, the response processing is performed on the memory access request according to the indication of the first processing policy; if the memory access request is detected as an instruction request, and Detecting that the backup state of the target data is a shared state, performing a response process on the memory access request according to the indication of the second processing policy; wherein the response processing mode indicated by the first processing policy and the response indicated by the second processing policy Different treatment methods. With the embodiment of the present application, the data can be processed in a targeted manner for different backup states of the data, thereby saving the software and hardware resources of the terminal to a certain extent and improving the storage efficiency.
在一种可能的实施例中,若检测到该访存请求为数据请求,无论该目标数据的备份状态是独享状态还是共享状态,则根据第三处理策略的指示对该访存请求执行响应处理,从而针对访存请求的不同类型采用不同的处理策略,可以在一定程度上节省终端的软硬件资源,提高存储效率。In a possible embodiment, if the memory access request is detected as a data request, whether the backup state of the target data is an exclusive state or a shared state, the response to the memory access request is performed according to the indication of the third processing policy. Processing, so that different processing strategies are adopted for different types of memory access requests, which can save the software and hardware resources of the terminal to a certain extent and improve storage efficiency.
在一种可能的实施例中,该第一处理策略指示的响应处理方式可以包括:首先根据该访存请求新建与该目标数据对应的第一目录项,该第一目录项记录了存放该目标数据的Cache的缓存标识以及该目标数据的备份状态;然后根据检测得到的该访存请求的类型以及该目标数据的备份状态,对该目标数据执行响应处理。该响应处理包括读取、写入、修改以及协议规定的握手动作等。In a possible embodiment, the response processing manner indicated by the first processing policy may include: first creating a first directory entry corresponding to the target data according to the memory access request, where the first directory entry records the target The cache identifier of the Cache of the data and the backup state of the target data; and then performing response processing on the target data according to the detected type of the memory access request and the backup state of the target data. The response processing includes reading, writing, modifying, and protocol-defined handshake actions.
在一种可能的实施例中,该第一处理策略指示的响应处理方式还可以包括:根据该目 标数据的标识对管理的Cache进行广播侦听,并接收各个Cache针对该广播侦听返回的侦听响应,该目标数据的标识可以是该目标数据的物理内存地址;然后根据接收到的侦听响应得到第一集合,该第一集合包括一个或者多个存放该目标数据的Cache的缓存标识,该缓存标识可以是该Cache的地址;若查询到该第一集合中有未包括在该第一目录项中的缓存标识,则回收存放有该目标数据但缓存标识未包含在该第一目录项中的Cache对于该目标数据的权限。In a possible embodiment, the response processing manner indicated by the first processing policy may further include: performing broadcast monitoring on the managed Cache according to the identifier of the target data, and receiving a Detect that each Cache returns for the broadcast interception. Listening to the response, the identifier of the target data may be a physical memory address of the target data; and then obtaining a first set according to the received listening response, the first set including one or more cache identifiers of the cache storing the target data, The cache identifier may be an address of the cache; if the cache identifier that is not included in the first directory entry is found in the first set, the target data is reclaimed but the cache identifier is not included in the first directory entry. The Cache's permissions on the target data.
在一种可能的实施例中,若检测到该访存请求为指令请求,且检测到该访存请求所请求的目标数据的备份状态为共享状态,则直接根据检测得到的该访存请求的类型以及该目标数据的备份状态,对该访存请求所请求的目标数据执行响应处理,该响应处理包括读取以及协议规定的握手动作等。In a possible embodiment, if the memory access request is detected as an instruction request, and the backup state of the target data requested by the memory access request is detected as a shared state, the memory access request is directly obtained according to the detection. The type and the backup status of the target data perform response processing on the target data requested by the memory access request, and the response processing includes a reading and a handshake action specified by the protocol.
在一种可能的实施例中,该第三处理策略指示的响应处理方式可以包括:首先根据该访存请求新建与该目标数据对应的第二目录项,该第二目录项记录了存放该目标数据的Cache的缓存标识以及该目标数据的备份状态;然后根据检测得到的该访存请求的类型以及该目标数据的备份状态,对该目标数据执行响应处理。该响应处理包括读取、写入、修改以及协议规定的握手动作等。In a possible embodiment, the response processing manner indicated by the third processing policy may include: first creating a second directory entry corresponding to the target data according to the memory access request, where the second directory entry records the target The cache identifier of the Cache of the data and the backup state of the target data; and then performing response processing on the target data according to the detected type of the memory access request and the backup state of the target data. The response processing includes reading, writing, modifying, and protocol-defined handshake actions.
在一种可能的实施例中,检测该访存请求的请求类型之前,该方法还包括:首先接收访存请求,该访存请求可以是中央处理器发出的,并携带请求类型标识,然后检测预置目录中是否包括与该访存请求所请求的目标数据对应的第三目录项,该第三目录项记录了存放该目标数据的Cache的缓存标识以及该目标数据的备份状态;若检测结果为不包括,则确定未命中数据,并执行检测该访存请求的请求类型的步骤;若检测结果为包括,则确定命中数据,并根据该目标数据得到第二集合,该第二集合包括一个或者多个存放该目标数据的Cache的缓存标识;若查询到该第二集合中有未包括在该第三目录项中的缓存标识,则对该第三目录项进行更新处理。该更新处理包括在该第三目录项中添加与该第二集合中有但未包括在该第三目录项中的缓存标识对应的条目。In a possible embodiment, before detecting the request type of the memory access request, the method further includes: first receiving a memory access request, where the memory access request is sent by the central processing unit, carrying the request type identifier, and then detecting Whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory, where the third directory entry records the cache identifier of the cache storing the target data and the backup status of the target data; If not, determining the miss data, and performing the step of detecting the request type of the memory access request; if the detection result is included, determining the hit data, and obtaining the second set according to the target data, the second set includes a second set Or a cache identifier of the cache that stores the target data; if the cache identifier that is not included in the third directory entry is found in the second set, the third directory entry is updated. The update process includes adding an entry in the third directory entry that corresponds to a cache identifier in the second set that is not included in the third directory entry.
第二方面,本申请实施例提供了一种存储处理装置,该装置包括:检测模块、执行模块、接收模块和更新模块,上述各个模块用于执行上述各方面所述的方法。In a second aspect, an embodiment of the present application provides a storage processing apparatus, including: a detection module, an execution module, a receiving module, and an update module, where each module is used to execute the method described in the above aspects.
第三方面,本申请实施例提供了一种存储处理装置,包括:处理器、存储器,所述处理器、所述存储器通过总线连接,所述存储器存储有可执行程序代码,所述处理器用于调用所述可执行程序代码,执行如权利要求1~8中任一项所述的存储处理方法。In a third aspect, an embodiment of the present application provides a storage processing apparatus, including: a processor, a memory, the memory, and the memory are connected by a bus, where the memory stores executable program code, and the processor is used by the processor. The executable program code is invoked to execute the storage processing method according to any one of claims 1 to 8.
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores instructions that, when run on a computer, cause the computer to perform the methods described in the above aspects.
第五方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面所述的方法。In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which when executed on a computer, cause the computer to perform the method described in the above aspects.
本申请实施例中,在接收到访存请求时,首先检测该访存请求的请求类型,以及检测该访存请求所请求的目标数据的备份状态,然后根据访存请求的请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the memory access request, first detecting the request type of the memory access request, and detecting the backup status of the target data requested by the memory access request, and then according to the request type of the memory access request and the target data. Different backup states use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
附图说明DRAWINGS
为了更清楚地说明本申请实施例或背景技术中的技术方案,下面将对本申请实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings to be used in the embodiments of the present application or the background art will be described below.
图1是本申请实施例提供的一种Cache结构的示意图;1 is a schematic diagram of a Cache structure provided by an embodiment of the present application;
图2是本申请实施例提供的一种硬件结构的示意图;2 is a schematic diagram of a hardware structure provided by an embodiment of the present application;
图3是本申请实施例提供的一种存储处理方法的流程示意图;3 is a schematic flowchart of a storage processing method provided by an embodiment of the present application;
图4是本申请实施例提供的另一种存储处理方法的流程示意图;4 is a schematic flowchart of another storage processing method provided by an embodiment of the present application;
图5是本申请实施例提供的又一种存储处理方法的流程示意图;FIG. 5 is a schematic flowchart of still another storage processing method according to an embodiment of the present application;
图6是本申请实施例提供的一种存储处理装置的结构示意图;FIG. 6 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present disclosure;
图7是本申请实施例提供的另一种存储处理装置的结构示意图。FIG. 7 is a schematic structural diagram of another storage processing apparatus according to an embodiment of the present application.
具体实施方式detailed description
下面结合本申请实施例中的附图对本申请实施例进行描述。The embodiments of the present application are described below in conjunction with the accompanying drawings in the embodiments of the present application.
请参见图1,图1是本申请实施例提供的一种Cache结构的示意图。图1中所描述的Cache结构为分层的Cache结构,包括一级缓存L1(Level 1)、二级缓存L2(Level 2)、三级缓存L3(Level 3),其中L1采用高速小容量的Cache,L2采用速度中等容量较大的Cache,L3采用低速大容量的Cache。内存代理(Home Agent,HA)为处理器中维护数据一致性的模块,主要实现处理器对同一地址的串行化访问和对不同地址的并行化访问。Referring to FIG. 1, FIG. 1 is a schematic diagram of a Cache structure provided by an embodiment of the present application. The Cache structure described in FIG. 1 is a layered Cache structure, including a level 1 cache L1 (Level 1), a level 2 cache L2 (Level 2), and a level 3 cache L3 (Level 3), wherein L1 adopts a high speed and small capacity. Cache, L2 uses a cache with medium speed and large capacity, and L3 uses a low-speed and large-capacity Cache. The Home Agent (HA) is a module that maintains data consistency in the processor. It mainly implements serialized access of the processor to the same address and parallel access to different addresses.
本申请实施例所描述的一种存储处理方法是通过分级维护来实现多核间缓存一致性的。以图1为例,L2会维护与其对应的数个L1之间的一致性,L3会维护与其对应的数个L2之间的一致性,而HA则负责维护与其对应的数个L3之间的一致性,各级之间可以通过采用基于目录的(Directory-based)一致性协议来维护多核间缓存的一致性。以HA为例,HA通过在其目录缓存区中建立目录来记录数据在上级Cache(例如L3)中的备份情况,该目录中记录了上级Cache中存放该数据的Cache的地址,以及该数据在该Cache中的备份状态。如果处理器需要对某个数据进行操作,则可以通过查询该目录获取存放该某个数据的Cache地址,并根据该某个数据的备份状态以及该操作的指示对Cache中的该某个数据进行相应的处理。A storage processing method described in the embodiment of the present application implements multi-core cache coherency through hierarchical maintenance. Taking Figure 1 as an example, L2 maintains the consistency between several L1s corresponding to it, L3 maintains the consistency between several L2s corresponding to it, and HA maintains the relationship between several L3s corresponding to it. Consistency, maintain consistency across multiple cores by using a directory-based coherency protocol at all levels. Taking HA as an example, the HA records the backup of the data in the upper Cache (for example, L3) by establishing a directory in the directory cache. The directory records the address of the cache in which the data is stored in the upper Cache, and the data is in the directory. The backup status in the Cache. If the processor needs to operate on a certain data, the Cache address for storing the certain data may be obtained by querying the directory, and the certain data in the Cache is performed according to the backup status of the certain data and the indication of the operation. Corresponding processing.
随着处理器芯片核数的增加,片上Cache容量也迅速增加,每个处理器芯片的片上缓存可以高达几十兆字节(Mega Byte,MB),多片时总容量甚至达百MB级,故而HA、L1、L2以及L3等的目录容量是一个很大的问题。As the number of processor chip cores increases, the on-chip Cache capacity also increases rapidly. The on-chip cache of each processor chip can be up to tens of megabytes (Mega Byte, MB), and the total capacity of multiple chips can reach even 100 MB. Therefore, the directory capacity of HA, L1, L2, and L3 is a big problem.
本申请实施例中,以HA为例。HA的目录采用精确目录,Sparse结构,并将目录存储在片上静态随机存取存储器(Static Random Access Memory,SRAM)中,但考虑到处理器系统通常对指令的修改较少,故而本申请实施例所描述的存储处理方法针对指令和数据类型的请求,分别使用不同的处理策略,达到有效降低目录容量开销或者在同等目录容量下,提升有效扩容比的目的。基于以上所述,本申请实施例所描述的存储处理方法基于以下思想:1、HA接收处理器发送的访存请求,该访存请求携带有指令或数据类型指示。2、HA根据该访存请求的类型指示,对指令和数据类型的访存请求采用不同的处理策略。3、对于数据类型的访存请求,无论该访存请求所请求的目标数据的状态为E态,还是S态,若查 询HA目录未命中,则新建目录项并响应该访存请求进行响应处理,新建的目录项用于记录该访存请求所对应的目标数据存放在哪个或哪些Cache中。4、对于指令类型的访存请求,若该访存请求所请求的目标数据的状态为S态,则查询目录未命中后不建立目录,只响应该访存请求进行响应处理;若该访存请求所请求的目标数据的状态为E态,查询HA目录未命中后新建目录,并广播侦听且响应该访存请求进行响应处理。In the embodiment of the present application, HA is taken as an example. The HA directory uses an accurate directory, a Sparse structure, and stores the directory in an on-chip static random access memory (SRAM), but in view of the fact that the processor system usually has fewer modifications to the instructions, the embodiment of the present application The described storage processing method uses different processing strategies for the instruction and data type requests respectively, so as to effectively reduce the directory capacity overhead or increase the effective expansion ratio under the same directory capacity. Based on the above, the storage processing method described in the embodiment of the present application is based on the following ideas: 1. The HA receives a memory access request sent by the processor, and the memory access request carries an instruction or a data type indication. 2. According to the type indication of the memory access request, the HA adopts different processing strategies for the memory access request of the instruction and the data type. 3. For the data type access request, whether the state of the target data requested by the memory access request is the E state or the S state, if the HA directory is missed, the new directory entry is newly created and responded to the memory access request. The newly created directory entry is used to record in which cache or caches the target data corresponding to the memory access request is stored. 4. For the fetch request of the instruction type, if the state of the target data requested by the fetch request is S state, the directory is not created after the query directory is missed, and only the response request is processed in response to the fetch request; The status of the requested target data is E state, the new directory is queried after the HA directory is missed, and the listener is broadcasted and responded to in response to the memory access request.
本申请实施例所描述的一种存储处理方法在硬件实现上,可划分为请求解析单元、目录查询单元、目录更新/建立单元、侦听发送单元和请求处理单元,如图2所示。请求解析单元用于对访存请求的请求类型进行解析,判断该访存请求的请求类型是指令类型还是数据类型,以及判断该访存请求所请求的目标数据的备份状态为E态还是S态等。目录查询单元用于根据该访存请求携带的目标数据标识查询是否已经建立与该目标数据所对应的目录。目录更新/建立单元用于根据该访存请求的请求类型,并结合原始的目录值,产生新的目录值。侦听发送单元用于发送侦听请求并收集侦听响应。请求处理单元用于根据请求类型,完成协议规定的动作。A storage processing method described in the embodiment of the present application can be divided into a request parsing unit, a directory query unit, a directory update/establishment unit, a snooping sending unit, and a request processing unit in hardware implementation, as shown in FIG. 2 . The request parsing unit is configured to parse the request type of the memory access request, determine whether the request type of the memory access request is an instruction type or a data type, and determine whether the backup status of the target data requested by the memory access request is an E state or an S state. Wait. The directory query unit is configured to identify, according to the target data carried by the memory access request, whether the directory corresponding to the target data has been established. The directory update/establishment unit is configured to generate a new directory value according to the request type of the memory access request and in combination with the original directory value. The listening sender unit is used to send a listening request and collect a listening response. The request processing unit is configured to complete the actions specified by the protocol according to the type of request.
本申请实施例中,执行主体以HA为例来说明,若各级缓存L1、L2、L3等执行主体实施本申请实施例所描述的存储处理方法,则以此类推。In the embodiment of the present application, the execution subject is described by taking the HA as an example. If the execution entities of the caches L1, L2, and L3 implement the storage processing method described in the embodiment of the present application, and so on.
请参见图3,图3是本申请实施例提供的一种存储处理方法,该方法可以应用于图1所示的Cache结构中。该方法包括但不限于如下步骤:Referring to FIG. 3, FIG. 3 is a storage processing method provided by an embodiment of the present application, and the method may be applied to the Cache structure shown in FIG. 1. The method includes but is not limited to the following steps:
S301、HA在接收到访存请求时,检测所述访存请求的请求类型。S301. The HA detects a request type of the memory access request when receiving the memory access request.
本申请实施例中,HA接收到的访存请求可以是由中央处理器(Central Processing Unit,CPU)发出的,该访存请求携带有请求类型标记,以及携带有该访存请求所请求的目标数据的备份状态标记。该请求类型标记包括指令类型标记、数据类型标记;该备份状态标记包括第一备份状态标记、第二备份状态标记。该第一备份状态可以是独享状态E态,该第二备份状态可以是共享状态S态。需要说明的是,该访存请求也可以是由其他类型的处理器发出的。In the embodiment of the present application, the memory access request received by the HA may be sent by a central processing unit (CPU), where the memory access request carries a request type tag, and carries the target requested by the memory access request. The backup status flag for the data. The request type tag includes an instruction type tag, a data type tag; the backup status tag includes a first backup status flag, and a second backup status flag. The first backup state may be an exclusive state E state, and the second backup state may be a shared state S state. It should be noted that the memory access request may also be issued by other types of processors.
具体地,HA在接收到访存请求时,基于该访存请求所携带的请求类型标记检测该访存请求的请求类型。其中,该访存请求的请求类型包括数据类型(即数据请求)和指令类型(即指令请求),数据类型的请求用于请求数据,包括用于读取数据或者写入数据等;指令类型的请求用于请求指令,包括用于读取指令或者写入指令等。Specifically, when receiving the memory access request, the HA detects the request type of the memory access request based on the request type identifier carried by the memory access request. The request type of the memory access request includes a data type (ie, a data request) and an instruction type (ie, an instruction request), and the data type request is used to request data, including for reading data or writing data, etc.; The request is for a request instruction, including for reading an instruction or writing an instruction.
S302、若所述HA检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为独享状态,则根据第一处理策略的指示对所述访存请求执行响应处理。S302. If the HA detects that the memory access request is an instruction request, and detects that the backup status of the target data requested by the memory access request is an exclusive state, the access is performed according to the indication of the first processing policy. The save request performs response processing.
本申请实施例中,该目标数据包括目标指令,若HA基于该访存请求所携带的请求类型标记检测到该访存请求为指令请求,且基于该访存请求携带的该目标数据的备份状态标记检测到该访存请求所请求的目标指令的备份状态为独享状态,则根据第一处理策略的指示对该访存请求执行响应处理。该第一处理策略指示的响应处理方式包括:首先,HA根据该访存请求建立与该目标指令对应的第一目录项,该第一目录项记录了存放该目标指令的Cache的缓存标识以及该目标指令的备份状态,该缓存标识可以是存放该目标指令的Cache 的地址,也可以是该Cache的序号。其次,HA根据该目标指令的标识对其管理的Cache进行广播侦听,并接收Cache针对该广播侦听的侦听响应,该目标指令的标识可以是该目标指令的物理内存地址。然后,HA根据接收到的侦听响应得到第一集合,该第一集合包括一个或者多个存放该目标指令的Cache的缓存标识,该缓存标识可以是该Cache的地址。接着,HA根据该第一集合中的缓存标识查询该第一目录项,若查询到该第一集合中有未包括在该第一目录项中的缓存标识,则回收存放有该目标指令但缓存标识未包含在该第一目录项中的Cache对于该目标指令的权限,即对目标指令进行无效处理。最后,HA根据指令请求的指示,以及协议规定的独享状态的目标指令所允许的操作对该目标指令执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作(例如握手动作)等。以备份状态为E态为例,对于备份状态为E态的指令来说,允许被读取、写入、修改以及其他协议规定的动作。In the embodiment of the present application, the target data includes a target instruction, and if the HA detects the access request as an instruction request based on the request type tag carried by the memory access request, and based on the backup status of the target data carried by the memory access request The flag detects that the backup state of the target instruction requested by the memory access request is an exclusive state, and performs a response process on the memory access request according to the indication of the first processing policy. The response processing manner indicated by the first processing policy includes: first, the HA establishes a first directory entry corresponding to the target instruction according to the memory access request, where the first directory entry records a cache identifier of the cache storing the target instruction, and the The backup status of the target instruction. The cache identifier may be the address of the Cache that stores the target instruction, or may be the sequence number of the Cache. Secondly, the HA broadcasts the Cache of the managed Cache according to the identifier of the target instruction, and receives the Cache response of the Cache for the broadcast interception. The identifier of the target instruction may be a physical memory address of the target instruction. Then, the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the cache storing the target instruction, and the cache identifier may be an address of the cache. Then, the HA queries the first directory entry according to the cache identifier in the first set. If the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored. The Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction. Finally, the HA performs a response process on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the exclusive state specified by the protocol, the response processing including reading, writing, modifying, and protocol-defined actions (eg, handshake Action) and so on. Taking the backup state as the E state as an example, for an instruction whose backup state is the E state, operations specified by reading, writing, modifying, and other protocols are allowed.
S303、若所述HA检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为共享状态,则根据第二处理策略的指示对所述访存请求执行响应处理。S303. If the HA detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is a shared state, the memory is accessed according to the indication of the second processing policy. Request to perform response processing.
本申请实施例中,该第一处理策略指示的响应处理方式和该第二处理策略指示的响应处理方式不同,该目标数据包括目标指令。In the embodiment of the present application, the response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy, and the target data includes a target instruction.
具体地,若HA基于该访存请求所携带的请求类型标记检测到该访存请求为指令请求,且基于该访存请求携带的该目标数据的备份状态标记检测到该访存请求所请求的目标指令的备份状态为共享状态,则根据第二处理策略的指示对该访存请求执行响应处理。该第二处理策略指示的响应处理方式包括:HA根据指令请求的指示,以及协议规定的共享状态的目标指令所允许的操作对该目标指令执行响应处理,该响应处理包括读取以及协议规定的握手动作等。以备份状态为S态为例,对于备份状态为S态的指令来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。Specifically, if the HA detects that the memory access request is an instruction request based on the request type flag carried by the memory access request, and the backup status flag of the target data carried based on the memory access request detects the requested by the memory access request The backup state of the target instruction is a shared state, and the response processing is performed on the memory access request according to the indication of the second processing policy. The response processing manner indicated by the second processing policy includes: the HA performs a response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the sharing state specified by the protocol, where the response processing includes reading and protocol-specified Handshake action, etc. Taking the backup state as the S state as an example, for an instruction whose backup state is the S state, other operations specified by the protocol and the protocol are allowed, but other operations specified by the protocol such as writing and modification are not allowed.
在一些可行的实施方式中,若HA检测到该访存请求为数据请求,则无论该访存请求所请求的目标数据的备份状态为独享状态还是共享状态,都根据第三处理策略的指示对该访存请求执行响应处理。其中,该第三处理策略指示的响应处理方式可以和该第一处理策略指示的响应处理方式相同,也可以和该第一处理策略指示的响应处理方式不同。该第三处理策略指示的响应处理方式可以包括:首先,HA根据该访存请求新建与该目标数据对应的第二目录项,该第二目录项中包括存放该目标数据的Cache的缓存标识以及该目标数据的备份状态;然后HA根据数据请求的指示,以及协议规定的目标数据的备份状态所允许的操作对该目标数据执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作等。对于备份状态为E态的数据来说,允许被读取、写入、修改以及其他协议规定的动作;对于备份状态为S态的数据来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。In some feasible implementation manners, if the HA detects that the memory access request is a data request, whether the backup status of the target data requested by the memory access request is an exclusive state or a shared state, according to the indication of the third processing policy. A response process is performed on the memory access request. The response processing manner indicated by the third processing policy may be the same as the response processing manner indicated by the first processing policy, or may be different from the response processing manner indicated by the first processing policy. The response processing manner indicated by the third processing policy may include: first, the HA creates a second directory entry corresponding to the target data according to the memory access request, where the second directory entry includes a cache identifier of the cache that stores the target data, and The backup status of the target data; then the HA performs response processing on the target data according to an indication of the data request and an operation permitted by the backup status of the target data specified by the protocol, the response processing including reading, writing, modifying, and protocol provisioning The action and so on. For data whose backup status is E state, it is allowed to be read, written, modified, and the actions specified by other protocols; for data whose backup state is S state, it is allowed to read and other operations specified by the protocol, but not Other operations specified by the protocol such as writing, modification, etc. are allowed.
本申请实施例中,HA在接收到访存请求时,首先检测该访存请求的请求类型,以及检测该访存请求所请求的目标数据的备份状态,然后根据访存请求的请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type and target of the memory access request. The different backup states of the data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
请参见图4,图4是本申请实施例提供的另一种存储处理方法,该方法包括但不限于如下步骤:Referring to FIG. 4, FIG. 4 is another storage processing method provided by an embodiment of the present application, where the method includes but is not limited to the following steps:
S401、HA接收访存请求。S401. The HA receives the memory access request.
本申请实施例中,HA接收到的访存请求可以是由中央处理器发出的,该访存请求携带有请求类型标记,该请求类型标记包括指令类型标记、数据类型标记。需要说明的是,该访存请求也可以是由其他类型的处理器发出的。其中,该访存请求的请求类型包括数据类型,即数据请求、指令类型,即指令请求,数据类型的请求用于请求数据,包括用于读取数据或者写入数据等;指令类型的请求用于请求指令,包括用于读取指令或者写入指令等。In the embodiment of the present application, the memory access request received by the HA may be sent by the central processing unit, and the memory access request carries a request type tag, and the request type tag includes an instruction type tag and a data type tag. It should be noted that the memory access request may also be issued by other types of processors. The request type of the memory access request includes a data type, that is, a data request, an instruction type, that is, an instruction request, and a data type request is used for requesting data, including for reading data or writing data, etc.; The request instruction includes a read instruction or a write instruction.
S402、检测所述访存请求是否为指令请求,若否,则执行步骤S403、步骤S404;若是,则执行步骤S405及其后续步骤。S402. Detect whether the memory access request is an instruction request. If not, perform step S403 and step S404; if yes, perform step S405 and subsequent steps.
具体地,HA在接收到访存请求后,基于该访存请求所携带的请求类型标记检测该访存请求的请求类型,若检测得到该访存请求为数据请求,则执行步骤S403、步骤S404;若检测得到该访存请求为指令请求,则执行步骤S405及其后续步骤。Specifically, after receiving the access request, the HA detects the request type of the memory access request based on the request type identifier carried by the memory access request, and if the memory access request is detected as a data request, step S403 and step S404 are performed. If it is detected that the memory access request is an instruction request, step S405 and subsequent steps are performed.
S403、所述HA根据所述访存请求新建与所述访存请求所请求的目标数据对应的第二目录项。S403. The HA creates a second directory entry corresponding to the target data requested by the memory access request according to the memory access request.
本申请实施例中,若HA检测到该访存请求为数据请求,则无论该访存请求所请求的目标数据的备份状态为独享状态还是共享状态,都根据该访存请求新建与该访存请求所请求的目标数据对应的第二目录项。该第二目录包括存放该目标数据的Cache的缓存标识以及该目标数据的备份状态,该缓存标识可以是存放该目标数据的Cache的地址,也可以是该Cache的序号。In the embodiment of the present application, if the HA detects that the memory access request is a data request, the backup state of the target data requested by the memory access request is an exclusive state or a shared state, and the new access and the access are performed according to the memory access request. The second directory entry corresponding to the target data requested by the request is stored. The second directory includes a cache identifier of the cache that stores the target data and a backup state of the target data. The cache identifier may be an address of a cache that stores the target data, or may be a sequence number of the cache.
具体地,HA根据该访存请求携带的目标数据的标识查找HA所管理的Cache中是否有存放该目标数据的Cache,若有,则返回存放该目标数据的Cache的缓存标识以及该Cache中该目标数据的备份状态;若无,则将存储器中与该目标数据标识对应的数据加载到HA所管理的某个Cache中,并返回存放该目标数据的某个Cache的缓存标识以及该目标数据在该某个Cache中的备份状态。然后在HA的目录中建立与该目标数据对应的第二目录项,该第二目录项包括存放该目标数据的Cache的缓存标识以及该Cache中该目标数据的备份状态。需要说明的是,HA可以通过对其管理的Cache进行广播侦听查询其管理的Cache中是否有存放该目标数据的Cache。其中,该目标数据的标识可以是该目标数据的物理内存地址。Specifically, the HA searches for the Cache that stores the target data in the Cache managed by the HA according to the identifier of the target data carried in the memory access request, and if yes, returns a cache identifier of the Cache that stores the target data and the cache identifier in the Cache. The backup state of the target data; if not, the data corresponding to the target data identifier in the memory is loaded into a cache managed by the HA, and the cache identifier of a certain cache storing the target data is returned, and the target data is The backup status in this Cache. Then, a second directory entry corresponding to the target data is created in the directory of the HA, where the second directory entry includes a cache identifier of the cache that stores the target data and a backup state of the target data in the cache. It should be noted that the HA can perform a broadcast interception on the Cache managed by the HA to query whether the Cache managed by the Cache has a Cache for storing the target data. The identifier of the target data may be a physical memory address of the target data.
S404、所述HA对所述访存请求所请求的目标数据执行响应处理。S404. The HA performs a response process on the target data requested by the memory access request.
具体地,HA根据数据请求的指示,以及协议规定的目标数据的备份状态所允许的操作对该目标数据执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作等。对于备份状态为E态的数据来说,允许被读取、写入、修改以及其他协议规定的动作;对于备份状态为S态的数据来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。Specifically, the HA performs response processing on the target data according to an instruction of the data request and an operation permitted by the backup state of the target data specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol. For data whose backup status is E state, it is allowed to be read, written, modified, and the actions specified by other protocols; for data whose backup state is S state, it is allowed to read and other operations specified by the protocol, but not Other operations specified by the protocol such as writing, modification, etc. are allowed.
S405、所述HA检测所述访存请求所请求的目标数据的备份状态是否为独享状态,若否,则执行步骤S406;若是,则执行步骤S407~步骤S409。S405. The HA detects whether the backup status of the target data requested by the memory access request is an exclusive state. If not, step S406 is performed; if yes, steps S407 to S409 are performed.
本申请实施例中,该访存请求还携带有该访存请求所请求的目标数据的备份状态标记。该备份状态标记包括第一备份状态标记、第二备份状态标记。该第一备份状态可以是独享状态E态,该第二备份状态可以是共享状态S态。该目标数据包括目标指令。In the embodiment of the present application, the memory access request further carries a backup status flag of the target data requested by the memory access request. The backup status flag includes a first backup status flag and a second backup status flag. The first backup state may be an exclusive state E state, and the second backup state may be a shared state S state. The target data includes target instructions.
具体地,HA基于该访存请求所携带的该目标数据的备份状态标记检测该访存请求所请求的目标指令的备份状态,若HA检测得到该目标指令的备份状态为共享状态,则执行步骤S405;若HA检测得到该目标指令的备份状态为独享状态,则执行步骤S407~步骤S409。Specifically, the HA detects the backup status of the target instruction requested by the memory access request based on the backup status flag of the target data carried by the memory access request. If the HA detects that the backup status of the target instruction is the shared status, the step is performed. S405. If the HA detects that the backup state of the target command is the exclusive state, step S407 to step S409 are performed.
S406、所述HA对所述访存请求所请求的目标数据执行响应处理。S406. The HA performs a response process on the target data requested by the memory access request.
具体地,若HA检测到该访存请求所请求的目标指令的备份状态为共享状态,则根据指令请求的指示,以及协议规定的共享状态的目标指令所允许的操作对该目标指令执行响应处理,该响应处理包括读取以及协议规定的握手动作等。对于备份状态为S态的指令来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。Specifically, if the HA detects that the backup state of the target instruction requested by the memory access request is a shared state, performing response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the shared state specified by the protocol. The response processing includes reading and a handshake action specified by the protocol. For an instruction whose backup state is S state, it is allowed to read and other operations specified by the protocol, but other operations specified by the protocol such as writing, modification, etc. are not allowed.
S407、所述HA根据所述访存请求新建与所述目标数据对应的第一目录项。S407. The HA newly creates a first directory entry corresponding to the target data according to the memory access request.
本申请实施例中,若HA基于该访存请求携带的该目标数据的备份状态标记检测得到该访存请求所请求的目标指令的备份状态为独享状态,则根据该访存请求建立与该目标指令对应的第一目录项,此步骤的具体过程可参考步骤S403中的描述,在此不再赘述,该第一目录项记录了存放该目标指令的Cache的缓存标识以及该目标指令的备份状态。In the embodiment of the present application, if the HA detects that the backup status of the target instruction requested by the memory access request is an exclusive state based on the backup status flag of the target data carried in the memory access request, the HA establishes the The first directory entry corresponding to the target instruction, the specific process of this step may refer to the description in step S403, and details are not described herein again. The first directory entry records the cache identifier of the cache storing the target instruction and the backup of the target instruction. status.
S408、所述HA对管理的Cache进行广播侦听,并根据接收到的各个Cache针对所述广播侦听返回的侦听响应对所述目标数据进行回收处理。S408: The HA performs broadcast interception on the managed Cache, and performs recovery processing on the target data according to the received listening response returned by each Cache for the broadcast interception.
具体地,首先,HA根据该目标指令的标识对其管理的Cache进行广播侦听,并接收各个Cache针对该广播侦听的侦听响应。然后,HA根据接收到的侦听响应得到第一集合,该第一集合包括一个或者多个存放该目标指令的Cache的缓存标识。接着,HA根据该第一集合中的缓存标识查询该第一目录项,若查询到该第一集合中有未包括在该第一目录项中的缓存标识,则回收存放有该目标指令但缓存标识未包含在该第一目录项中的Cache对于该目标指令的权限,即对目标指令进行无效处理。以备份状态为独享状态E态为例,对于备份状态为E态的数据或者指令,此类数据或者指令只允许备份到某一个Cache中,故而进行广播侦听的目的是为了查询是否还有其他的Cache中备份有该E态数据或者指令,若有,则回收其他Cache对于该E态数据或者指令的权限,即对其他Cache中的该E态数据或者指令进行无效处理。Specifically, first, the HA performs broadcast interception on the Cache managed by the HA according to the identifier of the target instruction, and receives a listening response of each Cache for the broadcast interception. Then, the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the Cache storing the target instruction. Then, the HA queries the first directory entry according to the cache identifier in the first set. If the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored. The Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction. Take the backup state as the exclusive state E state as an example. For data or instructions whose backup state is the E state, such data or instructions can only be backed up to a certain cache. Therefore, the purpose of broadcast interception is to query whether there is still The other Caches back up the E-state data or instructions, and if so, the other Caches are reclaimed for the E-state data or instructions, that is, the E-state data or instructions in other Caches are invalidated.
S409、所述HA对所述访存请求所请求的目标数据执行响应处理。S409. The HA performs a response process on the target data requested by the memory access request.
具体地,HA根据指令请求的指示,以及协议规定的独享状态的目标指令所允许的操作对该目标指令执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作等。对于备份状态为E态的指令来说,允许被读取、写入、修改以及其他协议规定的动作。Specifically, the HA performs response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the exclusive state specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol. For instructions whose backup state is E, the actions specified by the read, write, modify, and other protocols are allowed.
本申请实施例中,在一些可行的实施方式中,HA在接收到访存请求时,可以先检测该访存请求所请求的目标数据的备份状态,若检测到该目标数据的备份状态为独享状态,则执行步骤S407~步骤S409;若检测到该目标数据的备份状态为共享状态,则检测该访存请求是否为指令请求,若是,则对该访存请求所请求的目标指令执行响应处理,若否,则执行步骤S403、步骤S404。In the embodiment of the present application, in some feasible implementation manners, when receiving the access request, the HA may first detect the backup status of the target data requested by the memory access request, and if the backup status of the target data is detected as independent If the state of the target data is detected as a shared state, detecting whether the memory access request is an instruction request, and if yes, executing a response to the target instruction requested by the memory access request Processing, if no, executing steps S403 and S404.
本申请实施例中,HA在接收到访存请求时,首先检测该访存请求的请求类型,以及检 测该访存请求所请求的目标数据的备份状态,然后根据访存请求的请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type and target of the memory access request. The different backup states of the data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
请参见图5,图5是本申请实施例提供的又一种存储处理方法,该方法包括但不限于如下步骤:Referring to FIG. 5, FIG. 5 is still another storage processing method provided by an embodiment of the present application, where the method includes but is not limited to the following steps:
S501、HA接收访存请求。S501. The HA receives the memory access request.
本申请实施例中,HA接收到的访存请求可以是由中央处理器发出的,该访存请求携带有请求类型标记,以及携带有该访存请求所请求的目标数据的备份状态标记。该请求类型标记包括指令类型标记、数据类型标记;该备份状态标记包括第一备份状态标记、第二备份状态标记。该第一备份状态可以是独享状态E态,该第二备份状态可以是共享状态S态。需要说明的是,该访存请求也可以是由其他类型的处理器发出的。In the embodiment of the present application, the memory access request received by the HA may be sent by the central processing unit, and the memory access request carries a request type tag and a backup status flag carrying the target data requested by the memory access request. The request type tag includes an instruction type tag, a data type tag; the backup status tag includes a first backup status flag, and a second backup status flag. The first backup state may be an exclusive state E state, and the second backup state may be a shared state S state. It should be noted that the memory access request may also be issued by other types of processors.
S502、所述HA检测预置目录中是否包括与所述访存请求所请求的目标数据对应的第三目录项,若检测结果为包括,则确定命中数据,并执行步骤S503;若检测结果为不包括,则确定未命中数据,并执行步骤S504及其后续步骤。S502, the HA detects whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory, and if the detection result is included, determining the hit data, and performing step S503; If not, the miss data is determined, and step S504 and its subsequent steps are performed.
本申请实施例中,该目标数据可以是数据也可以是指令。具体地,HA在接收到访存请求后,根据该访存请求携带的目标数据标识查询HA预置目录中已有的目录项是否包括与该访存请求所请求的目标数据对应的第三目录项,若是,则执行步骤S503;若否,则执行步骤S504及其后续步骤。其中,该目标数据的标识可以是该目标数据的物理内存地址,该第三目录项记录了存放该目标数据的Cache的缓存标识以及该目标数据的备份状态,该缓存标识可以是存放该目标数据的Cache的地址,也可以是该Cache的序号。In the embodiment of the present application, the target data may be data or an instruction. Specifically, after receiving the access request, the HA queries, according to the target data identifier carried in the memory access request, whether the directory entry existing in the HA preset directory includes a third directory corresponding to the target data requested by the memory access request. If yes, step S503 is performed; if no, step S504 and subsequent steps are performed. The identifier of the target data may be a physical memory address of the target data, and the third directory entry records a cache identifier of the cache storing the target data and a backup status of the target data, where the cache identifier may be the target data. The address of the Cache can also be the sequence number of the Cache.
S503、所述HA根据所述访存请求更新所述第三目录项并响应所述访存请求执行响应处理。S503. The HA updates the third directory entry according to the memory access request and performs response processing in response to the memory access request.
具体地,HA首先根据该目标数据的标识查询HA所管理的Cache,并根据查询到的存放该目标数据的Cache的缓存标识得到第二集合,该第二集合包括一个或者多个存放该目标数据的Cache的缓存标识;然后HA根据该第二集合中的缓存标识查询该第三目录项,若查询到该第二集合中有未包括在该第三目录项中的缓存标识,则对该第三目录项进行更新处理。该更新处理包括在该第三目录项中添加与该第二集合中有但未包括在该第三目录项中的缓存标识对应的条目。最后,在更新完该第三目录项之后,HA根据该访存请求的类型,以及协议规定的目标数据的备份状态所允许的操作对该访存请求所请求的目标数据进行响应处理,该响应处理包括读取、写入、修改以及协议规定的握手动作等。Specifically, the HA first queries the Cache managed by the HA according to the identifier of the target data, and obtains a second set according to the cached identifier of the Cache that stores the target data, and the second set includes one or more of the target data. Cache identifier of the Cache; then the HA queries the third directory entry according to the cache identifier in the second set, and if the second set contains the cache identifier not included in the third directory entry, the first The three directory entries are updated. The update process includes adding an entry in the third directory entry that corresponds to a cache identifier in the second set that is not included in the third directory entry. Finally, after updating the third directory entry, the HA responds to the target data requested by the memory access request according to the type of the memory access request and the operation of the backup state of the target data specified by the protocol, and the response is processed. Processing includes reading, writing, modifying, and protocol-defined handshake actions.
S504、所述HA检测所述访存请求是否为指令请求,若否,则执行步骤S505;若是,则执行步骤S506及其后续步骤。S504. The HA detects whether the memory access request is an instruction request. If not, step S505 is performed; if yes, step S506 and subsequent steps are performed.
具体地,HA基于该访存请求所携带的请求类型标记检测该访存请求的请求类型,若检测得到该访存请求为数据请求,则执行步骤S505;若检测得到该访存请求为指令请求,则执行步骤S506及其后续步骤。Specifically, the HA detects the request type of the memory access request based on the request type tag carried by the memory access request, and if it is detected that the memory access request is a data request, step S505 is performed; if the memory access request is detected as an instruction request Then, step S506 and subsequent steps are performed.
S505、所述HA根据第三处理策略的指示对所述访存请求执行响应处理。S505. The HA performs a response process on the memory access request according to the indication of the third processing policy.
本申请实施例中,若HA检测到该访存请求为数据请求,则无论该访存请求所请求的 目标数据的备份状态为独享状态还是共享状态,都首先根据该访存请求新建与该访存请求所请求的目标数据对应的第二目录项。该第二目录包括存放该目标数据的Cache的缓存标识以及该目标数据的备份状态。In the embodiment of the present application, if the HA detects that the memory access request is a data request, the backup state of the target data requested by the memory access request is an exclusive state or a shared state, and the new The second directory entry corresponding to the target data requested by the fetch request. The second directory includes a cache identifier of the cache storing the target data and a backup status of the target data.
具体地,HA根据该访存请求携带的目标数据的标识查找HA所管理的Cache中是否有存放该目标数据的Cache,若有,则返回存放该目标数据的Cache的缓存标识以及该Cache中该目标数据的备份状态;若无,则将存储器中与该目标数据标识对应的数据加载到HA所管理的某个Cache中,并返回存放该目标数据的某个Cache的缓存标识以及该目标数据在该某个Cache中的备份状态。然后在HA的目录中建立与该目标数据对应的第二目录项,该第二目录项包括存放该目标数据的Cache的缓存标识以及该Cache中该目标数据的备份状态。需要说明的是,HA可以通过对其管理的Cache进行广播侦听查询其管理的Cache中是否有存放该目标数据的Cache。Specifically, the HA searches for the Cache that stores the target data in the Cache managed by the HA according to the identifier of the target data carried in the memory access request, and if yes, returns a cache identifier of the Cache that stores the target data and the cache identifier in the Cache. The backup state of the target data; if not, the data corresponding to the target data identifier in the memory is loaded into a cache managed by the HA, and the cache identifier of a certain cache storing the target data is returned, and the target data is The backup status in this Cache. Then, a second directory entry corresponding to the target data is created in the directory of the HA, where the second directory entry includes a cache identifier of the cache that stores the target data and a backup state of the target data in the cache. It should be noted that the HA can perform a broadcast interception on the Cache managed by the HA to query whether the Cache managed by the Cache has a Cache for storing the target data.
然后,HA根据数据请求的指示,以及协议规定的目标数据的备份状态所允许的操作对该目标数据执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作等。对于备份状态为E态的数据来说,允许被读取、写入、修改以及其他协议规定的动作;对于备份状态为S态的数据来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。Then, the HA performs response processing on the target data according to an instruction of the data request and an operation permitted by the backup state of the target data specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol. For data whose backup status is E state, it is allowed to be read, written, modified, and the actions specified by other protocols; for data whose backup state is S state, it is allowed to read and other operations specified by the protocol, but not Other operations specified by the protocol such as writing, modification, etc. are allowed.
S506、所述HA检测所述访存请求所请求的目标数据的备份状态是否为独享状态,若否,则执行步骤S507;若是,则执行步骤S508。S506. The HA detects whether the backup status of the target data requested by the memory access request is an exclusive state. If not, step S507 is performed; if yes, step S508 is performed.
具体地,HA基于该访存请求所携带的该访存请求所请求的目标数据的备份状态标记检测该访存请求所请求的该目标指令的备份状态。若HA检测得到该目标指令的备份状态为共享状态,则执行步骤S507;若HA检测得到该目标数据的备份状态为独享备份状态,则执行步骤S508。Specifically, the HA detects a backup status of the target instruction requested by the memory access request based on a backup status flag of the target data requested by the memory access request carried by the memory access request. If the HA detects that the backup state of the target command is the shared state, step S507 is performed; if the HA detects that the backup state of the target data is the exclusive backup state, step S508 is performed.
S507、所述HA根据第二处理策略的指示对所述访存请求执行响应处理。S507. The HA performs a response process on the memory access request according to the indication of the second processing policy.
具体地,若HA检测到该访存请求所请求的目标指令的备份状态为共享状态,则根据指令请求的指示,以及协议规定的共享状态的目标指令所允许的操作对该目标指令执行响应处理,该响应处理包括读取以及协议规定的握手动作等。对于备份状态为S态的指令来说,允许读取以及协议规定的其他操作,但不允许写入、修改等协议规定的其他操作。Specifically, if the HA detects that the backup state of the target instruction requested by the memory access request is a shared state, performing response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the shared state specified by the protocol. The response processing includes reading and a handshake action specified by the protocol. For an instruction whose backup state is S state, it is allowed to read and other operations specified by the protocol, but other operations specified by the protocol such as writing, modification, etc. are not allowed.
S508、所述HA根据第一处理策略的指示对所述访存请求执行响应处理。S508. The HA performs a response process on the memory access request according to the indication of the first processing policy.
本申请实施例中,该第一处理策略指示的响应处理方式和该第二处理策略指示的响应处理方式不同。该第一处理策略指示的响应处理方式包括:首先,HA根据该访存请求建立与该访存请求所请求的目标指令对应的第一目录项,该第一目录项记录了存放该目标指令的Cache的缓存标识以及该目标指令的备份状态。其次,HA根据该目标指令的标识对其管理的Cache进行广播侦听,并接收Cache针对该广播侦听的侦听响应。然后,HA根据接收到的侦听响应得到第一集合,该第一集合包括一个或者多个存放该目标指令的Cache的缓存标识。接着,HA根据该第一集合中的缓存标识查询该第一目录项,若查询到该第一集合中有未包括在该第一目录项中的缓存标识,则回收存放有该目标指令但缓存标识未包含在该第一目录项中的Cache对于该目标指令的权限,即对目标指令进行无效处理。最后,HA根据指令请求的指示,以及协议规定的第一备份状态的目标指令所允许的操作对该目标指令 执行响应处理,该响应处理包括读取、写入、修改以及协议规定的动作等。需要说明的是,该第一处理策略指示的响应处理方式可参考上述实施例中步骤S407~步骤S409的描述,在此不再赘述。In the embodiment of the present application, the response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy. The response processing manner indicated by the first processing policy includes: first, the HA establishes, according to the memory access request, a first directory entry corresponding to the target instruction requested by the memory access request, where the first directory entry records the target instruction The cache ID of the Cache and the backup status of the target instruction. Secondly, the HA broadcasts the Cache of the managed Cache according to the identifier of the target instruction, and receives the Cache response of the Cache for the broadcast interception. Then, the HA obtains a first set according to the received listening response, and the first set includes one or more cache identifiers of the Cache storing the target instruction. Then, the HA queries the first directory entry according to the cache identifier in the first set. If the cache identifier that is not included in the first directory entry is found in the first set, the target instruction but the cache is reclaimed and stored. The Cache that is not included in the first directory entry identifies the authority of the target instruction, that is, invalidates the target instruction. Finally, the HA performs response processing on the target instruction according to an instruction of the instruction request and an operation permitted by the target instruction of the first backup state specified by the protocol, and the response processing includes reading, writing, modifying, and an action specified by the protocol. It should be noted that, the manner of the response processing indicated by the first processing policy may refer to the description of step S407 to step S409 in the foregoing embodiment, and details are not described herein again.
本申请实施例中,在一些可行的实施方式中,HA在接收到访存请求时,首先检测预置目录中是否包括与该访存请求所请求的目标数据对应的第三目录项,若是,则根据该访存请求更新该第三目录项并响应该访存请求执行响应处理;若否,则执行步骤S506,检测该访存请求所请求的目标数据的备份状态是否为独享状态;若是,则根据第一处理策略的指示对该访存请求执行响应处理;若否,则执行步骤S504,检测该访存请求是否为指令请求,若是,根据第二处理策略的指示对该访存请求执行响应处理;若否,则根据第三处理策略的指示对该访存请求执行响应处理。In the embodiment of the present application, in some feasible implementation manners, when receiving the access request, the HA first detects whether the preset directory includes a third directory entry corresponding to the target data requested by the memory access request, and if so, And updating the third directory entry according to the memory access request and performing a response process in response to the memory access request; if not, executing step S506, detecting whether the backup state of the target data requested by the memory access request is an exclusive state; And performing a response process on the memory access request according to the indication of the first processing policy; if not, executing step S504, detecting whether the memory access request is an instruction request, and if yes, requesting the memory access according to the indication of the second processing policy Executing a response process; if not, performing a response process on the memory access request according to an indication of the third processing policy.
本申请实施例中,HA在接收到访存请求时,首先检测该访存请求的请求类型,以及检测该访存请求所请求的目标数据的备份状态,然后根据访存请求的不同请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the access request, the HA first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to different request types of the memory access request and The different backup states of the target data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The above describes the method of the embodiment of the present application in detail, and the apparatus of the embodiment of the present application is provided below.
请参见图6,图6是本申请实施例提供的一种存储处理装置的结构示意图。其中,图6所示的存储处理装置可以包括检测模块601、执行模块602、接收模块603、更新模块604,其中,各个模块的详细描述如下。Referring to FIG. 6, FIG. 6 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present application. The storage processing device shown in FIG. 6 may include a detection module 601, an execution module 602, a receiving module 603, and an update module 604. The detailed description of each module is as follows.
检测模块601,用于在接收到访存请求时,检测所述访存请求的请求类型。The detecting module 601 is configured to detect a request type of the memory access request when receiving the memory access request.
执行模块602,用于若所述检测模块601检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为独享状态,则根据第一处理策略的指示对所述访存请求执行响应处理。The executing module 602 is configured to: if the detecting module 601 detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is an exclusive state, according to the first processing policy The indication performs a response process on the memory access request.
所述执行模块602,还用于若所述检测模块601检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为共享状态,则根据第二处理策略的指示对所述访存请求执行响应处理。The execution module 602 is further configured to: if the detecting module 601 detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is a shared state, according to the second An indication of the processing policy performs a response process on the fetch request.
其中,所述第一处理策略指示的响应处理方式和所述第二处理策略指示的响应处理方式不同。The response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy.
在一些可行的实施方式中,所述执行模块602,还用于若所述检测模块601检测到所述访存请求为数据请求,则根据第三处理策略的指示对所述访存请求执行响应处理。In some possible implementations, the executing module 602 is further configured to: if the detecting module 601 detects that the memory access request is a data request, perform a response to the memory access request according to an indication of a third processing policy. deal with.
在一些可行的实施方式中,所述执行模块602,包括:In some possible implementations, the executing module 602 includes:
第一新建单元6021,用于根据所述访存请求新建与所述目标数据对应的第一目录项,所述第一目录项记录了存放所述目标数据的Cache的缓存标识、所述目标数据的备份状态。The first new unit 6021 is configured to create a first directory entry corresponding to the target data according to the memory access request, where the first directory entry records a cache identifier of the cache storing the target data, and the target data. Backup status.
第一处理单元6022,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。The first processing unit 6022 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
在一些可行的实施方式中,所述执行模块602,还包括:In some possible implementations, the executing module 602 further includes:
侦听单元6023,用于根据所述目标数据对管理的Cache进行广播侦听,并接收各个Cache针对所述广播侦听返回的侦听响应。The listening unit 6023 is configured to perform broadcast interception on the managed Cache according to the target data, and receive a listening response returned by each Cache for the broadcast interception.
第一获取单元6024,用于根据所述侦听响应得到第一集合,所述第一集合包括一个或者多个存放所述目标数据的Cache的缓存标识。The first obtaining unit 6024 is configured to obtain a first set according to the listening response, where the first set includes one or more cache identifiers of the Cache storing the target data.
其中,所述第一处理单元6022,还用于若查询到所述第一集合中有未包括在所述第一目录项中的缓存标识,则对所述目标数据进行回收处理。The first processing unit 6022 is further configured to: if the cache identifier that is not included in the first directory entry is queried in the first set, perform the collection process on the target data.
在一些可行的实施方式中,所述执行模块602,还包括:In some possible implementations, the executing module 602 further includes:
第二处理单元6025,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。The second processing unit 6025 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
在一些可行的实施方式中,所述执行模块602,还包括:In some possible implementations, the executing module 602 further includes:
第二新建单元6026,用于根据所述访存请求新建与所述目标数据对应的第二目录项,所述第二目录项记录了存放所述目标数据的缓存Cache的缓存标识、所述目标数据的备份状态;a second new unit 6026, configured to create a second directory entry corresponding to the target data according to the memory access request, where the second directory entry records a cache identifier of the cache cache that stores the target data, and the target The backup status of the data;
第三处理单元6027,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。The third processing unit 6027 is configured to perform response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
在一些可行的实施方式中,所述装置还包括:In some possible implementations, the apparatus further includes:
接收模块603,用于接收访存请求。The receiving module 603 is configured to receive a memory access request.
所述检测模块602,还用于检测预置目录中是否包括与所述访存请求所请求的目标数据对应的第三目录项。The detecting module 602 is further configured to detect whether the third directory entry corresponding to the target data requested by the memory access request is included in the preset directory.
所述检测模块602,还用于若检测结果为不包括,则确定未命中数据,执行所述检测所述访存请求的请求类型的步骤。The detecting module 602 is further configured to: if the detection result is not included, determine the miss data, and perform the step of detecting the request type of the memory access request.
在一些可行的实施方式中,所述检测模块602,还用于若检测结果为包括与所述访存请求所请求的目标数据对应的第三目录项,则确定命中数据,所述装置还包括:In some possible implementations, the detecting module 602 is further configured to: if the detection result is a third directory entry corresponding to the target data requested by the memory access request, determine hit data, the device further includes :
更新模块604,用于根据所述访存请求更新所述第三目录项。The update module 604 is configured to update the third directory entry according to the memory access request.
所述更新模块604,包括:The update module 604 includes:
第二获取单元6041,用于根据所述目标数据得到第二集合,所述第二集合包括一个或者多个存放所述目标数据的Cache的缓存标识。The second obtaining unit 6041 is configured to obtain a second set according to the target data, where the second set includes one or more cache identifiers of the Cache storing the target data.
更新单元6042,用于若查询到所述第二集合中有未包括在所述第三目录项中的缓存标识,则对所述第三目录项进行更新处理。The updating unit 6042 is configured to perform an update process on the third directory item if the cache identifier that is not included in the third directory entry is queried in the second set.
需要说明的是,本申请实施例的存储处理装置的各功能模块、单元的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It should be noted that the functions of the functional modules and the units of the storage processing apparatus in the embodiments of the present application may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments. Let me repeat.
本申请实施例中,接收模块603在接收到访存请求时,触发检测模块601检测该访存请求的请求类型,以及检测该访存请求所请求的目标数据的备份状态,然后触发执行模块602根据访存请求的不同请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the access request, the receiving module 603 triggers the detection module 601 to detect the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then triggers the execution module 602. According to different request types of the memory access request and different backup states of the target data, different policies are used to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
请参见图7,图7是本申请实施例提供的一种存储处理装置的结构示意图,本申请实施例中所描述的存储处理装置包括:处理器701、存储器702。其中,处理器701、存储器 702可通过总线或其他方式连接,本申请实施例以通过总线连接为例。Referring to FIG. 7, FIG. 7 is a schematic structural diagram of a storage processing apparatus according to an embodiment of the present disclosure. The storage processing apparatus described in the embodiment of the present application includes: a processor 701 and a memory 702. The processor 701 and the memory 702 can be connected by using a bus or other manners. The embodiment of the present application is exemplified by a bus connection.
其中,处理器701(例如中央处理器(Central Processing Unit,CPU))是存储处理装置的计算核心以及控制核心。存储器702(Memory)是存储处理装置的记忆设备,用于存放程序和数据。可以理解的是,此处的存储器702可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器701的存储装置。存储器702提供存储空间,该存储空间存储了存储处理装置的操作系统和可执行程序代码,可包括但不限于:Windows系统(一种操作系统)、Linux(一种操作系统)系统等等,本申请对此并不作限定。The processor 701 (for example, a central processing unit (CPU)) is a computing core and a control core of the storage processing device. The memory 702 (Memory) is a memory device of the storage processing device for storing programs and data. It can be understood that the memory 702 herein may be a high speed RAM memory, or may be a non-volatile memory, such as at least one disk memory; optionally, at least one of the processors 701 may be located away from the foregoing processor 701. Storage device. The memory 702 provides a storage space, which stores an operating system and executable program code of the storage processing device, and may include, but is not limited to, a Windows system (an operating system), a Linux (an operating system) system, and the like. The application is not limited.
在本申请实施例中,处理器701通过运行存储器702中的可执行程序代码,执行如下操作:In the embodiment of the present application, the processor 701 performs the following operations by running the executable program code in the memory 702:
处理器701,用于在接收到访存请求时,检测所述访存请求的请求类型。The processor 701 is configured to detect a request type of the memory access request when receiving the memory access request.
所述处理器701,还用于若检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为独享状态,则根据第一处理策略的指示对所述访存请求执行响应处理。The processor 701 is further configured to: if detecting that the memory access request is an instruction request, and detecting that the backup state of the target data requested by the memory access request is an exclusive state, according to the indication of the first processing policy A response process is performed on the memory access request.
所述处理器701,还用于若检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为共享状态,则根据第二处理策略的指示对所述访存请求执行响应处理。The processor 701 is further configured to: if detecting that the memory access request is an instruction request, and detecting that the backup state of the target data requested by the memory access request is a shared state, according to the indication of the second processing policy The memory access request performs a response process.
其中,所述第一处理策略和所述第二处理策略不同。The first processing policy and the second processing policy are different.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
若检测到所述访存请求的为数据请求,则根据第三处理策略的指示对所述访存请求执行响应处理。If it is detected that the memory access request is a data request, the response processing is performed on the memory access request according to the indication of the third processing policy.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
根据所述访存请求新建与所述目标数据对应的第一目录项,所述第一目录项记录了存放所述目标数据的Cache的缓存标识、所述目标数据的备份状态。The first directory entry corresponding to the target data is newly created according to the access request, and the first directory entry records a cache identifier of the cache that stores the target data, and a backup state of the target data.
根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And performing response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
根据所述目标数据对管理的Cache进行广播侦听,并接收各个Cache针对所述广播侦听返回的侦听响应。Performing broadcast listening on the managed Cache according to the target data, and receiving a listening response returned by each Cache for the broadcast interception.
根据所述侦听响应得到第一集合,所述第一集合包括一个或者多个存放所述目标数据的Cache的缓存标识。Obtaining a first set according to the listening response, where the first set includes one or more cache identifiers of a cache storing the target data.
若查询到所述第一集合中有未包括在所述第一目录项中的缓存标识,则对所述目标数据进行回收处理。If the cache identifier that is not included in the first directory entry is found in the first set, the target data is recycled.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
根据所述访存请求新建与所述目标数据对应的第二目录项,所述第二目录项记录了存放所述目标数据的缓存Cache的缓存标识、所述目标数据的备份状态;并根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And creating, by the fetching request, a second directory entry corresponding to the target data, where the second directory entry records a cache identifier of the cache cache that stores the target data, and a backup state of the target data; Determining the type of the memory request and the backup status of the target data, and performing response processing on the target data requested by the memory access request.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
接收访存请求,并检测预置目录中是否包括与所述访存请求所请求的目标数据对应的第三目录项;若检测结果为不包括,则确定未命中数据,执行所述检测所述访存请求的请求类型的步骤。Receiving a memory access request, and detecting whether a third directory entry corresponding to the target data requested by the memory access request is included in the preset directory; if the detection result is not included, determining the miss data, performing the detecting The step of fetching the request type of the request.
在一些可行的实施方式中,所述处理器701,还用于:In some possible implementations, the processor 701 is further configured to:
若检测结果为包括与所述访存请求所请求的目标数据对应的第三目录项,则确定命中数据,并根据所述访存请求更新所述第三目录项。If the detection result is a third directory entry corresponding to the target data requested by the memory access request, the hit data is determined, and the third directory entry is updated according to the memory access request.
在一些可行的实施方式中,所述处理器701,具体用于:In some possible implementations, the processor 701 is specifically configured to:
根据所述目标数据得到第二集合,所述第二集合包括一个或者多个存放所述目标数据的Cache的缓存标识;若查询到所述第二集合中有未包括在所述第三目录项中的缓存标识,则对所述第三目录项进行更新处理。Determining, according to the target data, a second set, where the second set includes one or more cache identifiers of the cache storing the target data; if the second set of entries in the second set is not included in the third directory entry In the cache identifier, the third directory entry is updated.
具体实现中,本申请实施例中所描述的处理器701、存储器702可执行本申请实施例图3、图4或图5提供的一种存储处理方法的流程中所描述的实现方式,也可执行本申请实施例图6提供的一种存储处理装置中所描述的实现方式,在此不再赘述。In a specific implementation, the processor 701 and the memory 702 described in the embodiment of the present application may be implemented in the process of the storage processing method provided in FIG. 3, FIG. 4 or FIG. 5 of the embodiment of the present application, and may also be implemented. The implementations described in the storage processing apparatus provided in FIG. 6 of the embodiment of the present application are not described herein.
本申请实施例中,处理器701在接收到访存请求时,首先检测该访存请求的请求类型,以及检测该访存请求所请求的目标数据的备份状态,然后根据访存请求的请求类型以及目标数据的不同备份状态采用不同的策略对访存请求执行响应处理。从而可以针对数据的不同备份状态对数据进行针对性处理,在一定程度上节省终端的软硬件资源,提高存储效率。In the embodiment of the present application, when receiving the memory access request, the processor 701 first detects the request type of the memory access request, and detects the backup status of the target data requested by the memory access request, and then according to the request type of the memory access request. And different backup states of the target data use different strategies to perform response processing on the memory access request. Therefore, the data can be targeted for different backup states of the data, which saves the software and hardware resources of the terminal to a certain extent and improves storage efficiency.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘、磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wire (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, microwave, etc.). The computer readable storage medium can be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that includes one or more available media. The usable medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)) or the like.
综上,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。In summary, the above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the embodiments are modified, or equivalent to some of the technical features are included; and the modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (17)

  1. 一种存储处理方法,其特征在于,所述方法包括:A storage processing method, the method comprising:
    在接收到访存请求时,检测所述访存请求的请求类型;When receiving the memory access request, detecting a request type of the memory access request;
    若检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为独享状态,则根据第一处理策略的指示对所述访存请求执行响应处理;If it is detected that the memory access request is an instruction request, and detecting that the backup status of the target data requested by the memory access request is an exclusive state, performing response processing on the memory access request according to the indication of the first processing policy ;
    若检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为共享状态,则根据第二处理策略的指示对所述访存请求执行响应处理;If it is detected that the memory access request is an instruction request, and detecting that the backup status of the target data requested by the memory access request is a shared state, performing a response process on the memory access request according to the indication of the second processing policy;
    所述第一处理策略指示的响应处理方式和所述第二处理策略指示的响应处理方式不同。The response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    若检测到所述访存请求为数据请求,则根据第三处理策略的指示对所述访存请求执行响应处理。If the memory access request is detected as a data request, the response processing is performed on the memory access request according to the indication of the third processing policy.
  3. 根据权利要求1所述的方法,其特征在于,所述根据第一处理策略的指示对所述访存请求执行响应处理,包括:The method according to claim 1, wherein the performing the response processing on the memory access request according to the indication of the first processing policy comprises:
    根据所述访存请求新建与所述目标数据对应的第一目录项,所述第一目录项记录了存放所述目标数据的缓存Cache的缓存标识、所述目标数据的备份状态;And creating, by the fetching request, a first directory entry corresponding to the target data, where the first directory entry records a cache identifier of the cache cache that stores the target data, and a backup state of the target data;
    根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And performing response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, wherein the method further comprises:
    根据所述目标数据对管理的Cache进行广播侦听,并接收各个Cache针对所述广播侦听返回的侦听响应;Performing broadcast listening on the managed Cache according to the target data, and receiving a listening response returned by each Cache for the broadcast interception;
    根据所述侦听响应得到第一集合,所述第一集合包括一个或者多个存放所述目标数据的Cache的缓存标识;Obtaining a first set according to the listening response, where the first set includes one or more cache identifiers of a cache that stores the target data;
    若查询到所述第一集合中有未包括在所述第一目录项中的缓存标识,则对所述目标数据进行回收处理。If the cache identifier that is not included in the first directory entry is found in the first set, the target data is recycled.
  5. 根据权利要求1所述的方法,其特征在于,所述根据第二处理策略的指示对所述访存请求执行响应处理,包括:The method according to claim 1, wherein the performing the response processing on the memory access request according to the indication of the second processing policy comprises:
    根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And performing response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  6. 根据权利要求2所述的方法,其特征在于,所述根据第三处理策略的指示对所述访存请求执行响应处理,包括:The method according to claim 2, wherein the performing the response processing on the memory access request according to the indication of the third processing policy comprises:
    根据所述访存请求新建与所述目标数据对应的第二目录项,所述第二目录项记录了存放所述目标数据的缓存Cache的缓存标识、所述目标数据的备份状态;And creating, by the fetching request, a second directory entry corresponding to the target data, where the second directory entry records a cache identifier of the cache cache that stores the target data, and a backup state of the target data;
    根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And performing response processing on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  7. 根据权利要求1~6任一项所述的方法,其特征在于,所述检测所述访存请求的请求类型之前,所述方法还包括:The method according to any one of claims 1 to 6, wherein before the detecting the request type of the memory access request, the method further comprises:
    接收访存请求;Receiving a memory access request;
    检测预置目录中是否包括与所述访存请求所请求的目标数据对应的第三目录项;Detecting whether a third directory entry corresponding to the target data requested by the memory access request is included in the preset directory;
    若检测结果为不包括,则确定未命中数据,执行所述检测所述访存请求的请求类型的步骤。If the detection result is not included, the miss data is determined, and the step of detecting the request type of the memory access request is performed.
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:The method of claim 7, wherein the method further comprises:
    若检测结果为包括与所述访存请求所请求的目标数据对应的第三目录项,则确定命中数据,并根据所述访存请求更新所述第三目录项;If the detection result is a third directory entry corresponding to the target data requested by the memory access request, determining hit data, and updating the third directory entry according to the memory access request;
    所述根据所述访存请求更新所述第三目录项,包括:Updating the third directory entry according to the memory access request includes:
    根据所述目标数据得到第二集合,所述第二集合包括一个或者多个存放所述目标数据的Cache的缓存标识;Obtaining a second set according to the target data, where the second set includes one or more cache identifiers of the cache storing the target data;
    若查询到所述第二集合中有未包括在所述第三目录项中的缓存标识,则对所述第三目录项进行更新处理。If the cache identifier that is not included in the third directory entry is found in the second set, the third directory entry is updated.
  9. 一种存储处理装置,其特征在于,所述装置包括:A storage processing device, characterized in that the device comprises:
    检测模块,用于在接收到访存请求时,检测所述访存请求的请求类型;a detecting module, configured to detect a request type of the memory access request when receiving the memory access request;
    执行模块,用于若所述检测模块检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为独享状态,则根据第一处理策略的指示对所述访存请求执行响应处理;An execution module, configured to: if the detection module detects that the memory access request is an instruction request, and detects that the backup status of the target data requested by the memory access request is an exclusive state, according to the indication of the first processing policy Performing response processing on the memory access request;
    所述执行模块,还用于若所述检测模块检测到所述访存请求为指令请求,且检测到所述访存请求所请求的目标数据的备份状态为共享状态,则根据第二处理策略的指示对所述访存请求执行响应处理;The execution module is further configured to: if the detecting module detects that the memory access request is an instruction request, and detects that the backup state of the target data requested by the memory access request is a shared state, according to the second processing policy Instructing to perform response processing on the memory access request;
    所述第一处理策略指示的响应处理方式和所述第二处理策略指示的响应处理方式不同。The response processing manner indicated by the first processing policy is different from the response processing manner indicated by the second processing policy.
  10. 根据权利要求9所述的装置,其特征在于,The device of claim 9 wherein:
    所述执行模块,还用于若所述检测模块检测到所述访存请求为数据请求,则根据第三处理策略的指示对所述访存请求执行响应处理。The execution module is further configured to: if the detecting module detects that the memory access request is a data request, perform a response process on the memory access request according to the indication of the third processing policy.
  11. 根据权利要求9所述的装置,其特征在于,所述执行模块,包括:The apparatus according to claim 9, wherein the execution module comprises:
    第一新建单元,用于根据所述访存请求新建与所述目标数据对应的第一目录项,所述第一目录项记录了存放所述目标数据的Cache的缓存标识、所述目标数据的备份状态;a first new unit, configured to create a first directory entry corresponding to the target data according to the memory access request, where the first directory entry records a cache identifier of the cache storing the target data, and the target data Backup status
    第一处理单元,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述 访存请求所请求的目标数据执行响应处理。And a first processing unit, configured to perform a response process on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  12. 根据权利要求11所述的装置,其特征在于,所述执行模块,还包括:The apparatus according to claim 11, wherein the execution module further comprises:
    侦听单元,用于根据所述目标数据对管理的Cache进行广播侦听,并接收各个Cache针对所述广播侦听返回的侦听响应;a listening unit, configured to perform broadcast listening on the managed Cache according to the target data, and receive a listening response returned by each Cache for the broadcast interception;
    第一获取单元,用于根据所述侦听响应得到第一集合,所述第一集合包括一个或者多个存放所述目标数据的Cache的缓存标识;a first acquiring unit, configured to obtain a first set according to the listening response, where the first set includes one or more cache identifiers of a cache that stores the target data;
    其中,所述第一处理单元,还用于若查询到所述第一集合中有未包括在所述第一目录项中的缓存标识,则对所述目标数据进行回收处理。The first processing unit is further configured to: when querying, in the first set, a cache identifier that is not included in the first directory entry, perform processing on the target data.
  13. 根据权利要求9所述的装置,其特征在于,所述执行模块,还包括:The apparatus according to claim 9, wherein the execution module further comprises:
    第二处理单元,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And a second processing unit, configured to perform a response process on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  14. 根据权利要求10所述的装置,其特征在于,所述执行模块,还包括:The apparatus according to claim 10, wherein the execution module further comprises:
    第二新建单元,用于根据所述访存请求新建与所述目标数据对应的第二目录项,所述第二目录项记录了存放所述目标数据的缓存Cache的缓存标识、所述目标数据的备份状态;a second new unit, configured to create a second directory entry corresponding to the target data according to the memory access request, where the second directory entry records a cache identifier of the cache cache that stores the target data, and the target data Backup status
    第三处理单元,用于根据所述访存请求的类型以及所述目标数据的备份状态,对所述访存请求所请求的目标数据执行响应处理。And a third processing unit, configured to perform a response process on the target data requested by the memory access request according to the type of the memory access request and the backup status of the target data.
  15. 根据权利要求9~14任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 9 to 14, wherein the device further comprises:
    接收模块,用于接收访存请求;a receiving module, configured to receive a memory access request;
    其中,所述检测模块,还用于检测预置目录中是否包括与所述访存请求所请求的目标数据对应的第三目录项;The detecting module is further configured to detect whether a third directory entry corresponding to the target data requested by the memory access request is included in the preset directory.
    所述检测模块,还用于若检测结果为不包括,则确定未命中数据,执行所述检测所述访存请求的请求类型的步骤。The detecting module is further configured to: if the detection result is not included, determine the miss data, and perform the step of detecting the request type of the memory access request.
  16. 根据权利要求15所述的装置,其特征在于,The device of claim 15 wherein:
    所述检测模块,还用于若检测结果为包括与所述访存请求所请求的目标数据对应的第三目录项,则确定命中数据;The detecting module is further configured to determine hit data if the detection result is a third directory entry corresponding to the target data requested by the memory access request;
    所述装置还包括:The device also includes:
    更新模块,用于根据所述访存请求更新所述第三目录项;An update module, configured to update the third directory entry according to the memory access request;
    所述更新模块,具体包括:The update module specifically includes:
    第二获取单元,用于根据所述目标数据得到第二集合,所述第二集合包括一个或者多个存放所述目标数据的Cache的缓存标识;a second acquiring unit, configured to obtain a second set according to the target data, where the second set includes one or more cache identifiers of the Cache storing the target data;
    更新单元,用于若查询到所述第二集合中有未包括在所述第三目录项中的缓存标识,则对所述第三目录项进行更新处理。And an updating unit, configured to perform an update process on the third directory item if the cached identifier that is not included in the third directory entry is queried in the second set.
  17. 一种存储处理装置,其特征在于,包括:处理器、存储器,所述处理器、所述存储器通过总线连接,所述存储器存储有可执行程序代码,所述处理器用于调用所述可执行程序代码,执行如权利要求1~8中任一项所述的存储处理方法。A storage processing device, comprising: a processor, a memory, the processor, the memory being connected by a bus, the memory storing executable program code, the processor for calling the executable program The code executes the storage processing method according to any one of claims 1 to 8.
PCT/CN2018/084651 2017-05-05 2018-04-26 Storage processing method and apparatus WO2018201967A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710312434.9 2017-05-05
CN201710312434.9A CN108804020B (en) 2017-05-05 2017-05-05 Storage processing method and device

Publications (1)

Publication Number Publication Date
WO2018201967A1 true WO2018201967A1 (en) 2018-11-08

Family

ID=64015790

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/084651 WO2018201967A1 (en) 2017-05-05 2018-04-26 Storage processing method and apparatus

Country Status (2)

Country Link
CN (1) CN108804020B (en)
WO (1) WO2018201967A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816734B (en) * 2022-03-28 2024-05-10 西安电子科技大学 Cache bypass system based on memory access characteristics and data storage method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354682A (en) * 2008-09-12 2009-01-28 中国科学院计算技术研究所 Apparatus and method for settling access catalog conflict of multi-processor
CN102855213A (en) * 2012-07-06 2013-01-02 中兴通讯股份有限公司 Network processor instruction storage device and instruction storage method thereof
US20130219123A1 (en) * 2012-02-20 2013-08-22 Samsung Electronics Co., Ltd. Multi-core processor sharing l1 cache
CN104899160A (en) * 2015-05-30 2015-09-09 华为技术有限公司 Cache data control method, node controller and system
CN106201980A (en) * 2015-01-21 2016-12-07 联发科技(新加坡)私人有限公司 Processing unit and processing method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104679669B (en) * 2014-11-27 2018-04-27 华为技术有限公司 The method of cache cache accumulator systems and access cache row cache line

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101354682A (en) * 2008-09-12 2009-01-28 中国科学院计算技术研究所 Apparatus and method for settling access catalog conflict of multi-processor
US20130219123A1 (en) * 2012-02-20 2013-08-22 Samsung Electronics Co., Ltd. Multi-core processor sharing l1 cache
CN102855213A (en) * 2012-07-06 2013-01-02 中兴通讯股份有限公司 Network processor instruction storage device and instruction storage method thereof
CN106201980A (en) * 2015-01-21 2016-12-07 联发科技(新加坡)私人有限公司 Processing unit and processing method thereof
CN104899160A (en) * 2015-05-30 2015-09-09 华为技术有限公司 Cache data control method, node controller and system

Also Published As

Publication number Publication date
CN108804020B (en) 2020-10-09
CN108804020A (en) 2018-11-13

Similar Documents

Publication Publication Date Title
US7613885B2 (en) Cache coherency control method, chipset, and multi-processor system
CN106302595B (en) Method and equipment for carrying out health check on server
CN104899160B (en) A kind of cache data control method, Node Controller and system
US8700727B1 (en) Peer-to-peer based caching for network file system
CN108363641B (en) Main and standby machine data transmission method, control node and database system
WO2016197666A1 (en) Cache method, write point client and read client in server cluster system
US8762651B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
US8423736B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
CN103678523B (en) Distributed cache cache data access methods and device
US20150058570A1 (en) Method of constructing share-f state in local domain of multi-level cache coherency domain system
US11868631B2 (en) System startup method and related device
US9229865B2 (en) One-cacheable multi-core architecture
US9594682B2 (en) Data access system, memory sharing device, and data reading method
US8904102B2 (en) Process identifier-based cache information transfer
EP2568386A1 (en) Method for accessing cache and fictitious cache agent
JP6343722B2 (en) Method and device for accessing a data visitor directory in a multi-core system
WO2018201967A1 (en) Storage processing method and apparatus
US11327887B2 (en) Server-side extension of client-side caches
JP2022504548A (en) Methods and devices for continuous device operation reliability in cloud degradation mode
KR101303079B1 (en) Apparatus and method for controlling cache coherence in virtualized environment based on multi-core
CN109828720B (en) Data storage method, device, server and storage medium
CN110098945B (en) Data processing method and device applied to node system
WO2018177176A1 (en) Catalogue update method and apparatus
CN118394773B (en) Multi-node cache consistency maintenance method, device, equipment, medium and product
WO2022246848A1 (en) Distributed caching system and data caching method

Legal Events

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

Ref document number: 18795212

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18795212

Country of ref document: EP

Kind code of ref document: A1