WO2024066613A1 - Access method and apparatus and data storage method and apparatus for multi-level cache system - Google Patents

Access method and apparatus and data storage method and apparatus for multi-level cache system Download PDF

Info

Publication number
WO2024066613A1
WO2024066613A1 PCT/CN2023/104895 CN2023104895W WO2024066613A1 WO 2024066613 A1 WO2024066613 A1 WO 2024066613A1 CN 2023104895 W CN2023104895 W CN 2023104895W WO 2024066613 A1 WO2024066613 A1 WO 2024066613A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
information
data block
subsidiary
target
Prior art date
Application number
PCT/CN2023/104895
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 WO2024066613A1 publication Critical patent/WO2024066613A1/en

Links

Classifications

    • 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/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • 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/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/084Multiuser, multiprocessor or multiprocessing cache systems with a shared cache

Definitions

  • the present disclosure relates to the field of data processing technology, and in particular to a method and device for accessing a multi-level cache system, a method and device for storing data, an electronic device, a storage medium, a computer program product, and a computer program.
  • the multi-level cache system may cause a large load on the operation of the multi-level cache system when responding to a large batch of access requests, thereby affecting the performance of the multi-level cache, and further leading to the occurrence of related abnormal situations such as access delays in access requests.
  • the present disclosure aims to solve one of the technical problems in the related art at least to some extent.
  • a first aspect of the present disclosure provides an access method for a multi-level cache system.
  • a second aspect of the present disclosure provides a data storage method for a multi-level cache system.
  • a third aspect of the present disclosure provides an access device for a multi-level cache system.
  • a fourth aspect of the present disclosure provides a data storage device for a multi-level cache system.
  • a fifth aspect of the present disclosure provides an electronic device.
  • a sixth aspect of the present disclosure provides a computer-readable storage medium.
  • a seventh aspect of the present disclosure provides a computer program product.
  • An eighth aspect of the present disclosure provides a computer program.
  • the first aspect of the present disclosure proposes a method for accessing a multi-level cache system, the method comprising: obtaining an access request for the multi-level cache system; obtaining, based on the access request, a target access data block of the access request in the multi-level cache system and target subsidiary information of the target access data block from a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system; and responding to the access request based on the target subsidiary information.
  • the access method of the multi-level cache system proposed in the embodiment of the first aspect of the present disclosure may also have the following technical features:
  • responding to an access request according to target attached information includes: determining an access status of the access request according to the target attached information; and the shared cache responding to the access request in the access status.
  • the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
  • the access status of an access request is determined based on target subsidiary information, including: obtaining an access request sent by a first private cache to a second private cache in a multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache; determining, in an subsidiary directory of a shared cache, subsidiary information corresponding to a target access data block of the access request in the multi-level cache system as target subsidiary information; obtaining subsidiary information on a subsidiary identification bit of the target subsidiary information, and obtaining the access status of the access request based on the subsidiary information on the subsidiary identification bit.
  • the access status of an access request is determined based on target attached information, including: in response to an indication by the target attached information that an access request sent by a first private cache to a second private cache does not hit in the first private cache, determining that the access status of the access request is access failure.
  • a shared cache responds to an access request in an access state, including: in response to an access state of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system; the shared cache responds to the invalidation processing request based on target attachment information.
  • the first private cache in response to an access request sent by a first private cache to a second private cache in a multi-level cache system having an access status of access failure, sends an invalidation processing request to a shared cache in the multi-level cache system, including: in response to the access request being a read access request and the read access request not hitting the first private cache, determining that the first private cache has read-failed the read access request, the first private cache generating a first read invalidation processing request corresponding to the read access request, and sending it to the shared cache; in response to the access request being a write access request and the write access request not hitting the first private cache, determining that the first private cache has write-failed the write access request, the first private cache generating a first write invalidation processing request corresponding to the write access request, and sending it to the shared cache.
  • the first private cache after the first private cache generates a first read invalidation processing request corresponding to the read access request and sends it to the shared cache, it also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is in a dirty state, after receiving the first write back response, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request.
  • the first private cache after the first private cache generates a first write-invalidation processing request corresponding to a write access request and sends it to the shared cache, it also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalid response, it generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalid and write-back response, it generates a corresponding write-invalidation response and sends it to the first
  • the method further includes: in response to a data block in the first private cache being replaced, the first private cache sending a replacement request to the shared cache.
  • the first private cache in response to a data block in a first private cache being replaced, after the first private cache sends a replacement request to a shared cache, it also includes: in response to a replacement data block corresponding to the replacement request being stored in the shared cache, the shared cache performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs; in response to the fact that the replacement data block corresponding to the replacement request does not exist in the shared cache, in a next-level storage system of the shared cache, determining the replacement data block corresponding to the replacement request, the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
  • auxiliary information corresponding to a target access data block of an access request in a multi-level cache system is determined as target auxiliary information, including: in response to a processor core to which a first private cache belongs being a backup processor core of the target access data block, determining target auxiliary information corresponding to the target access data block in the auxiliary directory based on identification information on a backup bit in the auxiliary directory; in response to a processor core to which the first private cache belongs being an owner processor core of the target access data block, determining target auxiliary information corresponding to the target access data block in the auxiliary directory based on identification information on a corresponding owner bit in the auxiliary directory.
  • a shared cache responds to an invalidation processing request based on target attachment information, including: the shared cache obtains identification information on a valid bit of a data block to be stored and a target owner bit in the target attachment information, and determines a target state of the target access data block; the shared cache responds to the invalidation processing request based on the target state.
  • a shared cache obtains identification information on a valid bit of a data block to be stored and a target owner bit in target subsidiary information, and determines a target state of a target access data block, including: in response to the identification of the valid bit of the data block to be stored as valid, and the identification of the target owner bit as a state in which an owner processor core of the data block to be stored exists, determining that the target state of the target access data block is valid and dirty; in response to the identification of the valid bit of the data block to be stored as valid, and the identification of the target owner bit as a state in which an owner processor core of the data block to be stored does not exist, determining that the target state of the target access data block is valid and clean.
  • a shared cache responds to an invalidation processing request according to a target state, including: in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request, and sends it to a first private cache on an owner processor core corresponding to a target access data block; in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to a first private cache on any backup processor core corresponding to the target access data block.
  • the shared cache in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request and sends it to the first private cache on the owner processor core corresponding to the target access data block, further comprising: In response to identifying that the second private cache stores a backup data block corresponding to the target access data block, the first private cache generates a third write-back request and sends it to the second private cache; based on the third write-back request, the second private cache adjusts the backup data block to a shared state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to a shared state.
  • the first private cache after the first private cache adjusts the target access data block to a shared state, it also includes: marking the processor core where the first private cache to which the target access data block in the adjusted state belongs is located as the owner processor core of the target access data block adjusted to a shared state, and updating it in the subsidiary directory of the shared cache.
  • the shared cache in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on any backup processor core corresponding to the target access data block, and also includes: the first private cache sends the data in the target access data block to the shared cache.
  • a shared cache responds to an invalidation processing request according to a target state, including: in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private caches on all backup processor cores corresponding to the target access data block.
  • the shared cache in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block, and also includes: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a second invalidation and write-back request and sends it to the second private cache; according to the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation and write-back response and sends it to the shared cache.
  • the shared cache in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private cache on all backup processor cores corresponding to the target access data block, and also includes: in response to identifying that the backup data block of the target access data block is stored in the second private cache, the first private cache generates a second invalidation request and sends it to the second private cache; according to the second invalidation request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation response and sends it to the shared cache.
  • the method further includes: a first private cache on the owner processor core sends the data in the target access data block to the shared cache.
  • the method also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtaining the replacement strategy of the subsidiary directory of the shared cache, and updating the subsidiary directory of the shared cache according to the replacement strategy; and updating the first private cache according to the updated subsidiary information in the updated subsidiary directory.
  • information is updated on the first private cache according to the updated subsidiary information in the updated subsidiary directory, including: in response to an indication of updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a clean state, the shared cache generates a third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information; in response to an indication of updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a dirty state, the shared cache generates a fourth invalidation request, and sends the fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block corresponding to the subsidiary information.
  • the first private cache is updated according to the updated subsidiary information in the updated subsidiary directory, and the information is also updated, and the following also includes: in response to the indication of the updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a third invalidation and write-back request, and sends the third invalidation and write-back request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information, or, sends it to the first private cache on the backup processor core that exclusively owns the data block corresponding to the subsidiary information.
  • the method also includes: in response to the shared cache storing a backup data block corresponding to the data block corresponding to the subsidiary information, and the identification information of the updated subsidiary information does not match the post-write information of the data block corresponding to the subsidiary information in the first private cache, the shared cache replaces the backup data block stored in the data domain in its own data storage array.
  • a second aspect of the present disclosure provides a data storage method for a multi-level cache system, the method comprising: writing data to be stored into the multi-level cache system, and obtaining post-write information of the data to be stored in the multi-level cache system; generating an attachment corresponding to the post-write information of the data to be stored; The subsidiary information is written into the subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored in the shared cache in the multi-level cache system.
  • the data storage method of the multi-level cache system proposed in the second aspect of the present disclosure may also have the following technical features:
  • a multi-level cache system includes a shared cache, a first private cache, and a second private cache.
  • the shared cache is a shared cache in a multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are private caches of the multi-core processor; wherein each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
  • the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
  • a multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
  • generating subsidiary information corresponding to post-write information of data to be stored includes: obtaining subsidiary identification bits in the initial subsidiary information of the shared cache; obtaining identification information of the data to be stored in the subsidiary identification bits from the post-write information, and marking the identification information to the corresponding subsidiary identification bits to generate the subsidiary information of the data to be stored.
  • the subsidiary identification bits in the initial subsidiary information include: a write address bit, used to indicate the write address of a data block storing data to be stored; an address valid bit, used to indicate whether the write address of the stored data block is valid; a first valid bit, used to indicate whether the first data block stored in the shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache; a first status bit, used to indicate whether the data to be stored has been written in the shared cache; and a data domain row number bit, used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
  • the attachment identification bit in the initial attachment information also includes: a second valid bit, used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache; a second status bit, used to indicate the second data status of the second data block in all first private caches of the multi-core processor, wherein the second data status is an exclusive status (EXC) or a shared status (SHD); a backup bit, used to indicate a backup processor core in the multi-core processor that stores a backup data block of the second data block; a first owner bit, used to indicate whether there is an owner processor core of the second data block in the multi-core processor; and a second owner bit, used to indicate the owner processor core of the second data block in the multi-core processor.
  • EXC exclusive status
  • SHD shared status
  • the method includes: determining a target cache in a multi-level cache system to which data to be stored is written; obtaining target identification information corresponding to initial subsidiary information of a shared cache based on the target cache; in response to generating data to be stored in the target cache based on the target identification information, writing the target subsidiary information into a subsidiary directory.
  • obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to storing data to be stored in the shared cache, obtaining first identification information corresponding to the initial subsidiary information.
  • target subsidiary information in a subsidiary directory in response to generating data to be stored according to target identification information and storing it in a target cache, target subsidiary information in a subsidiary directory is written, including: in response to marking first identification information to a subsidiary identification bit and generating data to be stored in a shared cache, the first subsidiary information in the subsidiary directory is written.
  • obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to data to be stored being written into a first private cache, obtaining second identification information of the initial subsidiary information.
  • writing target subsidiary information in a subsidiary directory includes: in response to marking second identification information to a subsidiary identification bit and generating data to be stored in a first private cache, writing second subsidiary information in the subsidiary directory.
  • obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to writing data to be stored into the shared cache and the first private cache, obtaining third identification information of the initial subsidiary information.
  • target subsidiary information in response to generating data to be stored according to target identification information and storing it in a target cache, target subsidiary information is written into a subsidiary directory, including: in response to marking third identification information to the subsidiary identification bit and generating data to be stored in a shared cache and a first private cache, the third subsidiary information is written into the subsidiary directory.
  • the subsidiary information after writing the subsidiary information into the subsidiary directory of the multi-level cache system, it also includes: in response to the data to be stored being stored in the shared cache, obtaining the subsidiary information path number and the subsidiary information row number in the subsidiary directory; writing the subsidiary information path number and the subsidiary information row number into the information field of the data storage array of the shared cache.
  • the method further includes: in response to the fact that there is no corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, obtaining a first replacement strategy for the subsidiary directory; determining the first replacement information in the subsidiary directory according to the first replacement strategy, deleting The first replacement information is written and the supplementary information is written into the corresponding row of the first replacement information, and the data block corresponding to the first replacement information is deleted synchronously.
  • the method also includes: in response to the fact that there is no corresponding location for storing the first data block of data to be stored in the data domain of the data storage array of the shared cache, obtaining a second replacement strategy of the shared cache; determining the second replacement data block in the data domain according to the second replacement strategy, storing the first data block to the second replacement position to which the second replacement data block belongs, and deleting the second replacement data block at the second replacement position; determining the second replacement information corresponding to the second replacement data block in the subsidiary directory; determining the corresponding row in the subsidiary directory where the second replacement information is deleted, and writing the subsidiary information corresponding to the first data block into the corresponding row deleted.
  • determining the second replacement information corresponding to the second replacement data block in the subsidiary directory includes: obtaining the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block from the information domain of the data storage array; and determining the second replacement information from the subsidiary directory of the shared cache according to the replacement subsidiary information row number and the replacement subsidiary information path number.
  • the third aspect embodiment of the present disclosure proposes an access device for a multi-level cache system, characterized in that the device includes: an acquisition module, used to obtain an access request for the multi-level cache system; an access module, used to obtain, according to the access request, a target access data block of the access request in the multi-level cache system and target subsidiary information of the target access data block from a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system; and a response module, used to respond to the access request according to the target subsidiary information.
  • An embodiment of the fourth aspect of the present disclosure proposes a data storage device for a multi-level cache system, characterized in that the device includes: a first writing module, used to write data to be stored into the multi-level cache system, and obtain post-write information of the data to be stored in the multi-level cache system; a second writing module, used to generate subsidiary information corresponding to the post-write information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system.
  • the fifth aspect of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the program, the access method of the multi-level cache system proposed in the first aspect or the data storage method of the multi-level cache system proposed in the second aspect is implemented.
  • the sixth aspect embodiment of the present disclosure proposes a computer-readable storage medium on which a computer program is stored.
  • the program When the program is executed by a processor, it implements the access method of the multi-level cache system proposed in the first aspect embodiment or the data storage method of the multi-level cache system proposed in the second aspect embodiment.
  • a seventh aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, implements the access method of the multi-level cache system proposed in the first aspect embodiment or the data storage method of the multi-level cache system proposed in the second aspect embodiment.
  • An embodiment of the eighth aspect of the present disclosure proposes a computer program, including computer program code.
  • the computer program code runs on a computer, the computer executes the access method of the multi-level cache system proposed in the embodiment of the first aspect or the data storage method of the multi-level cache system proposed in the embodiment of the second aspect.
  • the access method and device of the multi-level cache system of the embodiments of the present disclosure the data storage method and device, the electronic device, the storage medium, the computer program product and the computer program, wherein the access method of the multi-level cache system includes obtaining an access request of the multi-level cache system, and reading the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block.
  • the access request is responded to according to the target subsidiary information.
  • the data storage method of the multi-level cache system includes obtaining post-write information of the data to be stored in the multi-level cache system, generating the subsidiary information corresponding to the data to be stored according to the post-write information, and writing it into the subsidiary directory of the shared cache for sharing in the multi-level cache system.
  • the auxiliary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the auxiliary directory of the shared cache in the multi-level cache system, so that by reading the auxiliary directory in the tag field of the shared cache, the post-write information of the data to be stored in the multi-level cache system can be obtained, the method for obtaining the post-write information of the data to be stored is simplified, the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system is improved, the resources for directory maintenance in the multi-level cache system are saved, the directory in the multi-level cache system is expandable, and the performance of the multi-level cache system is optimized.
  • the auxiliary directory exists on the shared cache of the multi-level cache system, and the effective management of the data blocks stored in the multi-level cache system is realized.
  • the target auxiliary information corresponding to the target access data block corresponding to the access request is obtained by reading the auxiliary directory, and the access request is responded to according to the target auxiliary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and further reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
  • FIG1 is a schematic flow chart of a method for accessing a multi-level cache system according to an embodiment of the present disclosure
  • FIG2 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure
  • FIG3 is a schematic diagram of a multi-level cache system according to an embodiment of the present disclosure.
  • FIG4 is a schematic flow chart of a data storage method of a multi-level cache system according to an embodiment of the present disclosure
  • FIG5 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure.
  • FIG6 is a schematic diagram of auxiliary information of a multi-level cache system according to an embodiment of the present disclosure.
  • FIG7 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure.
  • FIG8 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure.
  • FIG9 is a schematic diagram of an attached directory according to an embodiment of the present disclosure.
  • FIG10 is a schematic diagram of an attached directory according to another embodiment of the present disclosure.
  • FIG11 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure.
  • FIG12 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure.
  • FIG13 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure
  • FIG14 is a schematic diagram of the structure of a data storage device of a multi-level cache system according to an embodiment of the present disclosure
  • FIG. 15 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure.
  • FIG1 is a flow chart of a method for accessing a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG1 , the method includes: S101 - S103 .
  • the data stored in the multi-level cache system can be obtained by initiating a corresponding request to the multi-level cache system.
  • a request corresponding to reading data stored in the multi-level cache system may be determined as an access request to the multi-level cache system.
  • the multi-level cache system is configured with a corresponding functional unit for receiving and reading the access requests it receives, and the access requests sent to the multi-level cache system can be obtained by reading the information received in the functional unit.
  • S102 obtain the target access data block of the access request in the multi-level cache system and the target subsidiary information of the target access data block from the subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on the shared cache in the multi-level cache system.
  • a corresponding area may be configured on the shared cache in the multi-level cache system for storing the corresponding subsidiary directory of the multi-level cache system.
  • the subsidiary directory may be used to store storage information corresponding to data blocks stored in the multi-level cache system, thereby enabling access to corresponding data blocks in the multi-level cache system through the subsidiary directory.
  • the specific information carried in the access request may be read, and the subsidiary directory stored in the shared cache of the multi-level cache system may be read according to the read information.
  • an access request may carry identification information corresponding to a data block that needs to be read.
  • the identification information has corresponding identification information in a subsidiary directory of a shared cache of a multi-level cache.
  • the information in the subsidiary directory corresponding to the matched identification information is determined to be the relevant information required for the access request.
  • the subsidiary directory stores storage information corresponding to the data blocks stored in the multi-level cache system.
  • the relevant information of the corresponding data block that the access request needs to access and read is obtained according to the subsidiary directory.
  • the data block that needs to be accessed and read can be determined as the target access data block of the access request in the multi-level cache system.
  • the corresponding storage information stored in the subsidiary directory of the target access data block may be determined as the target subsidiary information of the target access data block in the subsidiary directory.
  • subsidiary information associated with an access request can be obtained from a subsidiary directory according to the access request, wherein the subsidiary information is target subsidiary information of a target access data block of the access request in a multi-level cache system stored in the subsidiary directory.
  • the target subsidiary information includes storage information corresponding to the target access data block stored in the multi-level cache system. Therefore, the access request can be responded to according to the target subsidiary information.
  • the data stored in the target access data block corresponding to the access request may be provided to the initiator of the access request according to the storage path of the target access data block indicated in the target auxiliary information.
  • return information corresponding to the normal reading can be generated according to the target auxiliary information, and the received access request can be responded to based on the return information.
  • the reason why the access request cannot normally access can be determined based on the target attached information, and corresponding response information is generated to respond to the received access request.
  • the access method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the access request of the multi-level cache system, and reads the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request, so as to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block.
  • the access request is responded to according to the target subsidiary information.
  • the effective management of the data blocks stored in the multi-level cache system is realized through the subsidiary directory on the shared cache of the multi-level cache system, the target subsidiary information corresponding to the target access data block corresponding to the access request is obtained by reading the subsidiary directory, and the access request is responded to according to the target subsidiary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and further reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
  • Figure 2 is a flow chart of an access method for a multi-level cache system according to another embodiment of the present disclosure. As shown in Figure 2, the method includes: S201-S202.
  • the access status of the access request in the multi-level cache system may be determined from the target subsidiary information corresponding to the target access data block stored in the target subsidiary information.
  • the target attachment information may be obtained based on an attachment directory in a multi-level cache system, wherein the attachment directory is stored in a tag field on a shared cache in the multi-level cache system.
  • the target attachment information corresponding to the target access data block of the access request in the multi-level cache system can be obtained from the attachment directory stored in the tag field on the shared cache in the multi-level cache system, thereby determining the access status of the access request in the multi-level cache system.
  • an abnormal storage state may occur, causing the access request to be unable to access and read it normally.
  • the storage state corresponding to the target access data block can be obtained based on the target subsidiary information of the target access data block in the subsidiary directory, thereby determining the access state corresponding to the access request.
  • the multi-level cache system may include a shared cache and a private cache, wherein the shared cache is a multi-level cache system.
  • the L1 cache is the upper level cache of the L2 cache
  • the L2 cache is the upper level cache of the L3 cache
  • the L3 cache is the shared cache in the multi-level cache system shown in Figure 3
  • the L1 cache and the L2 cache are private caches in the multi-level cache system shown in Figure 3.
  • the L2 cache is set as the first private cache in the multi-level cache system shown in FIG. 3
  • the L1 cache is set as the second private cache in the multi-level cache system shown in FIG. 3 .
  • each multi-core processor may include at least one first private cache and/or at least one second private cache.
  • the access request sent by the first private cache to the second private cache can be obtained by the access request receiving and reading unit set on the second private cache.
  • a first private cache in a multi-level cache system may send an access request to a second private cache, wherein, in response to the access status of the access request sent by the first private cache to the second private cache in the multi-level cache system being access invalidation, the first private cache sends an invalidation processing request to the shared cache in the multi-level cache system.
  • the multi-core processor can obtain relevant information about data stored in the multi-level cache system by accessing the subsidiary directory of the shared cache.
  • an access request can be initiated to the subsidiary directory of the shared cache in the multi-level cache system.
  • the shared cache can read the subsidiary information in its subsidiary directory, so as to obtain the distribution of the target access data block that the access request needs to access in the multi-level cache system and related information of the corresponding status.
  • the first private cache can continue to initiate access requests to its next-level cache, the second private cache, and the second private cache can provide relevant responses and data transmissions to the first private cache, so that the first private cache can satisfy the access requests initiated by the second private cache.
  • a scenario in which the first private cache cannot satisfy and correctly respond to an access request initiated by the second private cache may be determined as an access failure of the first private cache to the access request sent by the second private cache.
  • the request that the first private cache continues to initiate to the shared cache in this scenario is determined as a corresponding invalidation processing request.
  • an abnormality occurs in the status of a related data block in the first private cache corresponding to the access request sent by the second private cache, making it impossible for the first private cache to correctly respond to the access request sent by the second private cache, and it is determined that the access request currently sent by the second private cache to the first private cache has failed.
  • the first private cache can continue to send corresponding invalidation processing requests to its next-level shared cache.
  • the first private cache can implement the access request initiated by the second private cache.
  • the set controller can be used to maintain the subsidiary directory in the tag field of the shared cache used for sharing in the multi-level cache system.
  • the shared cache initiates a request for the first private cache, the returned response, and the coherent access request of the next level cache and/or memory corresponding to the shared cache, as well as the related operations of the shared cache, are all implemented by the set subsidiary directory controller.
  • auxiliary information corresponding to a target access data block of an access request in a multi-level cache system is determined as target auxiliary information.
  • the shared cache after the shared cache receives an invalidation processing request sent by the first private cache, it can obtain from the invalidation processing request the data block that the access request sent by the second private cache to the first private cache needs to access, wherein the data block can be determined as the target access data block corresponding to the access request in the multi-level cache system.
  • the shared cache needs to obtain relevant post-write information such as the distribution and storage status of the target access data block in the multi-level cache system.
  • the corresponding subsidiary information may be determined from the subsidiary directory of the shared cache according to the relevant information of the target access data block, and the corresponding subsidiary information may be determined as the target subsidiary information.
  • a relevant query can be performed on a backup bit in a subsidiary directory of a shared cache based on identification information corresponding to the backup processor core, and subsidiary information on the backup bit that contains identification information corresponding to the backup processor core can be determined as target subsidiary information corresponding to the target access data block.
  • the corresponding target subsidiary information can be determined from the subsidiary directory through the subsidiary information corresponding to the target access data block in the information domain of the data storage array.
  • the supplementary information on the supplementary identification bit of the target supplementary information is obtained, and the access status of the access request is obtained based on the supplementary information on the supplementary identification bit.
  • the subsidiary information with the subsidiary identifier on the target subsidiary information may be read, and the storage state of the target access data block in the multi-level cache system may be determined according to the content of the read subsidiary information.
  • the target access data block corresponding to the access request is currently in a normal storage state in the multi-level cache system and can be accessed and read normally by the access request, thereby determining that the access state of the current access request is normal.
  • the storage status of the target access data block corresponding to the access request in the multi-level cache system is abnormal, and then it is determined that the target access data block cannot be normally accessed and read by the access request, and the access status of the current access request is determined to be abnormal.
  • S202 The shared cache responds to the access request in the access state.
  • the shared cache may respond to the received access request according to the determined access status of the access request in the multi-level cache system.
  • the corresponding data in the target access data block can be returned to the initiator of the access request based on the information required by the access request, thereby responding to the access request in the normal access status.
  • exception information corresponding to the abnormal access status of the access request can be obtained from the target auxiliary information, and the obtained exception information can be returned to the initiator of the access request, thereby achieving a response to the access request in the abnormal access status.
  • an access request with an abnormal access status may generate a corresponding invalidation processing request
  • the shared cache may respond to the access request in the abnormal access status by responding to the invalidation processing request corresponding to the access request with the abnormal access status.
  • the shared cache responds to the invalidation processing request according to the target attachment information.
  • the relevant information of the target access data block can be determined from the identification information on the subsidiary identification bit of the target subsidiary information.
  • the invalidation processing request initiated by the first private cache is responded to according to the acquired relevant information.
  • the second private cache H2 sends an access request to the first private cache H1, and the storage status of the target access data block that the access request needs to access in the first private cache H1 is abnormal, resulting in the second private cache H2 being unable to make a read call on it.
  • the access request initiated by the first private cache H1 to the second private cache H2 fails.
  • the first private cache H1 sends an invalidation processing request to the shared cache H3.
  • the shared cache H3 determines the target subsidiary information of the target access data block in the subsidiary directory, it obtains the backup processor core to which the backup data block of the target access data block belongs, and then obtains the backup data block corresponding to the target access data block from the first private cache on the backup processor core, and generates corresponding response information with its related information and returns it to the first private cache H1.
  • the first private cache H1 responds to the second private cache H2 that initiated the access request based on the response information returned by the shared cache H3 to the invalidation processing request.
  • the multi-level cache on the multi-core processor proposed in the embodiment of the present disclosure may include a shared cache, a first private cache and a second private cache, wherein the shared cache is the shared cache of the multi-core processor to which the multi-level cache system belongs, the first private cache and the second private cache are the private caches of the multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
  • the access method of the multi-level cache system proposed in the embodiment of the present disclosure is to access the target attached information of the target access data block corresponding to the access request according to the target attached information of the target access data block corresponding to the access request.
  • the shared cache obtains the access status of the access request, and responds to the access request according to the access status of the access request.
  • the first private cache can initiate an invalidation processing request to the shared cache, and the shared cache determines the corresponding target subsidiary information in the subsidiary directory according to the target access data block corresponding to the access request, and generates a relevant response to the invalidation processing request according to the identification information in the target subsidiary information, and returns it to the first private cache that initiated the invalidation processing request.
  • auxiliary directory on the shared cache of the multi-level cache system, which realizes the effective management of the data blocks stored in the multi-level cache system, obtains the target auxiliary information corresponding to the target access data block corresponding to the access request by reading the auxiliary directory, and responds to the access request according to the target auxiliary information, which simplifies the method of obtaining the response information corresponding to the access request.
  • the invalidation processing request sent by the first private cache to the shared cache enables the shared cache to respond to the invalidation processing request through the auxiliary directory maintained in its tag domain, thereby enabling the first private cache to respond to the second private cache, and realizing exception processing in abnormal access scenarios, thereby reducing the load degree caused by responding to access requests on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and thereby reducing the abnormal probability of abnormal situations such as access delays in access requests, optimizing the access method of the multi-level cache system, and improving the access efficiency of the multi-level cache system.
  • FIG4 is a flow chart of a data storage method of a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG4 , the method includes: S401 - S402 .
  • each level may include at least one cache system, wherein relevant information after data in the previous level cache is written can be written into the tag field of the set level cache, so that the set level cache can record and maintain the information after the data in the previous level cache is written.
  • an auxiliary directory with an independent structure can be set in the tag field of the set-level cache, and based on the structural setting of the auxiliary directory, the auxiliary information corresponding to the relevant information of the data stored in the previous level cache in the tag field of the set-level cache is generated.
  • the subsidiary information is written into a subsidiary directory in the tag field of the set level cache, and is maintained as a sparse directory in the tag field of the set level cache as relevant post-write information of data in the previous level cache.
  • the L2 cache is set as the upper-level cache of the L3 cache.
  • Corresponding subsidiary information can be generated based on relevant post-write information of the data in the L2 cache, and written into the tag field of the L3 cache as a sparse directory maintained in the L3 tag field for relevant post-write information of the data in the L2 cache.
  • the post-write information may include relevant information such as the write address, storage status, and parameters related to the occupied storage space of the data to be stored in the multi-level cache system.
  • a subsidiary directory with an independent structure is provided in the tag field of the setting level cache, wherein the subsidiary directory is composed of subsidiary information corresponding to different data.
  • the subsidiary information constituting the subsidiary directory has a set format, and therefore, the relevant information in the written information can be integrated according to the set format to generate the subsidiary information corresponding to the data to be stored.
  • the auxiliary information there are different types of data bits in the auxiliary information. According to the type of data to be filled in each data bit, the corresponding storage data can be obtained from the written information and filled in the corresponding data bit.
  • the storage data corresponding to the storage location of the data to be stored can be obtained from the written information of the data to be stored and filled in the data bit of the storage location type.
  • the storage data corresponding to the storage occupied space of the data to be stored can be obtained from the written information of the data to be stored and filled in the data bit of the storage location type.
  • supplementary information corresponding to the data to be stored is generated according to the filling of the storage data on different types of data bits.
  • a multi-level cache system on a multi-core processor may include a shared cache and a private cache, wherein the private cache
  • the memory is a private cache system for each processor core.
  • a corresponding subsidiary directory can be set in the tag field of the shared cache, and the subsidiary directory can be stored on the shared cache in the multi-level cache system.
  • the shared cache in the multi-level cache system can be determined as the shared cache.
  • the L3 cache is the shared cache used for sharing in the multi-level cache system shown in FIG. 3 .
  • the subsidiary information corresponding to the data to be stored can be written into the subsidiary directory of the shared cache as a sparse directory of the data to be stored in the tag field of the shared cache.
  • the post-write information related to the data to be stored can be recorded and maintained.
  • the subsidiary information corresponding to the data to be stored may be written into the subsidiary directory in the tag field of the L3 cache as a sparse directory maintained in the tag field of the L3 cache for the data to be stored.
  • the data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the post-write information of the data to be stored in the multi-level cache system, generates the subsidiary information corresponding to the data to be stored according to the post-write information, and writes it into the subsidiary directory of the shared cache used for sharing in the multi-level cache system.
  • the subsidiary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the subsidiary directory of the shared cache in the multi-level cache system, so that the post-write information of the data to be stored in the multi-level cache system can be obtained by reading the subsidiary directory in the tag field of the shared cache, which simplifies the method for obtaining the post-write information of the data to be stored, improves the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system, saves the resources for directory maintenance in the multi-level cache system, realizes the scalability of the directory in the multi-level cache system, and optimizes the performance of the multi-level cache system.
  • Figure 5 is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 5, the method includes: S501-S502.
  • the multi-level cache system of a multi-core processor includes a shared cache, a first private cache, and a second private cache.
  • the shared cache is the shared cache in the multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are the private caches of the multi-core processor.
  • the subsidiary directory is stored in a shared cache, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
  • the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
  • the multi-core processor includes N processor cores.
  • the private cache system on each of the N processor cores can be determined as the private cache in the multi-level cache system on the multi-core processor, and the cache system shared by the N processor cores can be determined as the shared cache in the multi-level cache system on the multi-core processor.
  • the shared cache stores the subsidiary directory of the multi-level cache system on the multi-core processor.
  • the subsidiary directories of the multi-level cache system on the multiple processors may be stored in a tag field on a shared cache in the multi-level cache.
  • the L3 cache is a shared cache used for sharing in the multi-level cache system shown in FIG. 3
  • the L2 cache and the L3 cache are private caches of the processor core.
  • the subsidiary directory of the multi-level cache shown in FIG. 3 may be stored in a tag field on the L3 cache.
  • the multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
  • the first private cache may be a cache system shared by a set number of processor cores in a multi-core processor, wherein the set number is smaller than the corresponding number of all processor cores in the multi-core processor.
  • the multi-core processor includes N processor cores, and the cache system shared by the M processor cores in the multi-core processor can be determined as a partial shared cache in the multi-level cache system on the multi-core processor, where M is less than N.
  • the first private cache L2 may be a shared cache of some processor cores in the multi-core processor shown in FIG. 3 .
  • the initial subsidiary information corresponding to the subsidiary directory of the shared cache can be obtained, and the subsidiary directory on the initial subsidiary information can be obtained by The corresponding identification information is filled in the attribute identification bit to generate the corresponding auxiliary information.
  • the auxiliary identification bit of the initial auxiliary information of the shared cache includes a corresponding auxiliary identification bit for indicating the information related to the shared cache.
  • the corresponding auxiliary identification bit for indicating the information related to the shared cache may include:
  • the write address bit is used to indicate the write address of the data block storing the data to be stored.
  • the address valid bit is used to indicate whether the write address of the storage data block is valid.
  • the first valid bit is used to indicate whether the first data block stored in the shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache.
  • the first status bit is used to indicate whether the data to be stored has been written in the shared cache.
  • the data domain row number bit is used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
  • This part may be used to indicate a corresponding subsidiary identification bit of the shared cache related information, and may be determined as the first subsidiary identification bit in the initial subsidiary information.
  • the set flag on the first valid bit indicates that the first data block in the shared cache is valid
  • the set flag on the first status bit used to indicate whether the data to be stored has been written to the shared cache is valid.
  • the set flag on the first state bit may include identification information 0 and identification information 1, wherein, in response to the identification information corresponding to the set flag on the first state bit being 0, it is determined that the data to be stored has not been written in the shared cache, and the data to be stored in this scenario is identified as clean data that has not been written.
  • first data block storing dirty data may be replaced and updated.
  • the replaced first data block storing dirty data is written back to the next level cache or memory of the shared cache.
  • the first private cache can send a set write-back request to the shared cache.
  • the first private cache can send corresponding information about whether the data to be stored has been written in the first private cache to the shared cache.
  • the shared cache can modify the set flag on the first status bit based on the information sent by the first private cache.
  • the shared cache in response to the first private cache sending corresponding information that the data to be stored has been written in the first private cache to the shared cache, the shared cache updates the set flag on its corresponding first status bit to flag information 1 based on the received information.
  • the shared cache in response to the first private cache sending corresponding information that the data to be stored has not been written to the first private cache to the shared cache, the shared cache updates the set flag on its corresponding first status bit to flag information 0 based on the received information.
  • the auxiliary identification bit of the initial auxiliary information of the shared cache further includes a corresponding auxiliary identification bit for indicating the first private cache related information.
  • the corresponding auxiliary identification bit for indicating the first private cache related information may include:
  • the second valid bit is used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache.
  • the second state bit is used to indicate a second data state of the second data block in all first private caches of the multi-core processor, wherein the second data state is an exclusive state (EXC) or a shared state (SHD).
  • EXC exclusive state
  • SHD shared state
  • the backup bit is used to indicate a backup processor core storing a backup data block of the second data block in a multi-core processor.
  • the first owner bit is used to indicate whether there is an owner processor core of the second data block in the multi-core processor.
  • the second owner bit is used to indicate the owner processor core of the second data block in the multi-core processor.
  • This part may be used to indicate a corresponding subsidiary identification bit of the first private cache related information, and may be determined as the second subsidiary identification bit in the initial subsidiary information.
  • the first subsidiary identification bit of the shared cache and the second subsidiary identification bit of the first private cache are combined according to a setting order in the subsidiary directory to generate a corresponding complete subsidiary identification bit in the subsidiary directory of the shared cache.
  • corresponding identification information in the post-write information of the data to be stored is obtained according to the subsidiary identification bit set on the initial subsidiary information in the subsidiary directory of the shared cache.
  • the acquired identification information is marked on the corresponding subsidiary identification bit, thereby generating subsidiary information corresponding to the data to be stored.
  • the cache where the data to be stored is stored may be determined as the target cache of the data to be stored, and different subsidiary information of the data to be stored in different target caches may be generated according to different target caches.
  • a target cache in a multi-level cache system in which data is to be stored is determined.
  • the data to be stored may be stored only in a shared cache.
  • the shared cache is the target cache for storing the data to be stored.
  • the data to be stored may be stored only in the first private cache.
  • the first private cache is the target cache for storing the data to be stored.
  • the data to be stored may be stored in a shared cache and a first private cache at the same time.
  • both the shared cache and the first private cache are target caches for storing the data to be stored.
  • target identification information corresponding to the initial subsidiary information of the shared cache is obtained, and in response to generating data to be stored according to the target identification information, the target subsidiary information is written into the subsidiary directory.
  • first identification information corresponding to the initial subsidiary information can be obtained, and the first identification information can be marked on the subsidiary identification bit, so as to generate the first subsidiary information written into the subsidiary directory of the shared cache when the data to be stored is stored in the shared cache.
  • the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the first identification information.
  • the first identification information obtained from the post-writing information may include:
  • the first write address in the shared cache of the first data block corresponding to the data to be stored in the shared cache is marked on the write address bit.
  • the first write address is valid.
  • the status of the first data block is valid.
  • the first status bit indicates whether the data to be stored has been written in the shared cache.
  • the storage row number of the first data block in the data domain of the data storage array of the shared cache is marked on the data domain row number bit.
  • the first owner bit is marked invalid.
  • the first identification information on the subsidiary identification bit used to indicate the first private cache related information in the initial subsidiary information in this scenario is all invalid indication information.
  • the data to be stored can be stored only in the first private cache
  • second identification information of the initial subsidiary information is obtained, and in response to marking the second identification information onto the subsidiary identification bit, the data to be stored is generated to be stored in the first private cache, and second subsidiary information is written into the subsidiary directory of the shared cache.
  • the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the second identification information.
  • the second identification information obtained from the post-writing information may include:
  • the data to be stored is marked on the write address bit and the corresponding second data block is stored in the first private cache at the second write address in the first private cache.
  • the second write address is valid.
  • the mark on the first valid bit is invalid.
  • the first state bit is in an invalid state.
  • the mark on the row number position of the data field is invalid.
  • the status of the second data block is valid.
  • the second data state of the second data block marked on the second state bit is an exclusive state (EXC) or a shared state (SHD).
  • the backup processor core marked on the backup bit stores a backup data block of the second data block in the multi-core processor.
  • the first owner bit is marked to determine whether there is an owner processor core of the second data block in the multi-core processor.
  • the processor core marked in the second owner bit is the owner of the second data block in the multi-core processor.
  • the second identification information on the subsidiary identification bit used to indicate the shared cache related information in the initial subsidiary information in this scenario is all invalid indication information.
  • the data to be stored in both the shared cache and the first private cache, in response to the data to be stored being written into the shared cache and the first private cache, the third identification information of the initial subsidiary information is obtained, and in response to marking the third identification information onto the subsidiary identification bit, the data to be stored is generated and stored in the shared cache and the first private cache, and the third subsidiary information is written into the subsidiary directory of the shared cache.
  • the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the third identification information.
  • the third identification information obtained from the post-writing information may include:
  • the third write address of the first data block in the shared cache and/or the fourth write address of the second data block in the first private cache are marked on the write address bit.
  • the status of the first data block is valid.
  • the first status bit indicates whether the data to be stored has been written in the shared cache.
  • the storage row number of the first data block in the data domain of the data storage array of the shared cache is marked on the data domain row number bit.
  • the status of the second data block is valid.
  • the second data state of the second data block marked on the second state bit is an exclusive state (EXC) or a shared state (SHD).
  • the backup processor core marked on the backup bit stores a backup data block of the second data block in the multi-core processor.
  • the first owner bit is marked to determine whether there is an owner processor core of the second data block in the multi-core processor.
  • the processor core marked in the second owner bit is the owner of the second data block in the multi-core processor.
  • the shared cache and the first private cache there is a set association relationship between the shared cache and the first private cache, wherein, in response to the shared cache and the first private cache being a non-inclusive relationship (exclusive), the data to be stored can be stored only in the first private cache; in response to the shared cache and the first private cache being an inclusive relationship (inclusive), the data to be stored can be stored in both the shared cache and the first private cache; in response to the shared cache and the first private cache being a non-inclusive relationship (non-inclusive), the data to be stored can be stored in the shared cache and/or the first private cache.
  • the first subsidiary information may be written into a subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in the shared cache.
  • the second subsidiary information can be written into the subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in the first private cache.
  • the third subsidiary information can be written into the subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in both the shared cache and the first private cache.
  • a multi-level cache system on a multi-core processor is set as shown in FIG3 , wherein the multi-core processor includes 128 processor cores, each cache line has 512 bits, and a physical address of 40 bits.
  • the data A to be stored is assumed to be stored in a shared cache and a first private cache, wherein the physical write address (paddr) of the first data block A1 stored in the shared cache is paddr0: 0x802d7950 (corresponding to binary: 0000 0000 1000 0000 0010 1101 0111 1001 0101 0000), and the first valid bit of the first data block A1 in the supplementary information is marked as valid, and the first status bit is marked as the data status that has been written.
  • the physical write address (paddr) of the first data block A1 stored in the shared cache is paddr0: 0x802d7950 (corresponding to binary: 0000 0000 1000 0000 0010 1101 0111 1001 0101 0000)
  • the first valid bit of the first data block A1 in the supplementary information is marked as valid
  • the first status bit is marked as the data status that has been written.
  • the second status bit of the second data block A2 stored in the first private cache in the auxiliary information is marked as an exclusive state (EXC)
  • the processor core storing the second data block A2 is processor core No. 127 (7’b1111111)
  • the owner processor core of the second data block A2 stored in the data A to be stored in the first private cache is processor core No. 127.
  • the first data block B1 of the data B to be stored is only stored in the shared cache, and its physical write address is paddr1: 0xf75dde08 (corresponding to binary: 0000 0000 0000 0111 0101 1101 1101 1110 0000 1000), where:
  • the data to be stored A and the data to be stored B are stored in a multi-level cache system, and the corresponding auxiliary information can be understood in conjunction with FIG. 6 .
  • valid indicates valid
  • inv indicates invalid
  • EXC indicates exclusive state
  • SHD indicates shared state
  • 1 on the first state bit indicates that data has been written
  • 0 indicates that data has not been written
  • 1 on the first owner bit indicates that an owner processor core exists
  • 0 indicates that an owner processor core does not exist.
  • the data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the initial subsidiary information in the subsidiary directory of the shared cache, and obtains the corresponding identification information from the post-write information of the data to be stored according to the subsidiary identification bit of the initial subsidiary information.
  • the identification information is marked on the corresponding subsidiary identification bit, thereby generating the subsidiary information corresponding to the data to be stored.
  • the scalability of the directory in the multi-level cache system is achieved by setting the subsidiary identification bit, and the identification information corresponding to the post-write information of the data to be stored is obtained according to the subsidiary identification bit, and then the corresponding subsidiary information is generated, so that the subsidiary information can be written into the subsidiary directory in the tag field of the shared cache, thereby realizing the maintenance and recording of the post-write information of the data to be stored in the subsidiary directory of the shared cache, saving the resources for directory maintenance in the multi-level cache system, and optimizing the performance of the multi-level cache system.
  • Figure 7 is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 7, the method includes: S701-S702.
  • auxiliary directory In some embodiments, during the process of writing the auxiliary information into the auxiliary directory of the shared cache, there is a possibility that the auxiliary directory is filled.
  • the set processing method can be obtained, and according to the obtained processing method, a corresponding row for writing the subsidiary information can be vacated in the subsidiary directory.
  • the processing method in this scenario may be determined as the first replacement strategy.
  • the first replacement strategy may include a random replacement strategy, a least recently used replacement strategy, a least frequently used replacement strategy, and a first-in-first-out replacement strategy.
  • S702 determine the first replacement information in the subsidiary directory, delete the first replacement information and write the subsidiary information into the corresponding row of the first replacement information, and simultaneously delete the data block corresponding to the first replacement information.
  • the label that needs to be replaced can be obtained from the subsidiary directory and determined as the first replacement information.
  • a tag in response to the first replacement strategy being a random replacement strategy, may be randomly selected as the first replacement information.
  • the tag with the lowest frequency of use within a set time range may be used as the first replacement information.
  • the row where the first replacement information is located in the subsidiary directory is determined, and the subsidiary information corresponding to the data to be stored is written into the row, and the related information of the first replacement information is deleted.
  • the subsidiary directory is used to maintain the relevant post-write information of the data in the multi-level cache system. Therefore, after the first replacement information is replaced and deleted, the storage data corresponding to the first replacement information needs to be replaced and deleted accordingly.
  • the first valid bit on the first replacement information needs to be marked as valid.
  • the data block corresponding to the first replacement information can be deleted.
  • the storage location of the corresponding data block can be determined through the identification information on the row number position of the data field of the first replacement information, and then the data block at the location can be deleted.
  • the second valid bit on the second replacement information needs to be marked as valid, and the processor core where the first private cache to which the data block belongs is located is one of the backup processor cores indicated on the backup bit of the second replacement information.
  • the data block corresponding to the first replacement information can be deleted.
  • the Index and Block offset of the data block corresponding to the data to be stored obtained from the supplementary information corresponding to the data to be stored in the first private cache can be used as the low-order address of the data block, and the address indicated by the write address bit of the first replacement information can be used as the high-order address of the data block, thereby determining the storage position of the data block corresponding to the first replacement information in the first private cache.
  • the data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the first replacement strategy of the subsidiary directory in response to the absence of a corresponding row for writing subsidiary information in the subsidiary directory of the shared cache, and determines the first replacement information to be replaced from the subsidiary directory according to the first replacement strategy.
  • the subsidiary information is written to the row where the first replacement information is located in the subsidiary directory, and the first replacement information is deleted. Accordingly, the data block corresponding to the first replacement information in the multi-level cache system is determined, and it is deleted from the corresponding storage location.
  • exception handling is implemented for the scenario where the subsidiary directory is full, and data cleaning in the multi-level cache system is implemented by maintaining the subsidiary directory, thereby optimizing the performance of the multi-level cache system.
  • Figure 8 is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 8, the method includes: S801-S804.
  • a relevant processing method corresponding to the data storage array of the shared cache can be obtained, and a corresponding location for storage of the first data block can be vacated according to the obtained processing method.
  • the processing method obtained in this scenario can be determined as the second replacement strategy.
  • the second replacement strategy can include a random replacement strategy, a least recently used replacement strategy, a least frequently used replacement strategy, and a first-in-first-out replacement strategy.
  • the corresponding position in the data domain that is vacated for storage of the first data block can be vacated accordingly, and the storage position corresponding to the supplementary information path number and the supplementary information row number corresponding to the corresponding position in the data domain in the information domain can be vacated, and when the first data block is stored in the data domain, the supplementary information row number and the supplementary information path number of the supplementary information corresponding to the first data block in the supplementary directory can be written into the corresponding position in the information domain.
  • S802 determine a second replacement data block in the data domain, store the first data block to a second replacement position to which the second replacement data block belongs, and delete the second replacement data block at the second replacement position.
  • a data block that can be replaced can be obtained from the data storage array of the shared cache and determined as the second replacement data block.
  • a storage location to which the second data block belongs in the shared cache is determined and determined as a second replacement location vacated for the first data block in the shared cache.
  • the first data block may be stored in the second replacement position, and the second replacement data block may be deleted from the second replacement position.
  • S803 Determine second replacement information corresponding to the second replacement data block in the subsidiary directory.
  • the data blocks stored in the shared cache have corresponding subsidiary information in the subsidiary directory.
  • the subsidiary information corresponding to the second replacement data block in the subsidiary directory needs to be deleted.
  • the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block are obtained from the information field of the data storage array.
  • a data block when a data block is stored in the data domain of the data storage array of the shared cache, corresponding record information exists in the information domain, wherein relevant information of the tag corresponding to the data block in the subsidiary directory can be stored in the information domain.
  • the subsidiary directory of the shared cache may be a multi-way group directory as shown in FIG. 9 . Therefore, the subsidiary information in the subsidiary directory has corresponding subsidiary information way numbers and subsidiary information row numbers.
  • the subsidiary information path number of subsidiary information group 1 is 0, the subsidiary information path number of subsidiary information group 2 is 1, the subsidiary information path number of subsidiary information group 3 is 2, and so on.
  • the supplementary information A in the supplementary information group 1 is in the first row of the supplementary information group 1, and the supplementary information row number of the supplementary information A in the supplementary information group 1 is 0, the supplementary information B is in the third row of the supplementary information group 2, and the supplementary information row number of the supplementary information B is 2, the supplementary information C is in the second row of the supplementary information group 3, and the supplementary information row number of the supplementary information C is 1, and so on.
  • the supplementary information row number of the supplementary information A in the supplementary directory shown in Figure 9 is 0, and the supplementary information path number is 0, the supplementary information row number of the supplementary information B in the supplementary directory shown in Figure 9 is 2, and the supplementary information path number is 1, and the supplementary information row number of the supplementary information C in the supplementary directory shown in Figure 9 is 1, and the supplementary information path number is 3.
  • the path number and row number of the subsidiary information can be used as the record information corresponding to the data block and stored in the information field of the data storage array. As shown in FIG10 , different data blocks are stored in different rows of the data storage array, and the corresponding rows in the information field can record the subsidiary information corresponding to the data block in the subsidiary directory. Line number and attached information route number.
  • the subsidiary information path number and the subsidiary information row number of the subsidiary information corresponding to the second replacement data block can be obtained from the record information of the second replacement data block in the information domain of the data storage array, and determined as the replacement subsidiary information path number and the replacement subsidiary information row number.
  • a query is performed in the subsidiary directory to determine the label corresponding to the second replacement data block and determine it as the second replacement information.
  • the second replacement information after the second replacement information is determined, it can be deleted, and the corresponding row after the deletion is used as the corresponding row for writing the supplementary information corresponding to the first data block.
  • the subsidiary information corresponding to the first data block can be stored in the corresponding row vacated after the second replacement information is deleted from the subsidiary directory.
  • the subsidiary information C is set as the second replacement information. After determining that the subsidiary information C is the second replacement information, the subsidiary information C can be deleted from the row where it is located, and the corresponding row obtained after the deletion is used as the corresponding row where the subsidiary information corresponding to the first data block is written.
  • the data storage method of the multi-level cache system proposed in the embodiment of the present disclosure is that when there is no corresponding position available for storing the first data block in the shared cache, the second replacement strategy corresponding to the shared cache is obtained, and the corresponding second replacement data block is determined from the data domain of the shared cache according to the second replacement strategy.
  • the second replacement position where the second replacement data block is stored in the shared cache is obtained, the second replacement data block at the second replacement position is deleted, and the first data block of the data to be stored is written. Accordingly, the second replacement information corresponding to the second replacement data block in the subsidiary directory is obtained and deleted.
  • the exception handling of the scenario where there is no corresponding position available for storage in the data domain of the shared cache is realized, and while the data in the shared cache is maintained and managed, the synchronization of the subsidiary directory is realized, the maintenance and management method of the subsidiary directory is optimized, and the performance of the multi-level cache system is optimized.
  • Figure 11 is a flow chart of the access method of the multi-level cache system of another embodiment of the present disclosure. As shown in Figure 11, the method includes: S1101-S1103.
  • S1101 In response to an access status of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system.
  • the access status of the access request sent by the first private cache to the second private cache may be in an access failure state, wherein, in response to the target attached information indication, the access request sent by the first private cache to the second private cache does not hit in the first private cache, and the access status of the access request is determined to be an access failure.
  • the request type of the access request sent by the first private cache to the second private cache can be determined based on the identification information on the subsidiary identification bit in the target subsidiary information, and then the access status of the access request sent by the first private cache to the second private cache can be determined.
  • the access request initiated by the second private cache to the first private cache may include a read access request or a write access request.
  • the target access data block corresponding to the read access request does not exist in the first private cache that receives the read access request, or the corresponding target access data block is in an invalid state (INV) in the first private cache that receives the read access request, it can be determined that the read access request has not hit in the first private cache.
  • ISV invalid state
  • a read access request initiated by the second private cache to the first private cache is read invalidated in the first private cache, wherein, in response to the access request being a read access request and the read access request not hitting in the first private cache, it is determined that the first private cache read invalidates the read access request, the first private cache generates a read invalidation processing request corresponding to the read access request, and sends it as a first read invalidation processing request (ReqRead) to the shared cache.
  • ReqRead first read invalidation processing request
  • a write access request in a scenario where a write access request is initiated by the second private cache to the first private cache, in response to the target access data block corresponding to the write access request not existing in the first private cache that receives the write access request, or the corresponding target access data block in the first private cache that receives the write access request is in an invalid state (INV), or the corresponding target access data block in the first private cache that receives the write access request is in a shared state (SHD), it can be determined that the write access request does not hit in the first private cache.
  • ISV invalid state
  • SHD shared state
  • a write access request initiated by the second private cache to the first private cache is write-failed in the first private cache, wherein, in response to the access request being a write access request and the write access request not hitting in the first private cache, it is determined that the first private cache write-failed the write access request, the first private cache generates a write-failure processing request corresponding to the write access request, and sends it to the shared cache as a first write-failure processing request (ReqWrite).
  • the data to be stored may be stored in a shared cache and a first private cache at the same time.
  • the data in the shared cache needs to be replaced accordingly.
  • the shared cache After the shared cache receives the replacement request sent by the first private cache, in response to the replacement data block corresponding to the replacement request stored in the shared cache, the shared cache replaces the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
  • replacement processing can also be performed on the corresponding data stored in the next-level storage system of the shared cache.
  • the replacement data block corresponding to the replacement request in response to the absence of a replacement data block corresponding to the replacement request in the shared cache, is determined in the next-level storage system of the shared cache.
  • the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
  • the first private cache that receives the corresponding response is the first private cache that has a data block that needs to be replaced and sends a replacement request to the shared cache.
  • the target subsidiary information of the target accessed data block in the subsidiary directory of the shared cache can be determined according to the relevant information of the target accessed data block.
  • target subsidiary information corresponding to the target access data block may be determined from the subsidiary directory according to relevant information of the processor core to which the first private cache belongs.
  • target subsidiary information corresponding to the target access data block in the subsidiary directory is determined according to identification information on the backup bit in the subsidiary directory.
  • identification information of the processor core to which the first private cache storing the target access data block belongs can be obtained and compared with identification information on the backup bit of the subsidiary directory. Based on the comparison result, corresponding subsidiary information is determined from the subsidiary directory and used as the target subsidiary information corresponding to the target access data block in the subsidiary directory.
  • target subsidiary information corresponding to the target access data block in the subsidiary directory is determined based on identification information on a corresponding owner bit in the subsidiary directory.
  • identification information of the processor core to which the first private cache storing the target access data block belongs can be obtained and compared with the identification information on the corresponding owner bit in the subsidiary directory. Based on the comparison result, the corresponding subsidiary information is determined from the subsidiary directory and used as the target subsidiary information corresponding to the target access data block in the subsidiary directory.
  • the shared cache responds to the invalidation processing request according to the target attachment information.
  • the shared cache may obtain relevant status information of the target access data block from the target attachment information, and respond to the invalidation processing request sent by the first private cache according to the relevant status information.
  • the shared cache can determine the target state of the target access data block based on the identification information on the relevant subsidiary identification bit in the target subsidiary information.
  • the shared cache can obtain the identification information on the valid bit and the target owner bit of the data block to be stored in the target subsidiary information to determine the target state of the target access data block.
  • the target state of the target access data block is determined to be valid and dirty (VALID-DIRTY).
  • the target owner bit identifying that the data block to be stored has an owner processor core, it can be determined that the data block to be stored in this scenario is a data block in the dirty state, and the target state of the target access data block can be marked as valid and dirty.
  • the shared cache responds to the invalidation request based on the target state.
  • the shared cache in response to the target state being valid and dirty (VALID-DIRTY), the shared cache generates a write-back request corresponding to the first read invalidation processing request, and sends it as a first write-back request (ReqWtbk) to the first private cache on the owner processor core corresponding to the target access data block.
  • the first private cache after the first private cache receives the first write back request, in response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a corresponding write back request and sends it to the second private cache as a third write back request (ReqWtbk request).
  • the second private cache adjusts the state of the backup data block stored in itself to the shared (SHD) state according to the third write-back request, and writes the adjusted backup data block back to the first private cache.
  • the second private cache After the second private cache completes the status adjustment of the backup data block and writes it back to the first private cache, it can mark the processor core where the first private cache, to which the target access data block with the adjusted status belongs, is located as the owner processor core of the target access data block adjusted to the shared state, and update it in the subsidiary directory of the shared cache.
  • the first private cache adjusts the status of its own stored target access data block to a shared status, and generates a corresponding write-back response, which is sent to the shared cache as a first write-back response (RespWtbk).
  • the shared cache in response to the target state being valid and dirty (VALID-DIRTY), the shared cache generates a write-back request corresponding to the first write invalidation processing request, and sends it as a first invalidation and write-back request (ReqINVWtbk) to the first private cache on the owner processor core corresponding to the target access data block.
  • the first private cache in response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a corresponding invalidate and write back request and sends it to the second private cache as a second invalidate and write back request (ReqINVWtbk).
  • the second private cache After receiving the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state according to the second invalidation and write-back request, and writes the adjusted backup data block back to the first private cache.
  • the first private cache adjusts the target access data block to an invalid state and generates a corresponding invalidation and write-back response, which is sent to the shared cache as a first invalidation and write-back response (RespINVWtbk).
  • the target state of the target access data block is determined to be valid and clean (VALID-CLEAN).
  • the target owner bit indicating that the data block to be stored does not have an owner processor core, it can be determined that the data block to be stored in this scenario is a data block in a clean state, and the target state of the target access data block can be marked as valid and clean.
  • the shared cache responds to the invalidation request based on the target state.
  • the shared cache in response to the target state being valid and clean (VALID-CLEAN), the shared cache generates a write-back request corresponding to the first read invalidation processing request, and sends it as a second write-back request (ReqWtbkFwd) to the first private cache on any backup processor core corresponding to the target access data block.
  • the first private cache that receives the second write-back request may send the data in the target access data block to the shared cache.
  • the shared cache in response to the target state being valid and clean (VALID-CLEAN), the shared cache generates an invalidation request corresponding to the first write invalidation processing request, and sends it as a first invalidation request (ReqINV) to the first private caches on all backup processor cores corresponding to the target access data block.
  • ReqINV first invalidation request
  • the first private cache after receiving the first invalidation request, identifies whether a backup data block of the target access data block is stored in its corresponding second private cache, wherein, in response to identifying that the backup data block of the target access data block is stored in the second private cache, the first private cache generates a corresponding invalidation request and sends it to the second private cache as a second invalidation request (ReqINV).
  • the second private cache After the second private cache receives the second invalidation request, the second private cache adjusts the backup data block to an invalid state according to the second invalidation request. state, and writes the adjusted backup data block back to the first private cache.
  • the first private cache adjusts the target access data block to an invalid state and generates a corresponding invalidation response, which is sent to the shared cache as a first invalidation response (RespINV).
  • the shared cache may also respond to the invalidation processing request received from the first private cache according to the relevant information indicated by the target attachment information corresponding to the target access data block.
  • the first read invalidation processing request in response to the shared cache receiving the first read invalidation processing request sent by the first private cache, the first read invalidation processing request may be responded to according to the relevant information indicated by the target subsidiary information.
  • the shared cache in response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response (RespRead) and sends it to the first private cache that issued the first read invalidation processing request.
  • RespRead read invalidation response
  • the shared cache in response to the target attachment information indicating that the target access data block in the first private cache is in a dirty state, after the shared cache receives the first write-back response, it generates a corresponding read invalidation response (RespRead) and sends it to the first private cache that issued the first read invalidation processing request.
  • RespRead read invalidation response
  • the first write-invalidation processing request in response to the shared cache receiving the first write-invalidation processing request sent by the first private cache, the first write-invalidation processing request may be responded to according to the relevant information indicated by the target subsidiary information.
  • the shared cache in response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write invalidation response and sends it to the first private cache that issued the first write invalidation processing request.
  • the shared cache in response to the target attachment information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write invalidation response and sends it to the first private cache that issued the first write invalidation processing request.
  • the shared cache in response to the target attachment information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation and write-back response, it generates a corresponding write-failure response and sends it to the first private cache that issued the first write-failure processing request.
  • the access method of the multi-level cache system proposed in the embodiment of the present disclosure is that in response to the access request initiated by the second private cache in the multi-level cache system to the first private cache, the access is invalid in the first private cache, and the first private cache can initiate an invalidation processing request to the shared cache.
  • the shared cache determines the corresponding target subsidiary information in the subsidiary directory according to the target access data block corresponding to the access request, and generates a relevant response to the invalidation processing request according to the identification information in the target subsidiary information, and returns it to the first private cache that initiated the invalidation processing request.
  • the access in response to the access request of the second private cache to the first private cache, the access is invalid, and the invalidation processing request sent by the first private cache to the shared cache enables the shared cache to respond to the invalidation processing request through the subsidiary directory maintained in its tag domain, thereby enabling the first private cache to respond to the second private cache, realizing exception processing in abnormal access scenarios, improving the stability of the multi-level cache system, and obtaining the post-write information of the target access data block on multiple processor cores through access to the subsidiary directory, optimizing the access method of the multi-level cache system, improving access efficiency, and optimizing access results.
  • Figure 12 is a flow chart of an access method of a multi-level cache system according to another embodiment of the present disclosure. As shown in Figure 12, the method includes: S1201-S1202.
  • identification information of the subsidiary information in the subsidiary directory in the tag field of the shared cache may not match the actual post-write information in the multi-level cache system.
  • the target access data block that the access request needs to access is indicated by the target subsidiary information corresponding to the subsidiary directory, and the target access data block does not exist in the first private cache of the multi-level cache system. It can be understood that there is a difference between the information in the subsidiary directory in the current shared cache and the post-write information of the data in the multi-level cache system. Therefore, the information in the subsidiary directory needs to be updated.
  • the replacement policy corresponding to the subsidiary directory of the shared cache may be obtained, and the relevant information of the subsidiary directory may be updated according to the corresponding replacement policy.
  • the corresponding tag corresponding data block in the first private cache is valid and In the clean state, in this scenario, it can be understood that the data block is a clean data block in the multi-level cache system. Therefore, if the data block has a corresponding owner processor core, the shared cache generates a corresponding invalidation request and uses it as the third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block.
  • the state of the corresponding data block stored in the first private cache on the owner processor core is adjusted to invalid to ensure that the data block is in a clean state in the multi-level cache system.
  • a data block corresponding to a corresponding tag in the first private cache is valid and dirty.
  • the data block is a dirty data block in a multi-level cache system.
  • the backup data stored in the first private cache on the non-owner processor core corresponding to the data block needs to be invalidated, wherein the shared cache can generate a corresponding invalidation request and send it as a fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block.
  • the state of a corresponding data block stored in a first private cache on a non-owner processor core is adjusted to invalid, so as to ensure that the data block is in a dirty state in the multi-level cache system.
  • a data block corresponding to a corresponding tag in the first private cache is in a valid and dirty state.
  • the data block is a data block having an owner processor core in a multi-level cache system.
  • the shared cache can also generate a corresponding invalidate and write back request, and send it as a third invalidate and write back request to the first private cache on the owner processor core corresponding to the data block corresponding to the tag, or to the first private cache on the backup processor core that exclusively owns the data block corresponding to the tag.
  • the shared cache in response to the shared cache storing a backup data block corresponding to the data block corresponding to the tag, and the identification information of the updated auxiliary information does not match the post-write information of the data block corresponding to the tag in the first private cache, the shared cache needs to perform corresponding replacement processing on the related data stored in itself, wherein the shared cache can replace the backup data blocks stored in the data domain in its own data storage array.
  • the access method of the multi-level cache system proposed in the embodiment of the present disclosure responds to the indication in the identification information of the target subsidiary information corresponding to the target access data block that the relevant information of the corresponding target access data block does not exist in the first private cache, and it is necessary to update the subsidiary directory of the shared cache, obtain the updated subsidiary directory, and update the information of the first private cache according to the updated subsidiary information in the updated subsidiary directory.
  • the stability of the multi-level cache system is improved, the access method of the multi-level cache system is optimized, the access efficiency is improved, and the access results are optimized.
  • an embodiment of the present disclosure also proposes an access device for the multi-level cache system. Since the access device for the multi-level cache system proposed in the embodiment of the present disclosure corresponds to the access methods for the multi-level cache system proposed in the above-mentioned embodiments, the implementation methods of the access methods for the multi-level cache system are also applicable to the access device for the multi-level cache system proposed in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
  • FIG. 13 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure.
  • the access device 1300 of the multi-level cache system includes an acquisition module 131, an access module 132, and a response module 133, wherein:
  • An acquisition module 131 is used to acquire an access request of a multi-level cache system
  • the access module 132 is used to obtain, according to the access request, a target access data block of the access request in the multi-level cache system and target attachment information of the target access data block from an attachment directory of the multi-level cache system, wherein the attachment directory is stored in a shared cache in the multi-level cache system;
  • the response module 133 is used to respond to the access request according to the target attached information.
  • the response module 133 is further used to: determine the access status of the access request according to the target attached information; and the shared cache responds to the access request in the access status.
  • the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
  • the response module 133 is further used to: obtain an access request sent by the first private cache to the second private cache in the multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache; determine, in the subsidiary directory of the shared cache, subsidiary information corresponding to a target access data block of the access request in the multi-level cache system as target subsidiary information; obtain subsidiary information on the subsidiary identification bit of the target subsidiary information, and obtain the access status of the access request based on the subsidiary information on the subsidiary identification bit.
  • the response module 133 is further configured to: in response to the target auxiliary information indication, the first private cache responds to the second private cache The access request sent by the storage does not hit in the first private cache, and the access status of the access request is determined to be access failure.
  • the response module 133 is also used for: in response to the access status of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system; and the shared cache responds to the invalidation processing request based on the target attached information.
  • the response module 133 is further used for: in response to an access request being a read access request and the read access request not hitting the first private cache, determining that the first private cache has read-failed the read access request, the first private cache generating a first read-failure processing request corresponding to the read access request, and sending it to the shared cache; in response to an access request being a write access request and the write access request not hitting the first private cache, determining that the first private cache has write-failed the write access request, the first private cache generating a first write-failure processing request corresponding to the write access request, and sending it to the shared cache.
  • the response module 133 is further used for: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response, and sends it to the first private cache that issued the first read invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is in a dirty state, after receiving the first write back response, the shared cache generates a corresponding read invalidation response, and sends it to the first private cache that issued the first read invalidation processing request.
  • the response module 133 is further used for: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request.
  • the response module 133 is further configured to: in response to a data block in the first private cache being replaced, the first private cache sends a replacement request to the shared cache.
  • the response module 133 is also used for: in response to the shared cache storing a replacement data block corresponding to the replacement request, the shared cache performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs; in response to the shared cache not having the replacement data block corresponding to the replacement request, in the next-level storage system of the shared cache, determining the replacement data block corresponding to the replacement request, the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
  • the access module 132 is further used to: in response to the processor core to which the first private cache belongs being the backup processor core of the target access data block, determine the target subsidiary information corresponding to the target access data block in the subsidiary directory according to the identification information on the backup bit in the subsidiary directory; in response to the processor core to which the first private cache belongs being the owner processor core of the target access data block, determine the target subsidiary information corresponding to the target access data block in the subsidiary directory according to the identification information on the corresponding owner bit in the subsidiary directory.
  • the response module 133 is also used for: the shared cache obtains identification information on the valid bit of the data block to be stored and the target owner bit in the target subsidiary information, and determines the target state of the target access data block; the shared cache responds to the invalidation processing request according to the target state.
  • the response module 133 is further used to: in response to the valid bit of the data block to be stored being marked as valid, and the target owner bit being marked as the existence of an owner processor core state of the data block to be stored, determine that the target state of the target access data block is valid and dirty; in response to the valid bit of the data block to be stored being marked as valid, and the target owner bit being marked as the existence of an owner processor core state of the data block to be stored, determine that the target state of the target access data block is valid and clean.
  • the response module 133 is also used for: in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on any backup processor core corresponding to the target access data block.
  • the response module 133 is further used to: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a third write-back request and sends it to the second private cache; according to the third write-back request, the second private cache adjusts the backup data block to a shared state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to the shared state, and writes the adjusted backup data block back to the first private cache; The tag accesses the data block to a shared state.
  • the response module 133 is further used to: mark the processor core where the first private cache to which the target access data block whose state is adjusted belongs is located as the owner processor core of the target access data block adjusted to the shared state, and update it in the subsidiary directory of the shared cache.
  • the response module 133 is further configured to: the first private cache sends the data in the target access data block to the shared cache.
  • the response module 133 is also used for: in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private cache on all backup processor cores corresponding to the target access data block.
  • the response module 133 is also used for: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a second invalidation and write-back request and sends it to the second private cache; according to the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation and write-back response and sends it to the shared cache.
  • the response module 133 is further used for: in response to identifying that a backup data block of the target access data block is stored in the second private cache, the first private cache generates a second invalidation request and sends it to the second private cache; according to the second invalidation request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation response and sends it to the shared cache.
  • the response module 133 is further configured to: the first private cache on the owner processor core sends the data in the target access data block to the shared cache.
  • the response module 133 is also used to: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtain the replacement strategy of the subsidiary directory of the shared cache, and update the subsidiary directory of the shared cache according to the replacement strategy; and update the first private cache according to the updated subsidiary information in the updated subsidiary directory.
  • the response module 133 is further used for: in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a clean state, the shared cache generates a third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information; in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a dirty state, the shared cache generates a fourth invalidation request, and sends the fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block corresponding to the subsidiary information.
  • the response module 133 is also used for: in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a third invalidation and write-back request, and sends the third invalidation and write-back request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information, or, sends it to the first private cache on the backup processor core that exclusively owns the data block corresponding to the subsidiary information.
  • the response module 133 is also used for: in response to the shared cache storing a backup data block corresponding to the data block corresponding to the subsidiary information, and the identification information of the updated subsidiary information does not match the post-write information of the data block corresponding to the subsidiary information in the first private cache, the shared cache replaces the backup data block stored in the data domain in its own data storage array.
  • the access device of the multi-level cache system proposed in the embodiment of the present disclosure obtains the access request of the multi-level cache system, and reads the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request, so as to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block.
  • the access request is responded to according to the target subsidiary information.
  • a subsidiary directory on the shared cache of the multi-level cache system which realizes the effective management of the data blocks stored in the multi-level cache system, obtains the target subsidiary information corresponding to the target access data block corresponding to the access request by reading the subsidiary directory, and responds to the access request according to the target subsidiary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, thereby reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
  • an embodiment of the present disclosure further proposes a data storage device of the multi-level cache system.
  • the data storage method for the multi-level cache system proposed in the example corresponds to the data storage method for the multi-level cache system, so the implementation method of the above-mentioned data storage method for the multi-level cache system is also applicable to the data storage device for the multi-level cache system proposed in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
  • FIG14 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure.
  • a data storage device 1400 of a multi-level cache system includes a first writing module 141 and a second writing module 142, wherein:
  • a first writing module 141 is used to write the data to be stored into the multi-level cache system and obtain the post-writing information of the data to be stored in the multi-level cache system;
  • the second writing module 142 is used to generate subsidiary information corresponding to the written information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored in a shared cache in the multi-level cache system.
  • a multi-level cache system includes a shared cache, a first private cache, and a second private cache.
  • the shared cache is a shared cache in a multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are private caches of the multi-core processor; wherein each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
  • the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
  • the multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
  • the second writing module 142 is also used to: obtain the subsidiary identification bit in the initial subsidiary information of the shared cache; obtain the identification information of the data to be stored in the subsidiary identification bit from the written information, and mark the identification information to the corresponding subsidiary identification bit to generate the subsidiary information of the data to be stored.
  • the second write module 142 is further used for: writing an address bit, used to indicate the write address of a data block storing data to be stored; an address valid bit, used to indicate whether the write address of the stored data block is valid; a first valid bit, used to indicate whether a first data block stored in a shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache; a first status bit, used to indicate whether the data to be stored has been written in the shared cache; and a data domain row number bit, used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
  • the second write module 142 is also used for: a second valid bit, used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache; a second status bit, used to indicate the second data status of the second data block in all first private caches of the multi-core processor, wherein the second data status is an exclusive status (EXC) or a shared status (SHD); a backup bit, used to indicate a backup processor core in the multi-core processor that stores a backup data block of the second data block; a first owner bit, used to indicate whether there is an owner processor core of the second data block in the multi-core processor; and a second owner bit, used to indicate the owner processor core of the second data block in the multi-core processor.
  • EXC exclusive status
  • SHD shared status
  • the second writing module 142 is also used to: determine a target cache in a multi-level cache system, into which the data to be stored is written; obtain target identification information corresponding to the initial subsidiary information of the shared cache according to the target cache; and write the target subsidiary information in the subsidiary directory in response to generating the data to be stored in the target cache according to the target identification information.
  • the second writing module 142 is further used to: in response to the data to be stored being stored in the shared cache, obtain the first identification information corresponding to the initial subsidiary information.
  • the second writing module 142 is further used to: in response to marking the first identification information to the subsidiary identification bit to generate the data to be stored in the shared cache, write the first subsidiary information in the subsidiary directory of the shared cache.
  • the second writing module 142 is further used to: in response to the data to be stored being written into the first private cache, obtain the second identification information of the initial subsidiary information.
  • the second writing module 142 is further used to: in response to marking the second identification information to the subsidiary identification bit, generate the data to be stored and store it in the first private cache, and write the second subsidiary information in the subsidiary directory of the shared cache.
  • the second writing module 142 is further used to: in response to the data to be stored being written into the shared cache and the first private cache, obtain the third identification information of the initial subsidiary information.
  • the second writing module 142 is further used to: in response to marking the third identification information to the subsidiary identification bit to generate data to be stored in the shared cache and the first private cache, write the third subsidiary information in the subsidiary directory of the shared cache.
  • the second writing module 142 is also used to: in response to the data to be stored being stored in the shared cache, obtain the subsidiary information path number and the subsidiary information row number in the subsidiary directory; write the subsidiary information path number and the subsidiary information row number into the information field of the data storage array of the shared cache.
  • the second writing module 142 is also used to: in response to the absence of a corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, obtain a first replacement strategy for the subsidiary directory; determine the first replacement information in the subsidiary directory according to the first replacement strategy, delete the first replacement information and write the subsidiary information into the corresponding row of the first replacement information, and synchronously delete the data block corresponding to the first replacement information.
  • the second writing module 142 is further used to: obtain a second replacement strategy of the shared cache in response to the fact that there is no corresponding location for storing the first data block of data to be stored in the data domain of the data storage array of the shared cache; determine the second replacement data block in the data domain according to the second replacement strategy, store the first data block to the second replacement location to which the second replacement data block belongs, and delete the second replacement data block at the second replacement location; determine the second replacement information corresponding to the second replacement data block in the subsidiary directory; determine the corresponding row in the subsidiary directory where the second replacement information is deleted, and write the subsidiary information corresponding to the first data block into the corresponding row deleted.
  • the second writing module 142 is also used to: obtain the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block from the information domain of the data storage array; and determine the second replacement information from the subsidiary directory of the shared cache according to the replacement subsidiary information row number and the replacement subsidiary information path number.
  • the data storage device of the multi-level cache system proposed in the embodiment of the present disclosure obtains the post-write information of the data to be stored in the multi-level cache system, generates the subsidiary information corresponding to the data to be stored according to the post-write information, and writes it into the subsidiary directory of the shared cache used for sharing in the multi-level cache system.
  • the subsidiary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the subsidiary directory of the shared cache in the multi-level cache system, so that the post-write information of the data to be stored in the multi-level cache system can be obtained by reading the subsidiary directory in the tag field of the shared cache, which simplifies the method for obtaining the post-write information of the data to be stored, improves the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system, saves the resources for directory maintenance in the multi-level cache system, realizes the scalability of the directory in the multi-level cache system, and optimizes the performance of the multi-level cache system.
  • the embodiments of the present disclosure also propose an electronic device 1500, as shown in Figure 15, the electronic device 1500 may specifically include: a memory 1501, a processor 1502, and a computer program stored in the memory 1501 and executable on the processor 1502.
  • the processor 1502 executes the program, it implements the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
  • the embodiments of the present disclosure also propose a computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor to implement a data storage method of a multi-level cache system or an access method of a multi-level cache system as shown in the above embodiments.
  • the embodiments of the present disclosure also propose a computer program product, including a computer program, which, when executed by a processor, implements the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
  • the embodiments of the present disclosure also propose a computer program, including computer program code.
  • the computer program code runs on a computer, the computer executes the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
  • first and second are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
  • a feature defined as “first” or “second” may explicitly or implicitly include one or more of the features.
  • the meaning of “plurality” is two or more, unless otherwise clearly and specifically defined.

Abstract

An access method for a multi-level cache system. The access method for a multi-level cache system comprises: acquiring an access request of a multi-level cache system; reading an affiliated directory of the multi-level cache system according to the access request, wherein the affiliated directory is stored in a shared cache in the multi-level cache system; according to the affiliated directory, acquiring a target access data block of the access request in the multi-level cache system and target affiliated information of the target access data block; and responding to the access request according to the target affiliated information. Further disclosed are an access apparatus, and a data storage method and apparatus for a multi-level cache system, and an electronic device, a storage medium, a computer program product and a computer program.

Description

多级缓存系统的访问方法、数据存储方法及装置Multi-level cache system access method, data storage method and device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求在2022年09月28日在中国提交的中国专利申请号202211190657.X的优先权,其全部内容通过引用并入本文。This application claims priority to Chinese patent application No. 202211190657.X filed in China on September 28, 2022, the entire contents of which are incorporated herein by reference.
技术领域Technical Field
本公开涉及数据处理技术领域,具体涉及多级缓存系统的访问方法及装置、数据存储方法及装置、电子设备、存储介质、计算机程序产品和计算机程序。The present disclosure relates to the field of data processing technology, and in particular to a method and device for accessing a multi-level cache system, a method and device for storing data, an electronic device, a storage medium, a computer program product, and a computer program.
背景技术Background technique
随着技术的发展,越来越多的数据处理需要依托于多级缓存系统实现,其中,伴随着数据处理工作内容的膨胀以及数据访问速度的需求的提高,多级缓存系统在对较大批量的访问请求响应时,存在可能对多级缓存系统的运行造成较大的负荷,从而影响了多级缓存的性能,进而导致访问请求的访问延迟等相关异常情况的发生。With the development of technology, more and more data processing needs to be implemented by relying on multi-level cache systems. Among them, with the expansion of data processing workload and the increase in the demand for data access speed, the multi-level cache system may cause a large load on the operation of the multi-level cache system when responding to a large batch of access requests, thereby affecting the performance of the multi-level cache, and further leading to the occurrence of related abnormal situations such as access delays in access requests.
发明内容Summary of the invention
本公开旨在至少在一定程度上解决相关技术中的技术问题之一。The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
为此,本公开的第一方面实施例提出一种多级缓存系统的访问方法。To this end, a first aspect of the present disclosure provides an access method for a multi-level cache system.
本公开的第二方面实施例提出一种多级缓存系统的数据存储方法。A second aspect of the present disclosure provides a data storage method for a multi-level cache system.
本公开的第三方面实施例提出一种多级缓存系统的访问装置。A third aspect of the present disclosure provides an access device for a multi-level cache system.
本公开的第四方面实施例提出一种多级缓存系统的数据存储装置。A fourth aspect of the present disclosure provides a data storage device for a multi-level cache system.
本公开的第五方面实施例提出一种电子设备。A fifth aspect of the present disclosure provides an electronic device.
本公开的第六方面实施例提出一种计算机可读存储介质。A sixth aspect of the present disclosure provides a computer-readable storage medium.
本公开的第七方面实施例提出一种计算机程序产品。A seventh aspect of the present disclosure provides a computer program product.
本公开的第八方面实施例提出一种计算机程序。An eighth aspect of the present disclosure provides a computer program.
本公开第一方面实施例提出了一种多级缓存系统的访问方法,方法包括:获取多级缓存系统的访问请求;根据访问请求,从多级缓存系统的附属目录中,获取访问请求在多级缓存系统中的目标访问数据块以及目标访问数据块的目标附属信息,其中,附属目录存储于多级缓存系统中的共享缓存上;根据目标附属信息,对访问请求进行应答。The first aspect of the present disclosure proposes a method for accessing a multi-level cache system, the method comprising: obtaining an access request for the multi-level cache system; obtaining, based on the access request, a target access data block of the access request in the multi-level cache system and target subsidiary information of the target access data block from a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system; and responding to the access request based on the target subsidiary information.
另,本公开第一方面实施例提出的多级缓存系统的访问方法,还可以具备如下技术特征:In addition, the access method of the multi-level cache system proposed in the embodiment of the first aspect of the present disclosure may also have the following technical features:
根据本公开的一个实施例,根据目标附属信息,对访问请求进行应答,包括:根据目标附属信息,确定访问请求的访问状态;共享缓存对处于访问状态下的访问请求进行应答。According to an embodiment of the present disclosure, responding to an access request according to target attached information includes: determining an access status of the access request according to the target attached information; and the shared cache responding to the access request in the access status.
根据本公开的一个实施例,附属目录存储于多级缓存系统中的共享缓存上的标签域中。According to an embodiment of the present disclosure, the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
根据本公开的一个实施例,根据目标附属信息,确定访问请求的访问状态,包括:获取多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求,其中,第一私有缓存和第二私有缓存为多核处理器的私有缓存,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存;在共享缓存的附属目录中,确定访问请求在多级缓存系统中的目标访问数据块对应的附属信息,作为目标附属信息;获取目标附属信息的附属标识位上的附属信息,并根据附属标识位上的附属信息,获取访问请求的访问状态。According to one embodiment of the present disclosure, the access status of an access request is determined based on target subsidiary information, including: obtaining an access request sent by a first private cache to a second private cache in a multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache; determining, in an subsidiary directory of a shared cache, subsidiary information corresponding to a target access data block of the access request in the multi-level cache system as target subsidiary information; obtaining subsidiary information on a subsidiary identification bit of the target subsidiary information, and obtaining the access status of the access request based on the subsidiary information on the subsidiary identification bit.
根据本公开的一个实施例,根据目标附属信息,确定访问请求的访问状态,包括:响应于目标附属信息指示,第一私有缓存对第二私有缓存发送的访问请求未在第一私有缓存中命中,确定访问请求的访问状态为访问失效。According to one embodiment of the present disclosure, the access status of an access request is determined based on target attached information, including: in response to an indication by the target attached information that an access request sent by a first private cache to a second private cache does not hit in the first private cache, determining that the access status of the access request is access failure.
根据本公开的一个实施例,共享缓存对处于访问状态下的访问请求进行应答,包括:响应于多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求的访问状态为访问失效,第一私有缓存向多级缓存系统中的共享缓存发送失效处理请求;共享缓存根据目标附属信息,对失效处理请求进行应答。 According to one embodiment of the present disclosure, a shared cache responds to an access request in an access state, including: in response to an access state of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system; the shared cache responds to the invalidation processing request based on target attachment information.
根据本公开的一个实施例,响应于多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求的访问状态为访问失效,第一私有缓存向多级缓存系统中的共享缓存发送失效处理请求,包括:响应于访问请求为读访问请求且读访问请求未在第一私有缓存中命中,确定第一私有缓存对读访问请求读失效,第一私有缓存生成读访问请求对应的第一读失效处理请求,并发送至共享缓存;响应于访问请求为写访问请求且写访问请求未在第一私有缓存中命中,确定第一私有缓存对写访问请求写失效,第一私有缓存生成写访问请求对应的第一写失效处理请求,并发送至共享缓存。According to one embodiment of the present disclosure, in response to an access request sent by a first private cache to a second private cache in a multi-level cache system having an access status of access failure, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system, including: in response to the access request being a read access request and the read access request not hitting the first private cache, determining that the first private cache has read-failed the read access request, the first private cache generating a first read invalidation processing request corresponding to the read access request, and sending it to the shared cache; in response to the access request being a write access request and the write access request not hitting the first private cache, determining that the first private cache has write-failed the write access request, the first private cache generating a first write invalidation processing request corresponding to the write access request, and sending it to the shared cache.
根据本公开的一个实施例,第一私有缓存生成读访问请求对应的第一读失效处理请求,并发送至共享缓存之后,还包括:响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的读失效应答,并发送至发出第一读失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为dirty状态,共享缓存接收到第一写回应答后,生成对应的读失效应答,并发送至发出第一读失效处理请求的第一私有缓存。According to one embodiment of the present disclosure, after the first private cache generates a first read invalidation processing request corresponding to the read access request and sends it to the shared cache, it also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is in a dirty state, after receiving the first write back response, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request.
根据本公开的一个实施例,第一私有缓存生成写访问请求对应的第一写失效处理请求,并发送至共享缓存之后,还包括:响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效并写回应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存。According to one embodiment of the present disclosure, after the first private cache generates a first write-invalidation processing request corresponding to a write access request and sends it to the shared cache, it also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalid response, it generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalid and write-back response, it generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request.
根据本公开的一个实施例,方法还包括:响应于第一私有缓存中的数据块被替换,第一私有缓存向共享缓存发送替换请求。According to an embodiment of the present disclosure, the method further includes: in response to a data block in the first private cache being replaced, the first private cache sending a replacement request to the shared cache.
根据本公开的一个实施例,响应于第一私有缓存中的数据块被替换,第一私有缓存向共享缓存发送替换请求之后,还包括:响应于共享缓存中存储有替换请求对应的替换数据块,共享缓存对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核;响应于共享缓存中不存在替换请求对应的替换数据块,在共享缓存的下一级存储系统中,确定替换请求对应的替换数据块,下一级存储系统对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核。According to one embodiment of the present disclosure, in response to a data block in a first private cache being replaced, after the first private cache sends a replacement request to a shared cache, it also includes: in response to a replacement data block corresponding to the replacement request being stored in the shared cache, the shared cache performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs; in response to the fact that the replacement data block corresponding to the replacement request does not exist in the shared cache, in a next-level storage system of the shared cache, determining the replacement data block corresponding to the replacement request, the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
根据本公开的一个实施例,在共享缓存的附属目录中,确定访问请求在多级缓存系统中的目标访问数据块对应的附属信息,作为目标附属信息,包括:响应于第一私有缓存所属的处理器核为目标访问数据块的备份处理器核,根据附属目录中的备份位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息;响应于第一私有缓存所属的处理器核为目标访问数据块的拥有者处理器核,根据附属目录中对应的拥有者位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息。According to one embodiment of the present disclosure, in an auxiliary directory of a shared cache, auxiliary information corresponding to a target access data block of an access request in a multi-level cache system is determined as target auxiliary information, including: in response to a processor core to which a first private cache belongs being a backup processor core of the target access data block, determining target auxiliary information corresponding to the target access data block in the auxiliary directory based on identification information on a backup bit in the auxiliary directory; in response to a processor core to which the first private cache belongs being an owner processor core of the target access data block, determining target auxiliary information corresponding to the target access data block in the auxiliary directory based on identification information on a corresponding owner bit in the auxiliary directory.
根据本公开的一个实施例,共享缓存根据目标附属信息,对失效处理请求进行应答,包括:共享缓存获取目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定目标访问数据块的目标状态;共享缓存根据目标状态,对失效处理请求进行应答。According to an embodiment of the present disclosure, a shared cache responds to an invalidation processing request based on target attachment information, including: the shared cache obtains identification information on a valid bit of a data block to be stored and a target owner bit in the target attachment information, and determines a target state of the target access data block; the shared cache responds to the invalidation processing request based on the target state.
根据本公开的一个实施例,共享缓存获取目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定目标访问数据块的目标状态,包括:响应于待存储数据块有效位的标识为有效,且目标拥有者位的标识为待存储数据块存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且dirty;响应于待存储数据块有效位的标识为有效,且目标拥有者位的标识为待存储数据块不存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且clean。According to an embodiment of the present disclosure, a shared cache obtains identification information on a valid bit of a data block to be stored and a target owner bit in target subsidiary information, and determines a target state of a target access data block, including: in response to the identification of the valid bit of the data block to be stored as valid, and the identification of the target owner bit as a state in which an owner processor core of the data block to be stored exists, determining that the target state of the target access data block is valid and dirty; in response to the identification of the valid bit of the data block to be stored as valid, and the identification of the target owner bit as a state in which an owner processor core of the data block to be stored does not exist, determining that the target state of the target access data block is valid and clean.
根据本公开的一个实施例,共享缓存根据目标状态,对失效处理请求进行应答,包括:响应于目标状态为有效且dirty,共享缓存生成第一读失效处理请求对应的第一写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存;响应于目标状态为有效且clean,共享缓存生成第一读失效处理请求对应的第二写回请求,并发送至目标访问数据块对应的任一备份处理器核上的第一私有缓存。According to one embodiment of the present disclosure, a shared cache responds to an invalidation processing request according to a target state, including: in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request, and sends it to a first private cache on an owner processor core corresponding to a target access data block; in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to a first private cache on any backup processor core corresponding to the target access data block.
根据本公开的一个实施例,响应于目标状态为有效且dirty,共享缓存生成第一读失效处理请求对应的第一写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存之后,还包括:响 应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成第三写回请求并发送至第二私有缓存;根据第三写回请求,第二私有缓存调整备份数据块至共享状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目标访问数据块至共享状态。According to an embodiment of the present disclosure, in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request and sends it to the first private cache on the owner processor core corresponding to the target access data block, further comprising: In response to identifying that the second private cache stores a backup data block corresponding to the target access data block, the first private cache generates a third write-back request and sends it to the second private cache; based on the third write-back request, the second private cache adjusts the backup data block to a shared state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to a shared state.
根据本公开的一个实施例,第一私有缓存调整目标访问数据块至共享状态之后,还包括:将调整状态的目标访问数据块所属的第一私有缓存所在的处理器核,标记为调整至共享状态的目标访问数据块的拥有者处理器核,并在共享缓存的附属目录中更新。According to one embodiment of the present disclosure, after the first private cache adjusts the target access data block to a shared state, it also includes: marking the processor core where the first private cache to which the target access data block in the adjusted state belongs is located as the owner processor core of the target access data block adjusted to a shared state, and updating it in the subsidiary directory of the shared cache.
根据本公开的一个实施例,响应于目标状态为有效且clean,共享缓存生成第一读失效处理请求对应的第二写回请求,并发送至目标访问数据块对应的任一备份处理器核上的第一私有缓存之后,还包括:第一私有缓存将目标访问数据块中的数据,发送至共享缓存。According to one embodiment of the present disclosure, in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on any backup processor core corresponding to the target access data block, and also includes: the first private cache sends the data in the target access data block to the shared cache.
根据本公开的一个实施例,共享缓存根据目标状态,对失效处理请求进行应答,包括:响应于目标状态为有效且dirty,共享缓存生成第一写失效处理请求对应的第一无效并写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存;响应于目标状态为有效且clean,共享缓存生成第一写失效处理请求对应的第一无效请求,并发送至目标访问数据块对应的全部备份处理器核上的第一私有缓存。According to one embodiment of the present disclosure, a shared cache responds to an invalidation processing request according to a target state, including: in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private caches on all backup processor cores corresponding to the target access data block.
根据本公开的一个实施例,响应于目标状态为有效且dirty,共享缓存生成第一写失效处理请求对应的第一无效并写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存之后,还包括:响应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成第二无效并写回请求并发送至第二私有缓存;根据第二无效并写回请求,第二私有缓存调整备份数据块至无效状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目标访问数据块至无效状态,并生成第一无效并写回应答发送共享缓存。According to one embodiment of the present disclosure, in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block, and also includes: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a second invalidation and write-back request and sends it to the second private cache; according to the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation and write-back response and sends it to the shared cache.
根据本公开的一个实施例,响应于目标状态为有效且clean,共享缓存生成第一写失效处理请求对应的第一无效请求,并发送至目标访问数据块对应的全部备份处理器核上的第一私有缓存之后,还包括:响应于识别到第二私有缓存中存储有目标访问数据块的备份数据块,第一私有缓存生成第二无效请求并发送至第二私有缓存;根据第二无效请求,第二私有缓存调整备份数据块至无效状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目标访问数据块至无效状态,并生成第一无效应答发送至共享缓存。According to one embodiment of the present disclosure, in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private cache on all backup processor cores corresponding to the target access data block, and also includes: in response to identifying that the backup data block of the target access data block is stored in the second private cache, the first private cache generates a second invalidation request and sends it to the second private cache; according to the second invalidation request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation response and sends it to the shared cache.
根据本公开的一个实施例,方法还包括:拥有者处理器核上的第一私有缓存,将目标访问数据块中的数据发送至共享缓存。According to an embodiment of the present disclosure, the method further includes: a first private cache on the owner processor core sends the data in the target access data block to the shared cache.
根据本公开的一个实施例,方法还包括:响应于目标附属信息指示,目标访问数据块在多级缓存系统的第一私有缓存中不存在,获取共享缓存的附属目录的替换策略,并根据替换策略对共享缓存的附属目录进行更新;根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新。According to one embodiment of the present disclosure, the method also includes: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtaining the replacement strategy of the subsidiary directory of the shared cache, and updating the subsidiary directory of the shared cache according to the replacement strategy; and updating the first private cache according to the updated subsidiary information in the updated subsidiary directory.
根据本公开的一个实施例,根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新,包括:响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且clean状态,共享缓存生成第三无效请求,并发送第三无效请求至附属信息对应数据块对应的拥有者处理器核上的第一私有缓存;响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且dirty状态,共享缓存生成第四无效请求,并发送第四无效请求至附属信息对应数据块对应的非拥有者处理器核上的第一私有缓存。According to one embodiment of the present disclosure, information is updated on the first private cache according to the updated subsidiary information in the updated subsidiary directory, including: in response to an indication of updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a clean state, the shared cache generates a third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information; in response to an indication of updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a dirty state, the shared cache generates a fourth invalidation request, and sends the fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block corresponding to the subsidiary information.
根据本公开的一个实施例,根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新,还包括:响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且dirty状态,共享缓存生成第三无效并写回请求,并发送第三无效并写回请求至附属信息对应数据块对应的拥有者处理器核上的第一私有缓存,或者,发送至独占附属信息对应数据块的备份处理器核上的第一私有缓存。According to one embodiment of the present disclosure, the first private cache is updated according to the updated subsidiary information in the updated subsidiary directory, and the information is also updated, and the following also includes: in response to the indication of the updated subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a third invalidation and write-back request, and sends the third invalidation and write-back request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information, or, sends it to the first private cache on the backup processor core that exclusively owns the data block corresponding to the subsidiary information.
根据本公开的一个实施例,方法还包括:响应于共享缓存中存储有附属信息对应数据块对应的备份数据块,且更新附属信息的标识信息与附属信息对应数据块在第一私有缓存中的写入后信息不匹配,共享缓存对自身的数据存储阵列中的数据域中的存储的备份数据块进行替换处理。According to one embodiment of the present disclosure, the method also includes: in response to the shared cache storing a backup data block corresponding to the data block corresponding to the subsidiary information, and the identification information of the updated subsidiary information does not match the post-write information of the data block corresponding to the subsidiary information in the first private cache, the shared cache replaces the backup data block stored in the data domain in its own data storage array.
本公开第二方面实施例提出一种多级缓存系统的数据存储方法,方法包括:将待存储数据写入多级缓存系统,并获取待存储数据在多级缓存系统中的写入后信息;生成待存储数据的写入后信息对应的附 属信息,并将附属信息写入多级缓存系统的附属目录中,其中,附属目录存储于多级缓存系统中的共享缓存上。A second aspect of the present disclosure provides a data storage method for a multi-level cache system, the method comprising: writing data to be stored into the multi-level cache system, and obtaining post-write information of the data to be stored in the multi-level cache system; generating an attachment corresponding to the post-write information of the data to be stored; The subsidiary information is written into the subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored in the shared cache in the multi-level cache system.
另,本公开第二方面实施例提出的多级缓存系统的数据存储方法,还可以具备如下技术特征:In addition, the data storage method of the multi-level cache system proposed in the second aspect of the present disclosure may also have the following technical features:
根据本公开的一个实施例,多级缓存系统中包括共享缓存、第一私有缓存和第二私有缓存,共享缓存为多级缓存系统所属的多核处理器中的共享缓存,第一私有缓存和第二私有缓存为多核处理器的私有缓存;其中,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。According to one embodiment of the present disclosure, a multi-level cache system includes a shared cache, a first private cache, and a second private cache. The shared cache is a shared cache in a multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are private caches of the multi-core processor; wherein each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
根据本公开的一个实施例,附属目录存储于多级缓存系统中的共享缓存上的标签域中。According to an embodiment of the present disclosure, the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
根据本公开的一个实施例,多级缓存系统中包括第一私有缓存,其中,第一私有缓存为多级缓存系统所属的多核处理器中部分处理器核的共享缓存。According to an embodiment of the present disclosure, a multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
根据本公开的一个实施例,生成待存储数据的写入后信息对应的附属信息,包括:获取共享缓存的初始附属信息中的附属标识位;从写入后信息中,获取待存储数据在附属标识位的标识信息,并将标识信息标记至对应的附属标识位,以生成待存储数据的附属信息。According to an embodiment of the present disclosure, generating subsidiary information corresponding to post-write information of data to be stored includes: obtaining subsidiary identification bits in the initial subsidiary information of the shared cache; obtaining identification information of the data to be stored in the subsidiary identification bits from the post-write information, and marking the identification information to the corresponding subsidiary identification bits to generate the subsidiary information of the data to be stored.
根据本公开的一个实施例,初始附属信息中的附属标识位,包括:写入地址位,用于指示存储待存储数据的数据块的写入地址;地址有效位,用于指示存储数据块的写入地址是否有效;第一有效位,用于指示存储于共享缓存中的第一数据块是否有效,其中,第一数据块为共享缓存中存储待存储数据的数据块;第一状态位,用于指示待存储数据在共享缓存中是否被写过数据;数据域行号位,用于指示第一数据块在共享缓存的数据存储阵列的数据域中的存储行号。According to an embodiment of the present disclosure, the subsidiary identification bits in the initial subsidiary information include: a write address bit, used to indicate the write address of a data block storing data to be stored; an address valid bit, used to indicate whether the write address of the stored data block is valid; a first valid bit, used to indicate whether the first data block stored in the shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache; a first status bit, used to indicate whether the data to be stored has been written in the shared cache; and a data domain row number bit, used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
根据本公开的一个实施例,初始附属信息中的附属标识位,还包括:第二有效位,用于指示存储于第一私有缓存中的第二数据块是否有效,其中,第二数据块为第一私有缓存中存储待存储数据的数据块;第二状态位,用于指示第二数据块在多核处理器的全部第一私有缓存中的第二数据状态,其中,第二数据状态为独占状态(EXC)或共享状态(SHD);备份位,用于指示在多核处理器中,存储有第二数据块的备份数据块的备份处理器核;第一拥有者位,用于指示多核处理器中是否存在第二数据块的拥有者处理器核;第二拥有者位,用于指示多核处理器中,第二数据块的拥有者处理器核。According to one embodiment of the present disclosure, the attachment identification bit in the initial attachment information also includes: a second valid bit, used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache; a second status bit, used to indicate the second data status of the second data block in all first private caches of the multi-core processor, wherein the second data status is an exclusive status (EXC) or a shared status (SHD); a backup bit, used to indicate a backup processor core in the multi-core processor that stores a backup data block of the second data block; a first owner bit, used to indicate whether there is an owner processor core of the second data block in the multi-core processor; and a second owner bit, used to indicate the owner processor core of the second data block in the multi-core processor.
根据本公开的一个实施例,方法包括:确定多级缓存系统中,待存储数据写入的目标缓存;根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息;响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息。According to an embodiment of the present disclosure, the method includes: determining a target cache in a multi-level cache system to which data to be stored is written; obtaining target identification information corresponding to initial subsidiary information of a shared cache based on the target cache; in response to generating data to be stored in the target cache based on the target identification information, writing the target subsidiary information into a subsidiary directory.
根据本公开的一个实施例,根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息,包括:响应于待存储数据存储至共享缓存,获取初始附属信息对应的第一标识信息。According to an embodiment of the present disclosure, obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to storing data to be stored in the shared cache, obtaining first identification information corresponding to the initial subsidiary information.
根据本公开的一个实施例,响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息,包括:响应于将第一标识信息标记至附属标识位上生成待存储数据存储至共享缓存,写入附属目录中的第一附属信息。According to one embodiment of the present disclosure, in response to generating data to be stored according to target identification information and storing it in a target cache, target subsidiary information in a subsidiary directory is written, including: in response to marking first identification information to a subsidiary identification bit and generating data to be stored in a shared cache, the first subsidiary information in the subsidiary directory is written.
根据本公开的一个实施例,根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息,包括:响应于待存储数据写入第一私有缓存,获取初始附属信息的第二标识信息。According to an embodiment of the present disclosure, obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to data to be stored being written into a first private cache, obtaining second identification information of the initial subsidiary information.
根据本公开的一个实施例,响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息,包括:响应于将第二标识信息标记至附属标识位上生成待存储数据存储至第一私有缓存,写入附属目录中的第二附属信息。According to one embodiment of the present disclosure, in response to generating data to be stored according to target identification information and storing it in a target cache, writing target subsidiary information in a subsidiary directory includes: in response to marking second identification information to a subsidiary identification bit and generating data to be stored in a first private cache, writing second subsidiary information in the subsidiary directory.
根据本公开的一个实施例,根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息,包括:响应于待存储数据写入共享缓存和第一私有缓存,获取初始附属信息的第三标识信息。According to an embodiment of the present disclosure, obtaining target identification information corresponding to initial subsidiary information of a shared cache according to a target cache includes: in response to writing data to be stored into the shared cache and the first private cache, obtaining third identification information of the initial subsidiary information.
根据本公开的一个实施例,响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息,包括:响应于将第三标识信息标记至附属标识位上生成待存储数据存储至共享缓存和第一私有缓存,写入附属目录中的第三附属信息。According to one embodiment of the present disclosure, in response to generating data to be stored according to target identification information and storing it in a target cache, target subsidiary information is written into a subsidiary directory, including: in response to marking third identification information to the subsidiary identification bit and generating data to be stored in a shared cache and a first private cache, the third subsidiary information is written into the subsidiary directory.
根据本公开的一个实施例,将附属信息写入多级缓存系统的附属目录中之后,还包括:响应于待存储数据存储于共享缓存,获取附属信息在附属目录中的附属信息路号和附属信息行号;将附属信息路号和附属信息行号,写入共享缓存的数据存储阵列的信息域中。According to one embodiment of the present disclosure, after writing the subsidiary information into the subsidiary directory of the multi-level cache system, it also includes: in response to the data to be stored being stored in the shared cache, obtaining the subsidiary information path number and the subsidiary information row number in the subsidiary directory; writing the subsidiary information path number and the subsidiary information row number into the information field of the data storage array of the shared cache.
根据本公开的一个实施例,方法还包括:响应于附属目录中无可供待存储数据对应的附属信息写入的对应行,获取附属目录的第一替换策略;根据第一替换策略,确定附属目录中的第一替换信息,删除 第一替换信息并将附属信息写入第一替换信息的对应行,并同步删除第一替换信息对应的数据块。According to an embodiment of the present disclosure, the method further includes: in response to the fact that there is no corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, obtaining a first replacement strategy for the subsidiary directory; determining the first replacement information in the subsidiary directory according to the first replacement strategy, deleting The first replacement information is written and the supplementary information is written into the corresponding row of the first replacement information, and the data block corresponding to the first replacement information is deleted synchronously.
根据本公开的一个实施例,方法还包括:响应于共享缓存的数据存储阵列的数据域中,无可供待存储数据的第一数据块存储的对应位置,获取共享缓存的第二替换策略;根据第二替换策略,确定数据域中的第二替换数据块,将第一数据块存储至第二替换数据块所属的第二替换位置,并删除第二替换位置上的第二替换数据块;确定第二替换数据块在附属目录中对应的第二替换信息;确定附属目录中第二替换信息删除的对应行,并将第一数据块对应的附属信息写入删除的对应行。According to an embodiment of the present disclosure, the method also includes: in response to the fact that there is no corresponding location for storing the first data block of data to be stored in the data domain of the data storage array of the shared cache, obtaining a second replacement strategy of the shared cache; determining the second replacement data block in the data domain according to the second replacement strategy, storing the first data block to the second replacement position to which the second replacement data block belongs, and deleting the second replacement data block at the second replacement position; determining the second replacement information corresponding to the second replacement data block in the subsidiary directory; determining the corresponding row in the subsidiary directory where the second replacement information is deleted, and writing the subsidiary information corresponding to the first data block into the corresponding row deleted.
根据本公开的一个实施例,确定第二替换数据块在附属目录中对应的第二替换信息,包括:从数据存储阵列的信息域中,获取第二替换数据块对应的第二替换信息的替换附属信息行号和替换附属信息路号;根据替换附属信息行号和替换附属信息路号,从共享缓存的附属目录中,确定第二替换信息。According to one embodiment of the present disclosure, determining the second replacement information corresponding to the second replacement data block in the subsidiary directory includes: obtaining the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block from the information domain of the data storage array; and determining the second replacement information from the subsidiary directory of the shared cache according to the replacement subsidiary information row number and the replacement subsidiary information path number.
本公开第三方面实施例提出了一种多级缓存系统的访问装置,其特征在于,装置包括:获取模块,用于获取多级缓存系统的访问请求;访问模块,用于根据访问请求,从多级缓存系统的附属目录中,获取访问请求在多级缓存系统中的目标访问数据块以及目标访问数据块的目标附属信息,其中,附属目录存储于多级缓存系统中的共享缓存上;应答模块,用于根据目标附属信息,对访问请求进行应答。The third aspect embodiment of the present disclosure proposes an access device for a multi-level cache system, characterized in that the device includes: an acquisition module, used to obtain an access request for the multi-level cache system; an access module, used to obtain, according to the access request, a target access data block of the access request in the multi-level cache system and target subsidiary information of the target access data block from a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system; and a response module, used to respond to the access request according to the target subsidiary information.
本公开第四方面实施例提出了一种级缓存系统的数据存储装置,其特征在于,装置包括:第一写入模块,用于将待存储数据写入多级缓存系统,并获取待存储数据在多级缓存系统中的写入后信息;第二写入模块,用于生成待存储数据的写入后信息对应的附属信息,并将附属信息写入多级缓存系统的附属目录中,其中,附属目录存储于多级缓存系统中的共享缓存上。An embodiment of the fourth aspect of the present disclosure proposes a data storage device for a multi-level cache system, characterized in that the device includes: a first writing module, used to write data to be stored into the multi-level cache system, and obtain post-write information of the data to be stored in the multi-level cache system; a second writing module, used to generate subsidiary information corresponding to the post-write information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system.
本公开第五方面实施例提出了一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时,实现如上述第一方面提出的多级缓存系统的访问方法或上述第二方面提出的多级缓存系统的数据存储方法。The fifth aspect of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the access method of the multi-level cache system proposed in the first aspect or the data storage method of the multi-level cache system proposed in the second aspect is implemented.
为达上述目的,本公开第六方面实施例提出了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面实施例提出的多级缓存系统的访问方法或上述第二方面实施例提出的多级缓存系统的数据存储方法。To achieve the above-mentioned objectives, the sixth aspect embodiment of the present disclosure proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the access method of the multi-level cache system proposed in the first aspect embodiment or the data storage method of the multi-level cache system proposed in the second aspect embodiment.
本公开第七方面实施例提出了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述第一方面实施例提出的多级缓存系统的访问方法或上述第二方面实施例提出的多级缓存系统的数据存储方法。A seventh aspect embodiment of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, implements the access method of the multi-level cache system proposed in the first aspect embodiment or the data storage method of the multi-level cache system proposed in the second aspect embodiment.
本公开第八方面的实施例提出了一种计算机程序,包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得所述计算机执行上述第一方面实施例提出的多级缓存系统的访问方法或上述第二方面实施例提出的多级缓存系统的数据存储方法。An embodiment of the eighth aspect of the present disclosure proposes a computer program, including computer program code. When the computer program code runs on a computer, the computer executes the access method of the multi-level cache system proposed in the embodiment of the first aspect or the data storage method of the multi-level cache system proposed in the embodiment of the second aspect.
本公开实施例多级缓存系统的访问方法及装置、数据存储方法及装置、电子设备、存储介质、计算机程序产品和计算机程序,其中,多级缓存系统的访问方法包括,获取多级缓存系统的访问请求,并根据访问请求对多级缓存系统中的共享缓存上存储的附属目录进行读取,以获取访问请求在多级缓存系统中对应的目标访问数据块以及目标访问数据块对应的目标附属信息。在一些实施例中,根据目标附属信息,对访问请求进行应答。多级缓存系统的数据存储方法包括,获取待存储数据在多级缓存系统中的写入后信息,根据写入后信息生成待存储数据对应的附属信息,并将其写入多级缓存系统中用于共享的共享缓存的附属目录中。本公开实施例中,生成待存储数据在多级缓存系统中的写入后信息对应的附属信息,并将其写入多级缓存系统中的共享缓存的附属目录中,使得通过读取共享缓存的标签域中的附属目录,可以实现对待存储数据在多级缓存系统中的写入后信息的获取,简化了待存储数据的写入后信息的获取方法,提高了对多级缓存系统中的待存储数据的写入后信息的获取效率,节约了多级缓存系统中目录维护的资源,实现了多级缓存系统中的目录的可扩展,优化了多级缓存系统的性能。多级缓存系统的共享缓存上存在附属目录,实现了对多级缓存系统中存储的数据块的有效管理,通过读取附属目录获取访问请求对应的目标访问数据块对应的目标附属信息,并根据目标附属信息对访问请求进行应答,简化了访问请求对应的应答信息的获取方法,从而降低了对访问请求进行应答对多级缓存系统造成的负荷程度,提高了多级缓存系统性能的稳定性,进而降低了访问请求的访问延迟,优化了多级缓存系统的访问方法,提高了多级缓存系统的访问效率,节约了多级缓存系统的资源。The access method and device of the multi-level cache system of the embodiments of the present disclosure, the data storage method and device, the electronic device, the storage medium, the computer program product and the computer program, wherein the access method of the multi-level cache system includes obtaining an access request of the multi-level cache system, and reading the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block. In some embodiments, the access request is responded to according to the target subsidiary information. The data storage method of the multi-level cache system includes obtaining post-write information of the data to be stored in the multi-level cache system, generating the subsidiary information corresponding to the data to be stored according to the post-write information, and writing it into the subsidiary directory of the shared cache for sharing in the multi-level cache system. In the disclosed embodiment, the auxiliary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the auxiliary directory of the shared cache in the multi-level cache system, so that by reading the auxiliary directory in the tag field of the shared cache, the post-write information of the data to be stored in the multi-level cache system can be obtained, the method for obtaining the post-write information of the data to be stored is simplified, the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system is improved, the resources for directory maintenance in the multi-level cache system are saved, the directory in the multi-level cache system is expandable, and the performance of the multi-level cache system is optimized. The auxiliary directory exists on the shared cache of the multi-level cache system, and the effective management of the data blocks stored in the multi-level cache system is realized. The target auxiliary information corresponding to the target access data block corresponding to the access request is obtained by reading the auxiliary directory, and the access request is responded to according to the target auxiliary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and further reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
应当理解,本公开所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本 公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that the contents described in the present disclosure are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the present disclosure. Scope of the disclosure. Other features of the present disclosure will become readily understood through the following description.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
本公开上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
图1为本公开一实施例的多级缓存系统的访问方法的流程示意图;FIG1 is a schematic flow chart of a method for accessing a multi-level cache system according to an embodiment of the present disclosure;
图2为本公开另一实施例的多级缓存系统的访问方法的流程示意图;FIG2 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure;
图3为本公开一实施例的多级缓存系统的示意图;FIG3 is a schematic diagram of a multi-level cache system according to an embodiment of the present disclosure;
图4为本公开一实施例的多级缓存系统的数据存储方法的流程示意图;FIG4 is a schematic flow chart of a data storage method of a multi-level cache system according to an embodiment of the present disclosure;
图5为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图;FIG5 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure;
图6为本公开一实施例的多级缓存系统的附属信息的示意图;FIG6 is a schematic diagram of auxiliary information of a multi-level cache system according to an embodiment of the present disclosure;
图7为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图;FIG7 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure;
图8为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图;FIG8 is a schematic flow chart of a data storage method of a multi-level cache system according to another embodiment of the present disclosure;
图9为本公开一实施例的附属目录的示意图;FIG9 is a schematic diagram of an attached directory according to an embodiment of the present disclosure;
图10为本公开另一实施例的附属目录的示意图;FIG10 is a schematic diagram of an attached directory according to another embodiment of the present disclosure;
图11为本公开另一实施例的多级缓存系统的访问方法的流程示意图;FIG11 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure;
图12为本公开另一实施例的多级缓存系统的访问方法的流程示意图;FIG12 is a schematic flow chart of a method for accessing a multi-level cache system according to another embodiment of the present disclosure;
图13为本公开一实施例的多级缓存系统的访问装置的结构示意图;FIG13 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure;
图14为本公开一实施例的多级缓存系统的数据存储装置的结构示意图;FIG14 is a schematic diagram of the structure of a data storage device of a multi-level cache system according to an embodiment of the present disclosure;
图15为本公开一实施例的电子设备的结构示意图。FIG. 15 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面详细描述本公开的实施例,实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本公开,而不能理解为对本公开的限制。Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
图1为本公开一实施例的多级缓存系统的访问方法的流程示意图,如图1所示,该方法包括:S101-S103。FIG1 is a flow chart of a method for accessing a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG1 , the method includes: S101 - S103 .
S101,获取多级缓存系统的访问请求。S101, obtaining an access request to a multi-level cache system.
在一些实施例中,可以通过对多级缓存系统发起对应的请求,实现对多级缓存系统中存储的数据的获取。In some embodiments, the data stored in the multi-level cache system can be obtained by initiating a corresponding request to the multi-level cache system.
在一些实施例中,可以将读取多级缓存系统中存储的数据对应的请求确定为多级缓存系统的访问请求。In some embodiments, a request corresponding to reading data stored in the multi-level cache system may be determined as an access request to the multi-level cache system.
本公开实施例中,多级缓存系统中配置有对其接收到的访问请求进行接收和读取的对应功能单元,可以通过对该功能单元中接收到的信息进行读取,从而获取发送给多级缓存系统的访问请求。In the disclosed embodiment, the multi-level cache system is configured with a corresponding functional unit for receiving and reading the access requests it receives, and the access requests sent to the multi-level cache system can be obtained by reading the information received in the functional unit.
S102,根据访问请求,从多级缓存系统的附属目录中,获取访问请求在多级缓存系统中的目标访问数据块以及目标访问数据块的目标附属信息,其中,附属目录存储于多级缓存系统中的共享缓存上。S102, according to the access request, obtain the target access data block of the access request in the multi-level cache system and the target subsidiary information of the target access data block from the subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on the shared cache in the multi-level cache system.
为了实现对多级缓存系统中存储的数据块的有效管理,本公开实施例中,可以在多级缓存系统中的共享缓存上配置对应的区域,用于存储多级缓存系统对应的附属目录。In order to achieve effective management of data blocks stored in the multi-level cache system, in the embodiment of the present disclosure, a corresponding area may be configured on the shared cache in the multi-level cache system for storing the corresponding subsidiary directory of the multi-level cache system.
其中,附属目录可以用于存储多级缓存系统中存储的数据块所对应的存储信息,进而使得可以通过附属目录实现对多级缓存系统中的对应数据块的访问。The subsidiary directory may be used to store storage information corresponding to data blocks stored in the multi-level cache system, thereby enabling access to corresponding data blocks in the multi-level cache system through the subsidiary directory.
本公开实施例中,可以对访问请求中携带的具体信息进行读取,并根据读取得到的信息读取多级缓存系统的共享缓存上存储的附属目录。In the disclosed embodiment, the specific information carried in the access request may be read, and the subsidiary directory stored in the shared cache of the multi-level cache system may be read according to the read information.
在一些实施例中,访问请求中可以携带有其所需读取的数据块对应的标识信息,同时,该标识信息在多级缓存的共享缓存的附属目录中存在对应的标识信息,响应于标识信息与其在附属目录中对应的标识信息匹配,将该匹配的标识信息所对应的附属目录中的信息,确定为访问请求所需的相关信息。In some embodiments, an access request may carry identification information corresponding to a data block that needs to be read. At the same time, the identification information has corresponding identification information in a subsidiary directory of a shared cache of a multi-level cache. In response to the identification information being matched with the corresponding identification information in the subsidiary directory, the information in the subsidiary directory corresponding to the matched identification information is determined to be the relevant information required for the access request.
本公开实施例中,附属目录中存储有多级缓存系统中存储的数据块对应的存储信息,因此,可以根 据附属目录获取访问请求需要进行访问和读取的对应数据块的相关信息。In the embodiment of the present disclosure, the subsidiary directory stores storage information corresponding to the data blocks stored in the multi-level cache system. The relevant information of the corresponding data block that the access request needs to access and read is obtained according to the subsidiary directory.
其中,可以将访问请求对多级缓存系统进行访问时,需要进行访问和读取的数据块,确定为访问请求在多级缓存系统中的目标访问数据块。Among them, when an access request accesses the multi-level cache system, the data block that needs to be accessed and read can be determined as the target access data block of the access request in the multi-level cache system.
相应地,可以将目标访问数据块在附属目录中存储的对应的存储信息,确定为目标访问数据块在附属目录中的目标附属信息。Accordingly, the corresponding storage information stored in the subsidiary directory of the target access data block may be determined as the target subsidiary information of the target access data block in the subsidiary directory.
在一些实施例中,可以根据访问请求,从附属目录中获取与其关联的附属信息,其中,该附属信息即为访问请求在多级缓存系统中的目标访问数据块在附属目录中存储的目标附属信息。In some embodiments, subsidiary information associated with an access request can be obtained from a subsidiary directory according to the access request, wherein the subsidiary information is target subsidiary information of a target access data block of the access request in a multi-level cache system stored in the subsidiary directory.
S103,根据目标附属信息,对访问请求进行应答。S103, responding to the access request according to the target attached information.
本公开实施例中,目标附属信息中包括有目标访问数据块存储于多级缓存系统中对应的存储信息,因此,可以根据目标附属信息实现对访问请求的应答。In the disclosed embodiment, the target subsidiary information includes storage information corresponding to the target access data block stored in the multi-level cache system. Therefore, the access request can be responded to according to the target subsidiary information.
在一些实施例中,可以根据目标附属信息中指示的目标访问数据块的存储路径,为发起访问请求的发起方提供访问请求对应的目标访问数据块中存储的数据。In some embodiments, the data stored in the target access data block corresponding to the access request may be provided to the initiator of the access request according to the storage path of the target access data block indicated in the target auxiliary information.
在一些实施例中,可以根据目标附属信息中指示的目标访问数据块的存储状态,确定访问请求是否可以正常访问其需要读取的目标访问数据块。In some embodiments, it can be determined whether the access request can normally access the target access data block that needs to be read according to the storage status of the target access data block indicated in the target auxiliary information.
其中,可以在确定访问请求可以正常读取目标访问数据块时,根据目标附属信息生成正常读取对应的返回信息,并基于返回信息对接收到的访问请求进行应答。When it is determined that the access request can normally read the target access data block, return information corresponding to the normal reading can be generated according to the target auxiliary information, and the received access request can be responded to based on the return information.
相应地,可以在确定访问请求无法正常读取目标访问数据块时,根据目标附属信息,确定访问请求无法正常访问的原因,并生成对应的应答信息,对接收到的访问请求进行应答。Accordingly, when it is determined that the access request cannot normally read the target access data block, the reason why the access request cannot normally access can be determined based on the target attached information, and corresponding response information is generated to respond to the received access request.
本公开实施例提出的多级缓存系统的访问方法,获取多级缓存系统的访问请求,并根据访问请求对多级缓存系统中的共享缓存上存储的附属目录进行读取,以获取访问请求在多级缓存系统中对应的目标访问数据块以及目标访问数据块对应的目标附属信息。在一些实施例中,根据目标附属信息,对访问请求进行应答。本公开实施例中,通过多级缓存系统的共享缓存上的附属目录,实现了对多级缓存系统中存储的数据块的有效管理,通过读取附属目录获取访问请求对应的目标访问数据块对应的目标附属信息,并根据目标附属信息对访问请求进行应答,简化了访问请求对应的应答信息的获取方法,从而降低了对访问请求进行应答对多级缓存系统造成的负荷程度,提高了多级缓存系统性能的稳定性,进而降低了访问请求的访问延迟,优化了多级缓存系统的访问方法,提高了多级缓存系统的访问效率,节约了多级缓存系统的资源。The access method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the access request of the multi-level cache system, and reads the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request, so as to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block. In some embodiments, the access request is responded to according to the target subsidiary information. In the embodiment of the present disclosure, the effective management of the data blocks stored in the multi-level cache system is realized through the subsidiary directory on the shared cache of the multi-level cache system, the target subsidiary information corresponding to the target access data block corresponding to the access request is obtained by reading the subsidiary directory, and the access request is responded to according to the target subsidiary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and further reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
上述实施例中,关于根据目标附属信息对访问请求进行应答,可结合图2进一步理解,图2为本公开另一实施例的多级缓存系统的访问方法的流程示意图,如图2所示,该方法包括:S201-S202。In the above embodiment, regarding responding to access requests based on target attached information, it can be further understood in conjunction with Figure 2. Figure 2 is a flow chart of an access method for a multi-level cache system according to another embodiment of the present disclosure. As shown in Figure 2, the method includes: S201-S202.
S201,根据目标附属信息,确定访问请求的访问状态。S201, determining the access status of the access request according to target attached information.
本公开实施例中,可以从目标附属信息中存储的目标访问数据块对应的目标附属信息,确定访问请求在多级缓存系统中的访问状态。In the disclosed embodiment, the access status of the access request in the multi-level cache system may be determined from the target subsidiary information corresponding to the target access data block stored in the target subsidiary information.
在一些实施例中,可以基于多级缓存系统中的附属目录获取目标附属信息,其中,附属目录存储于多级缓存系统中的共享缓存上的标签域中。In some embodiments, the target attachment information may be obtained based on an attachment directory in a multi-level cache system, wherein the attachment directory is stored in a tag field on a shared cache in the multi-level cache system.
在该场景下,可以从多级缓存系统中的共享缓存上的标签域中存储的附属目录,获取访问请求在多级缓存系统中的目标访问数据块对应的目标附属信息,进而确定访问请求在多级缓存系统中的访问状态。In this scenario, the target attachment information corresponding to the target access data block of the access request in the multi-level cache system can be obtained from the attachment directory stored in the tag field on the shared cache in the multi-level cache system, thereby determining the access status of the access request in the multi-level cache system.
在一些实施例中,目标访问数据块在多级缓存系统中存储时,存在可能出现异常的存储状态导致访问请求无法对其进行正常的访问和读取,在该场景下,可以根据目标访问数据块在附属目录中的目标附属信息,获取目标访问数据块对应的存储状态,从而确定访问请求对应的访问状态。In some embodiments, when a target access data block is stored in a multi-level cache system, an abnormal storage state may occur, causing the access request to be unable to access and read it normally. In this scenario, the storage state corresponding to the target access data block can be obtained based on the target subsidiary information of the target access data block in the subsidiary directory, thereby determining the access state corresponding to the access request.
在一些实施例中,为了更好的理解根据目标附属信息获取访问请求的访问状态的过程,可结合如下示例:In some embodiments, in order to better understand the process of obtaining the access status of the access request according to the target attached information, the following examples may be combined:
获取多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求,其中,第一私有缓存和第二私有缓存为多核处理器的私有缓存,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。Obtain an access request sent by a first private cache to a second private cache in a multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
本公开实施例中,多级缓存系统上可以包括共享缓存和私有缓存,其中,共享缓存为多级缓存系统 所属的多核处理器中的共享缓存,私有缓存为多级缓存系统所属的多核处理器中各多核处理器的私有缓存。In the embodiment of the present disclosure, the multi-level cache system may include a shared cache and a private cache, wherein the shared cache is a multi-level cache system. The shared cache in the multi-core processor to which the multi-level cache system belongs, and the private cache is the private cache of each multi-core processor in the multi-core processor to which the multi-level cache system belongs.
在如图3所示的多级缓存系统中,L1缓存为L2缓存的上一级缓存,L2缓存为L3缓存的上一级缓存,其中,L3缓存为图3所示的多级缓存系统中的共享缓存,L1缓存和L2缓存则为图3所示的多级缓存系统中的私有缓存。In the multi-level cache system shown in Figure 3, the L1 cache is the upper level cache of the L2 cache, and the L2 cache is the upper level cache of the L3 cache, wherein the L3 cache is the shared cache in the multi-level cache system shown in Figure 3, and the L1 cache and the L2 cache are private caches in the multi-level cache system shown in Figure 3.
其中,设定L2缓存为图3所示的多级缓存系统中的第一私有缓存,L1缓存为图3所示的多级缓存系统中的第二私有缓存。The L2 cache is set as the first private cache in the multi-level cache system shown in FIG. 3 , and the L1 cache is set as the second private cache in the multi-level cache system shown in FIG. 3 .
需要说明的是,每个多核处理器上可以包括至少一个第一私有缓存和/或至少一个第二私有缓存。It should be noted that each multi-core processor may include at least one first private cache and/or at least one second private cache.
本公开实施例中,可以通过第二私有缓存上设置的访问请求的接收读取单元,获取第一私有缓存向第二私有缓存发送的访问请求。In the embodiment of the present disclosure, the access request sent by the first private cache to the second private cache can be obtained by the access request receiving and reading unit set on the second private cache.
在一些实施例中,多级缓存系统的第一私有缓存可以向第二私有缓存发送访问请求,其中,响应于多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求的访问状态为访问失效,第一私有缓存向多级缓存系统中的共享缓存发送失效处理请求。In some embodiments, a first private cache in a multi-level cache system may send an access request to a second private cache, wherein, in response to the access status of the access request sent by the first private cache to the second private cache in the multi-level cache system being access invalidation, the first private cache sends an invalidation processing request to the shared cache in the multi-level cache system.
本公开实施例中,多核处理器可以通过访问共享缓存的附属目录,实现对多级缓存系统中存储的数据的相关信息的获取。In the disclosed embodiment, the multi-core processor can obtain relevant information about data stored in the multi-level cache system by accessing the subsidiary directory of the shared cache.
其中,可以通过向多级缓存系统中的共享缓存的附属目录发起访问请求,根据接收到的访问请求,共享缓存可以对其附属目录中的附属信息进行读取,从而获取访问请求需要访问的目标访问数据块在多级缓存系统中的分布情况以及对应状态的相关信息。Among them, an access request can be initiated to the subsidiary directory of the shared cache in the multi-level cache system. According to the received access request, the shared cache can read the subsidiary information in its subsidiary directory, so as to obtain the distribution of the target access data block that the access request needs to access in the multi-level cache system and related information of the corresponding status.
在一些实施例中,多级缓存系统中存在设定的存储层次分配策略,因此,基于第二私有缓存需要对设定数据进行获取以及使用,向其下一级的第一私有缓存发送访问请求,通过其第一私有缓存返回的应答信息,获取其所需的设定数据存储的数据块。In some embodiments, there is a set storage hierarchy allocation strategy in the multi-level cache system. Therefore, based on the need for the second private cache to obtain and use the set data, an access request is sent to the first private cache at the next level, and the data block of the set data storage required is obtained through the response information returned by the first private cache.
在该过程中,存在可能该设定数据在第一私有缓存中的存储状态异常。During this process, there is a possibility that the storage state of the setting data in the first private cache is abnormal.
在该场景下,第一私有缓存可以向其下一级缓存第二私有缓存继续发起访问请求,通过第二私有缓存对第一私有缓存进行相关的应答以及数据传输,使得第一私有缓存可以满足第二私有缓存发起的访问请求。In this scenario, the first private cache can continue to initiate access requests to its next-level cache, the second private cache, and the second private cache can provide relevant responses and data transmissions to the first private cache, so that the first private cache can satisfy the access requests initiated by the second private cache.
在一些实施例中,可以将第一私有缓存无法对第二私有缓存发起的访问请求进行满足以及正确应答的场景,确定为第一私有缓存对第二私有缓存发送的访问请求访问失败。In some embodiments, a scenario in which the first private cache cannot satisfy and correctly respond to an access request initiated by the second private cache may be determined as an access failure of the first private cache to the access request sent by the second private cache.
在一些实施例中,将该场景下第一私有缓存向共享缓存继续发起的请求,确定为对应的失效处理请求。In some embodiments, the request that the first private cache continues to initiate to the shared cache in this scenario is determined as a corresponding invalidation processing request.
在一些实施例中,响应于第二私有缓存向第一私有缓存发送的访问请求对应的相关数据块在第一私有缓存中的状态出现异常使得第一私有缓存无法对第二私有缓存发送的访问请求进行正确应答,判断当前第二私有缓存向第一私有缓存发送的访问请求访问失败。In some embodiments, in response to an access request sent by the second private cache to the first private cache, an abnormality occurs in the status of a related data block in the first private cache corresponding to the access request sent by the second private cache, making it impossible for the first private cache to correctly respond to the access request sent by the second private cache, and it is determined that the access request currently sent by the second private cache to the first private cache has failed.
在该场景下,第一私有缓存可以继续向其下一级的共享缓存发送对应的失效处理请求,通过共享缓存对其发起的失效处理请求的应答,使得第一私有缓存可以实现第二私有缓存发起的访问请求。In this scenario, the first private cache can continue to send corresponding invalidation processing requests to its next-level shared cache. Through the response of the shared cache to the invalidation processing request initiated by it, the first private cache can implement the access request initiated by the second private cache.
需要说明的是,共享缓存的附属目录存在设定的控制器,通过该设定的控制器,可以实现对多级缓存系统中用于共享的共享缓存的标签域中的附属目录的维护。其中,在多级缓存系统中共享缓存对于第一私有缓存发起的请求、返回的应答,以及共享缓存对应的下一级缓存和/或内存的一致性访问请求,以及共享缓存的相关操作,均由该设定的附属目录控制器实现。It should be noted that there is a set controller for the subsidiary directory of the shared cache, and the set controller can be used to maintain the subsidiary directory in the tag field of the shared cache used for sharing in the multi-level cache system. Among them, in the multi-level cache system, the shared cache initiates a request for the first private cache, the returned response, and the coherent access request of the next level cache and/or memory corresponding to the shared cache, as well as the related operations of the shared cache, are all implemented by the set subsidiary directory controller.
在一些实施例中,在共享缓存的附属目录中,确定访问请求在多级缓存系统中的目标访问数据块对应的附属信息,作为目标附属信息。In some embodiments, in an auxiliary directory of a shared cache, auxiliary information corresponding to a target access data block of an access request in a multi-level cache system is determined as target auxiliary information.
在一些实施例中,共享缓存接收到第一私有缓存发送的失效处理请求后,可以从失效处理请求中获取第二私有缓存向第一私有缓存发送的访问请求需要访问的数据块,其中,可以将该数据块确定为访问请求在多级缓存系统中对应的目标访问数据块。In some embodiments, after the shared cache receives an invalidation processing request sent by the first private cache, it can obtain from the invalidation processing request the data block that the access request sent by the second private cache to the first private cache needs to access, wherein the data block can be determined as the target access data block corresponding to the access request in the multi-level cache system.
为了使得第一私有缓存可以通过共享缓存返回的失效处理请求的应答信息,实现其对第二私有缓存发起的访问请求的应答,共享缓存需要获取目标访问数据块在多级缓存系统中的分布情况、存储状态等相关写入后信息。 In order for the first private cache to respond to the access request initiated by the second private cache through the response information of the invalidation processing request returned by the shared cache, the shared cache needs to obtain relevant post-write information such as the distribution and storage status of the target access data block in the multi-level cache system.
在一些实施例中,可以根据目标访问数据块的相关信息,从共享缓存的附属目录中,确定其对应的附属信息,并将其确定为目标附属信息。In some embodiments, the corresponding subsidiary information may be determined from the subsidiary directory of the shared cache according to the relevant information of the target access data block, and the corresponding subsidiary information may be determined as the target subsidiary information.
在一些实施例中,在目标访问数据块存储于多级缓存系统中的第一私有缓存,并且,目标访问数据块存储的第一私有缓存所属的处理器核为目标访问数据块的备份处理器核的场景下,可以根据备份处理器核对应的标识信息在共享缓存的附属目录中的备份位上进行相关的查询,将备份位上包含有该备份处理器核对应的标识信息的附属信息,确定为该目标访问数据块对应的目标附属信息。In some embodiments, in a scenario where a target access data block is stored in a first private cache in a multi-level cache system, and a processor core to which the first private cache storing the target access data block belongs is a backup processor core of the target access data block, a relevant query can be performed on a backup bit in a subsidiary directory of a shared cache based on identification information corresponding to the backup processor core, and subsidiary information on the backup bit that contains identification information corresponding to the backup processor core can be determined as target subsidiary information corresponding to the target access data block.
在一些实施例中,在目标访问数据块存储于多级缓存系统中的共享缓存的场景下,可以通过目标访问数据块在数据存储阵列的信息域中对应的附属信息,从附属目录中确定其对应的目标附属信息。In some embodiments, in a scenario where the target access data block is stored in a shared cache in a multi-level cache system, the corresponding target subsidiary information can be determined from the subsidiary directory through the subsidiary information corresponding to the target access data block in the information domain of the data storage array.
在一些实施例中,获取目标附属信息的附属标识位上的附属信息,并根据附属标识位上的附属信息,获取访问请求的访问状态。In some embodiments, the supplementary information on the supplementary identification bit of the target supplementary information is obtained, and the access status of the access request is obtained based on the supplementary information on the supplementary identification bit.
在一些实施例中,可以对目标附属信息上存在的附属标识为上的附属信息进行读取,根据读取到的附属信息的内容,确定目标访问数据块在多级缓存系统中的存储状态。In some embodiments, the subsidiary information with the subsidiary identifier on the target subsidiary information may be read, and the storage state of the target access data block in the multi-level cache system may be determined according to the content of the read subsidiary information.
其中,基于根据目标附属信息的附属标识位上的附属信息确定,访问请求对应的目标访问数据块当前在多级缓存系统的存储状态正常,可以被访问请求正常访问读取,确定当前访问请求的访问状态为正常。Among them, based on the subsidiary information on the subsidiary identification bit of the target subsidiary information, it is determined that the target access data block corresponding to the access request is currently in a normal storage state in the multi-level cache system and can be accessed and read normally by the access request, thereby determining that the access state of the current access request is normal.
相应地,基于根据目标附属信息的附属标识位上的附属信息确定,访问请求对应的目标访问数据块当前在多级缓存系统的存储状态出现异常,进而确定目标访问数据块无法被访问请求正常访问读取,确定当前访问请求的访问状态为异常。Accordingly, based on the subsidiary information on the subsidiary identification bit of the target subsidiary information, it is determined that the storage status of the target access data block corresponding to the access request in the multi-level cache system is abnormal, and then it is determined that the target access data block cannot be normally accessed and read by the access request, and the access status of the current access request is determined to be abnormal.
S202,共享缓存对处于访问状态下的访问请求进行应答。S202: The shared cache responds to the access request in the access state.
本公开实施例中,共享缓存可以根据确定的访问请求在多级缓存系统中的访问状态,对接收到的访问请求进行应答。In the disclosed embodiment, the shared cache may respond to the received access request according to the determined access status of the access request in the multi-level cache system.
在一些实施例中,在访问请求的访问状态为正常状态的场景下,可以基于访问请求所需的信息将目标访问数据块中的对应数据返回访问请求的发起方,从而实现对正常访问状态下的访问请求的应答。In some embodiments, when the access status of the access request is normal, the corresponding data in the target access data block can be returned to the initiator of the access request based on the information required by the access request, thereby responding to the access request in the normal access status.
在一些实施例中,在访问请求的访问状态为异常状态的场景下,可以从目标附属信息中获取访问请求出现访问状态异常所对应的异常信息,并将获取到的异常信息返回访问请求的发起方,从而实现对异常访问状态下的访问请求的应答。In some embodiments, in a scenario where the access status of an access request is abnormal, exception information corresponding to the abnormal access status of the access request can be obtained from the target auxiliary information, and the obtained exception information can be returned to the initiator of the access request, thereby achieving a response to the access request in the abnormal access status.
本公开实施例中,访问状态异常的访问请求,可以生成对应的失效处理请求,共享缓存可以通过对访问状态异常的访问请求所对应的失效处理请求进行应答,实现对异常访问状态下的访问请求的应答。In the disclosed embodiment, an access request with an abnormal access status may generate a corresponding invalidation processing request, and the shared cache may respond to the access request in the abnormal access status by responding to the invalidation processing request corresponding to the access request with the abnormal access status.
其中,共享缓存根据目标附属信息,对失效处理请求进行应答。The shared cache responds to the invalidation processing request according to the target attachment information.
本公开实施例中,确定共享缓存的附属目录中目标访问数据块对应的目标附属信息后,可以从目标附属信息的附属标识位上的标识信息,确定目标访问数据块的相关信息。In the embodiment of the present disclosure, after determining the target subsidiary information corresponding to the target access data block in the subsidiary directory of the shared cache, the relevant information of the target access data block can be determined from the identification information on the subsidiary identification bit of the target subsidiary information.
在一些实施例中,根据获取到的相关信息,对第一私有缓存发起的失效处理请求进行应答。In some embodiments, the invalidation processing request initiated by the first private cache is responded to according to the acquired relevant information.
在一些实施例中,设定在第二私有缓存H2将访问请求发送至第一私有缓存H1,该访问请求需要访问的目标访问数据块在第一私有缓存H1中的存储状态异常,导致第二私有缓存H2无法对其进行读取调用,在该场景下,第一私有缓存H1对第二私有缓存H2发起的访问请求访问失效。In some embodiments, it is set that the second private cache H2 sends an access request to the first private cache H1, and the storage status of the target access data block that the access request needs to access in the first private cache H1 is abnormal, resulting in the second private cache H2 being unable to make a read call on it. In this scenario, the access request initiated by the first private cache H1 to the second private cache H2 fails.
在一些实施例中,第一私有缓存H1向共享缓存H3发送了失效处理请求,共享缓存H3确定了目标访问数据块在附属目录中的目标附属信息后,获取了该目标访问数据块的备份数据块所属的备份处理器核,进而从该备份处理器核上的第一私有缓存中,获取目标访问数据块对应的备份数据块,并将其相关信息生成对应的应答信息返回第一私有缓存H1。In some embodiments, the first private cache H1 sends an invalidation processing request to the shared cache H3. After the shared cache H3 determines the target subsidiary information of the target access data block in the subsidiary directory, it obtains the backup processor core to which the backup data block of the target access data block belongs, and then obtains the backup data block corresponding to the target access data block from the first private cache on the backup processor core, and generates corresponding response information with its related information and returns it to the first private cache H1.
在一些实施例中,第一私有缓存H1根据接收到的共享缓存H3对失效处理请求返回的应答信息,对发起访问请求的第二私有缓存H2进行应答。In some embodiments, the first private cache H1 responds to the second private cache H2 that initiated the access request based on the response information returned by the shared cache H3 to the invalidation processing request.
需要说明的是,本公开实施例提出的多核处理器上的多级缓存可以包括共享缓存、第一私有缓存和第二私有缓存,其中,共享缓存为多级缓存系统所属的多核处理器的共享缓存,第一私有缓存和第二私有缓存为多核处理器的私有缓存,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。It should be noted that the multi-level cache on the multi-core processor proposed in the embodiment of the present disclosure may include a shared cache, a first private cache and a second private cache, wherein the shared cache is the shared cache of the multi-core processor to which the multi-level cache system belongs, the first private cache and the second private cache are the private caches of the multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
本公开实施例提出的多级缓存系统的访问方法,根据访问请求对应的目标访问数据块的目标附属信 息,获取访问请求的访问状态,共享缓存根据获取到访问请求的访问状态,对访问请求进行应答。其中,响应于多级缓存系统中的第二私有缓存对第一私有缓存发起的访问请求在第一私有缓存中访问失效,第一私有缓存可以向共享缓存发起失效处理请求,共享缓存根据访问请求对应的目标访问数据块,确定其在附属目录中对应的目标附属信息,根据目标附属信息中的标识信息,共享缓存生成失效处理请求的相关应答,并返回发起失效处理请求的第一私有缓存。本公开中,多级缓存系统的共享缓存上存在附属目录,实现了对多级缓存系统中存储的数据块的有效管理,通过读取附属目录获取访问请求对应的目标访问数据块对应的目标附属信息,并根据目标附属信息对访问请求进行应答,简化了访问请求对应的应答信息的获取方法,第二私有缓存向第一私有缓存的访问请求访问失效时,通过第一私有缓存向共享缓存发送的失效处理请求,使得共享缓存可以通过其标签域中维护的附属目录,实现对失效处理请求的应答,进而使得第一私有缓存可以实现对第二私有缓存的相关应答,实现了异常访问场景下的异常处理,从而降低了对访问请求进行应答对多级缓存系统造成的负荷程度,提高了多级缓存系统性能的稳定性,进而降低了访问请求出现访问延迟等异常情况的异常概率,优化了多级缓存系统的访问方法,提高了多级缓存系统的访问效率。The access method of the multi-level cache system proposed in the embodiment of the present disclosure is to access the target attached information of the target access data block corresponding to the access request according to the target attached information of the target access data block corresponding to the access request. The shared cache obtains the access status of the access request, and responds to the access request according to the access status of the access request. In response to the access request initiated by the second private cache in the multi-level cache system to the first private cache being invalidated in the first private cache, the first private cache can initiate an invalidation processing request to the shared cache, and the shared cache determines the corresponding target subsidiary information in the subsidiary directory according to the target access data block corresponding to the access request, and generates a relevant response to the invalidation processing request according to the identification information in the target subsidiary information, and returns it to the first private cache that initiated the invalidation processing request. In the present disclosure, there is an auxiliary directory on the shared cache of the multi-level cache system, which realizes the effective management of the data blocks stored in the multi-level cache system, obtains the target auxiliary information corresponding to the target access data block corresponding to the access request by reading the auxiliary directory, and responds to the access request according to the target auxiliary information, which simplifies the method of obtaining the response information corresponding to the access request. When the access request of the second private cache to the first private cache fails, the invalidation processing request sent by the first private cache to the shared cache enables the shared cache to respond to the invalidation processing request through the auxiliary directory maintained in its tag domain, thereby enabling the first private cache to respond to the second private cache, and realizing exception processing in abnormal access scenarios, thereby reducing the load degree caused by responding to access requests on the multi-level cache system, improving the stability of the performance of the multi-level cache system, and thereby reducing the abnormal probability of abnormal situations such as access delays in access requests, optimizing the access method of the multi-level cache system, and improving the access efficiency of the multi-level cache system.
图4为本公开一实施例的多级缓存系统的数据存储方法的流程示意图,如图4所示,该方法包括:S401-S402。FIG4 is a flow chart of a data storage method of a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG4 , the method includes: S401 - S402 .
S401,将待存储数据写入多级缓存系统,并获取待存储数据在多级缓存系统中的写入后信息。S401, writing the data to be stored into the multi-level cache system, and obtaining the post-writing information of the data to be stored in the multi-level cache system.
在一些实施例中,多核处理器的多级缓存系统中,每个级别可以包括至少一个缓存系统,其中,可以在设定级缓存的标签域中,写入其上一级缓存中的数据写入后的相关信息,使得该设定级缓存可以实现对其上一级缓存中的数据写入后信息的记录和维护。In some embodiments, in a multi-level cache system of a multi-core processor, each level may include at least one cache system, wherein relevant information after data in the previous level cache is written can be written into the tag field of the set level cache, so that the set level cache can record and maintain the information after the data in the previous level cache is written.
在一些实施例中,可以在该设定级缓存的标签域中,设置具有独立结构的附属目录,并根据该附属目录的结构设置,生成上一级缓存中的数据存储的相关信息在该设定级缓存的标签域中对应的附属信息。In some embodiments, an auxiliary directory with an independent structure can be set in the tag field of the set-level cache, and based on the structural setting of the auxiliary directory, the auxiliary information corresponding to the relevant information of the data stored in the previous level cache in the tag field of the set-level cache is generated.
在一些实施例中,将该附属信息写入设定级缓存的标签域中的附属目录,并将其作为上一级缓存中的数据的相关写入后信息在该设定级缓存的标签域中进行维护的稀疏目录。In some embodiments, the subsidiary information is written into a subsidiary directory in the tag field of the set level cache, and is maintained as a sparse directory in the tag field of the set level cache as relevant post-write information of data in the previous level cache.
在一些实施例中,在如图3所示的多级缓存系统中,设定L2缓存为L3缓存的上一级缓存,则可以根据L2缓存中数据的相关写入后信息生成对应的附属信息,并将其写入L3缓存的标签域中,作为L2缓存中数据的相关写入后信息在L3标签域中进行维护的稀疏目录。In some embodiments, in a multi-level cache system as shown in FIG. 3 , the L2 cache is set as the upper-level cache of the L3 cache. Corresponding subsidiary information can be generated based on relevant post-write information of the data in the L2 cache, and written into the tag field of the L3 cache as a sparse directory maintained in the L3 tag field for relevant post-write information of the data in the L2 cache.
因此,为了生成待存储数据在设定级缓存的标签域中的稀疏目录,需要获取待存储数据存储于多级缓存系统时的相关信息,并将其确定为待存储数据对应的写入后信息。Therefore, in order to generate a sparse directory of the data to be stored in the tag field of the set level cache, it is necessary to obtain relevant information when the data to be stored is stored in the multi-level cache system and determine it as the post-write information corresponding to the data to be stored.
其中,写入后信息可以包括待存储数据在多级缓存系统中的写入地址、存储状态、所占存储空间相关参数等相关信息。The post-write information may include relevant information such as the write address, storage status, and parameters related to the occupied storage space of the data to be stored in the multi-level cache system.
S402,生成待存储数据的写入后信息对应的附属信息,并将附属信息写入多级缓存系统的附属目录中,其中,附属目录存储于多级缓存系统中的共享缓存上。S402, generating subsidiary information corresponding to the written information of the data to be stored, and writing the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored in a shared cache in the multi-level cache system.
本公开实施例中,设定级缓存的标签域中设置有独立结构的附属目录,其中,附属目录由不同数据对应的附属信息组成。In the disclosed embodiment, a subsidiary directory with an independent structure is provided in the tag field of the setting level cache, wherein the subsidiary directory is composed of subsidiary information corresponding to different data.
在一些实施例中,组成附属目录的附属信息存在设定格式,因此,可以根据该设定格式将写入后信息中的相关信息进行整合,进而生成待存储数据对应的附属信息。In some embodiments, the subsidiary information constituting the subsidiary directory has a set format, and therefore, the relevant information in the written information can be integrated according to the set format to generate the subsidiary information corresponding to the data to be stored.
在一些实施例中,附属信息上存在不同类型的数据位,可以根据每个数据位上所需填写的数据类型,从写入后信息中获取对应的存储数据,并将其填写至对应的数据位上。In some embodiments, there are different types of data bits in the auxiliary information. According to the type of data to be filled in each data bit, the corresponding storage data can be obtained from the written information and filled in the corresponding data bit.
在一些实施例中,设定附属信息上设置有存储位置类型的数据位,则可以从待存储数据的写入后信息中,获取待存储数据的存储位置对应的存储数据,并将其填写至该存储位置类型的数据位上。In some embodiments, if a data bit of a storage location type is set on the auxiliary information, the storage data corresponding to the storage location of the data to be stored can be obtained from the written information of the data to be stored and filled in the data bit of the storage location type.
在一些实施例中,设定附属信息上设置有存储占用空间类型的数据位,则可以从待存储数据的写入后信息中,获取待存储数据的存储占用空间对应的存储数据,并将其填写至该存储位置类型的数据位上。In some embodiments, if a data bit of the storage occupied space type is set on the auxiliary information, the storage data corresponding to the storage occupied space of the data to be stored can be obtained from the written information of the data to be stored and filled in the data bit of the storage location type.
在一些实施例中,根据不同类型的数据位上的存储数据的填写,进而生成待存储数据对应的附属信息。In some embodiments, supplementary information corresponding to the data to be stored is generated according to the filling of the storage data on different types of data bits.
在一些实施例中,多核处理器上的多级缓存系统中,可以包括共享缓存和私有缓存,其中,私有缓 存为每个处理器核私有的缓存系统。In some embodiments, a multi-level cache system on a multi-core processor may include a shared cache and a private cache, wherein the private cache The memory is a private cache system for each processor core.
因此,为了实现对多级缓存系统中,不同类型的缓存中数据的相关写入后信息的记录和维护,可以在共享缓存的标签域中设定对应的附属目录,将附属目录存储于多级缓存系统中的共享缓存上。Therefore, in order to record and maintain relevant post-write information of data in different types of caches in a multi-level cache system, a corresponding subsidiary directory can be set in the tag field of the shared cache, and the subsidiary directory can be stored on the shared cache in the multi-level cache system.
其中,可以将多级缓存系统中的共享缓存确定为共享缓存,如图3所示,L3缓存即为图3所示的多级缓存系统中用于共享的共享缓存。Among them, the shared cache in the multi-level cache system can be determined as the shared cache. As shown in FIG. 3 , the L3 cache is the shared cache used for sharing in the multi-level cache system shown in FIG. 3 .
在一些实施例中,可以将待存储数据对应的附属信息写入共享缓存的附属目录中,作为待存储数据在共享缓存的标签域中的稀疏目录。通过对该稀疏目录的维护,实现对待存储数据的相关写入后信息的记录和维护。In some embodiments, the subsidiary information corresponding to the data to be stored can be written into the subsidiary directory of the shared cache as a sparse directory of the data to be stored in the tag field of the shared cache. By maintaining the sparse directory, the post-write information related to the data to be stored can be recorded and maintained.
可以理解为,通过对共享缓存的标签域中的附属目录的读取,即可获取待存储数据在多级缓存系统中的相关写入后信息。It can be understood that, by reading the subsidiary directory in the tag field of the shared cache, relevant post-write information of the data to be stored in the multi-level cache system can be obtained.
在图3所示的多级缓存系统中,可以将待存储数据对应的附属信息写入L3缓存的标签域中的附属目录中,作为待存储数据在L3缓存的标签域中维护的稀疏目录。In the multi-level cache system shown in FIG. 3 , the subsidiary information corresponding to the data to be stored may be written into the subsidiary directory in the tag field of the L3 cache as a sparse directory maintained in the tag field of the L3 cache for the data to be stored.
本公开实施例提出的多级缓存系统的数据存储方法,获取待存储数据在多级缓存系统中的写入后信息,根据写入后信息生成待存储数据对应的附属信息,并将其写入多级缓存系统中用于共享的共享缓存的附属目录中。本公开实施例中,生成待存储数据在多级缓存系统中的写入后信息对应的附属信息,并将其写入多级缓存系统中的共享缓存的附属目录中,使得通过读取共享缓存的标签域中的附属目录,可以实现对待存储数据在多级缓存系统中的写入后信息的获取,简化了待存储数据的写入后信息的获取方法,提高了对多级缓存系统中的待存储数据的写入后信息的获取效率,节约了多级缓存系统中目录维护的资源,实现了多级缓存系统中的目录的可扩展,优化了多级缓存系统的性能。The data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the post-write information of the data to be stored in the multi-level cache system, generates the subsidiary information corresponding to the data to be stored according to the post-write information, and writes it into the subsidiary directory of the shared cache used for sharing in the multi-level cache system. In the embodiment of the present disclosure, the subsidiary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the subsidiary directory of the shared cache in the multi-level cache system, so that the post-write information of the data to be stored in the multi-level cache system can be obtained by reading the subsidiary directory in the tag field of the shared cache, which simplifies the method for obtaining the post-write information of the data to be stored, improves the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system, saves the resources for directory maintenance in the multi-level cache system, realizes the scalability of the directory in the multi-level cache system, and optimizes the performance of the multi-level cache system.
上述实施例中,关于待存储数据的附属信息,可结合图5进一步理解,图5为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图,如图5所示,该方法包括:S501-S502。In the above embodiment, the auxiliary information about the data to be stored can be further understood in conjunction with Figure 5, which is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 5, the method includes: S501-S502.
S501,获取共享缓存的初始附属信息中的附属标识位。S501: Obtain an attachment identification bit in initial attachment information of a shared cache.
在一些实施例中,多核处理器的多级缓存系统包括了共享缓存、第一私有缓存和第二私有缓存,共享缓存为多级缓存系统所属的多核处理器中的共享缓存,第一私有缓存和第二私有缓存为多核处理器的私有缓存。In some embodiments, the multi-level cache system of a multi-core processor includes a shared cache, a first private cache, and a second private cache. The shared cache is the shared cache in the multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are the private caches of the multi-core processor.
其中,附属目录存储于共享缓存中,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。The subsidiary directory is stored in a shared cache, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
在一些实施例中,附属目录存储于多级缓存系统中的共享缓存上的标签域中。In some embodiments, the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
在一些实施例中,设定多核处理器中包括N个处理器核,则可以将N个处理器核中的每个处理器核上的私有缓存系统确定为该多核处理器上的多级缓存系统中的私有缓存,将N个处理器核共用的缓存系统确定为该多核处理器上的多级缓存系统中的共享缓存,共享缓存上存储有该多核处理器上的多级缓存系统的附属目录。In some embodiments, it is assumed that the multi-core processor includes N processor cores. The private cache system on each of the N processor cores can be determined as the private cache in the multi-level cache system on the multi-core processor, and the cache system shared by the N processor cores can be determined as the shared cache in the multi-level cache system on the multi-core processor. The shared cache stores the subsidiary directory of the multi-level cache system on the multi-core processor.
其中,可以在多级缓存中的共享缓存上的标签域中对该多个处理器上的多级缓存系统的附属目录进行存储。The subsidiary directories of the multi-level cache system on the multiple processors may be stored in a tag field on a shared cache in the multi-level cache.
如图3所示,L3缓存为图3所示的多级缓存系统中用于共享的共享缓存,L2缓存和L3缓存为处理器核的私有缓存。As shown in FIG. 3 , the L3 cache is a shared cache used for sharing in the multi-level cache system shown in FIG. 3 , and the L2 cache and the L3 cache are private caches of the processor core.
在一些实施例中,可以将图3所示的多级缓存的附属目录存储于L3缓存上的标签域中。In some embodiments, the subsidiary directory of the multi-level cache shown in FIG. 3 may be stored in a tag field on the L3 cache.
在另一些实施例中,多级缓存系统中包括第一私有缓存,其中,第一私有缓存为多级缓存系统所属的多核处理器中部分处理器核的共享缓存。In some other embodiments, the multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
可以理解为,第一私有缓存可以为多核处理器中设定数量的处理器核共用的缓存系统,其中,设定数量小于多核处理器中全部处理器核的对应数量。It can be understood that the first private cache may be a cache system shared by a set number of processor cores in a multi-core processor, wherein the set number is smaller than the corresponding number of all processor cores in the multi-core processor.
在一些实施例中,设定多核处理器中包括N个处理器核,则可以将多核处理器中M个处理器核共用的缓存系统确定为该多核处理器上的多级缓存系统中的部分共享缓存,其中,M小于N。In some embodiments, it is assumed that the multi-core processor includes N processor cores, and the cache system shared by the M processor cores in the multi-core processor can be determined as a partial shared cache in the multi-level cache system on the multi-core processor, where M is less than N.
如图3所示,在图3所示的多核处理器上的多级缓存系统中,第一私有缓存L2可以为图3所示的多核处理器中部分处理器核的共享缓存。As shown in FIG. 3 , in the multi-level cache system on the multi-core processor shown in FIG. 3 , the first private cache L2 may be a shared cache of some processor cores in the multi-core processor shown in FIG. 3 .
本公开实施例中,可以获取共享缓存的附属目录对应的初始附属信息,通过对初始附属信息上的附 属标识位进行对应的标识信息的填充,进而生成对应的附属信息。In the embodiment of the present disclosure, the initial subsidiary information corresponding to the subsidiary directory of the shared cache can be obtained, and the subsidiary directory on the initial subsidiary information can be obtained by The corresponding identification information is filled in the attribute identification bit to generate the corresponding auxiliary information.
在一些实施例中,共享缓存的初始附属信息的附属标识位,包括用于指示共享缓存相关信息的对应附属标识位。其中,用于指示共享缓存相关信息的对应附属标识位可以包括:In some embodiments, the auxiliary identification bit of the initial auxiliary information of the shared cache includes a corresponding auxiliary identification bit for indicating the information related to the shared cache. The corresponding auxiliary identification bit for indicating the information related to the shared cache may include:
写入地址位,用于指示存储待存储数据的数据块的写入地址。The write address bit is used to indicate the write address of the data block storing the data to be stored.
地址有效位,用于指示存储数据块的写入地址是否有效。The address valid bit is used to indicate whether the write address of the storage data block is valid.
第一有效位,用于指示存储于共享缓存中的第一数据块是否有效,其中,第一数据块为共享缓存中存储待存储数据的数据块。The first valid bit is used to indicate whether the first data block stored in the shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache.
第一状态位,用于指示待存储数据在共享缓存中是否被写过数据。The first status bit is used to indicate whether the data to be stored has been written in the shared cache.
数据域行号位,用于指示第一数据块在共享缓存的数据存储阵列的数据域中的存储行号。The data domain row number bit is used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
其中,可以将该部分用于指示共享缓存相关信息的对应附属标识位,确定为初始附属信息中的第一附属标识位。This part may be used to indicate a corresponding subsidiary identification bit of the shared cache related information, and may be determined as the first subsidiary identification bit in the initial subsidiary information.
需要说明的是,在第一有效位上的设定标识指示共享缓存中的第一数据块有效的场景下,第一状态位上用于指示待存储数据在共享缓存中是否被写过数据对应的设定标识有效。It should be noted that, in a scenario where the set flag on the first valid bit indicates that the first data block in the shared cache is valid, the set flag on the first status bit used to indicate whether the data to be stored has been written to the shared cache is valid.
在一些实施例中,第一状态位上的设定标识可以包括标识信息0和标识信息1,其中,响应于第一状态位上的设定标识对应的标识信息为0,判定待存储数据在共享缓存中没有被写过数据,将该场景下的待存储数据标识为没有被写过的干净数据。In some embodiments, the set flag on the first state bit may include identification information 0 and identification information 1, wherein, in response to the identification information corresponding to the set flag on the first state bit being 0, it is determined that the data to be stored has not been written in the shared cache, and the data to be stored in this scenario is identified as clean data that has not been written.
相应地,响应于第一状态位上的设定标识对应的标识信息为1,判定待存储数据在共享缓存中被写过数据,将该场景下的待存储数据标识为被写过的脏数据。Correspondingly, in response to the identification information corresponding to the setting identification on the first state bit being 1, it is determined that the data to be stored has been written in the shared cache, and the data to be stored in this scenario is identified as dirty data that has been written.
需要说明的是,存储有脏数据的第一数据块存在被替换更新的可能,响应于存储有脏数据被替换,将被替换下来的存储有脏数据的第一数据块写回至共享缓存的下一级缓存或内存。It should be noted that the first data block storing dirty data may be replaced and updated. In response to the dirty data being replaced, the replaced first data block storing dirty data is written back to the next level cache or memory of the shared cache.
在一些实施例中,第一状态位上的设定标识的更新和修改,与待存储数据在第一私有缓存中的相关信息之间存在关联。In some embodiments, there is an association between the updating and modification of the setting flag on the first status bit and the related information of the data to be stored in the first private cache.
在一些实施例中,第一私有缓存可以向共享缓存发送设定的写回请求,在该场景下,第一私有缓存可以将待存储数据在第一私有缓存中是否被写过数据的对应信息发送给共享缓存,共享缓存可以根据第一私有缓存发送的信息对第一状态位上的设定标识进行修改。In some embodiments, the first private cache can send a set write-back request to the shared cache. In this scenario, the first private cache can send corresponding information about whether the data to be stored has been written in the first private cache to the shared cache. The shared cache can modify the set flag on the first status bit based on the information sent by the first private cache.
在一些实施例中,响应于第一私有缓存将待存储数据在第一私有缓存中被写过数据的对应信息发送至共享缓存,共享缓存基于接收到的信息将其对应的第一状态位上的设定标识更新为标识信息1。In some embodiments, in response to the first private cache sending corresponding information that the data to be stored has been written in the first private cache to the shared cache, the shared cache updates the set flag on its corresponding first status bit to flag information 1 based on the received information.
在一些实施例中,响应于第一私有缓存将待存储数据在第一私有缓存未被写过数据的对应信息发送至共享缓存,共享缓存基于接收到的信息将其对应的第一状态位上的设定标识更新为标识信息0。In some embodiments, in response to the first private cache sending corresponding information that the data to be stored has not been written to the first private cache to the shared cache, the shared cache updates the set flag on its corresponding first status bit to flag information 0 based on the received information.
在一些实施例中,共享缓存的初始附属信息的附属标识位,还包括用于指示第一私有缓存相关信息的对应附属标识位。其中,用于指示第一私有缓存相关信息的对应附属标识位可以包括:In some embodiments, the auxiliary identification bit of the initial auxiliary information of the shared cache further includes a corresponding auxiliary identification bit for indicating the first private cache related information. The corresponding auxiliary identification bit for indicating the first private cache related information may include:
第二有效位,用于指示存储于第一私有缓存中的第二数据块是否有效,其中,第二数据块为第一私有缓存中存储待存储数据的数据块。The second valid bit is used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache.
第二状态位,用于指示第二数据块在多核处理器的全部第一私有缓存中的第二数据状态,其中,第二数据状态为独占状态(EXC)或共享状态(SHD)。The second state bit is used to indicate a second data state of the second data block in all first private caches of the multi-core processor, wherein the second data state is an exclusive state (EXC) or a shared state (SHD).
备份位,用于指示在多核处理器中,存储有第二数据块的备份数据块的备份处理器核。The backup bit is used to indicate a backup processor core storing a backup data block of the second data block in a multi-core processor.
第一拥有者位,用于指示多核处理器中是否存在第二数据块的拥有者处理器核。The first owner bit is used to indicate whether there is an owner processor core of the second data block in the multi-core processor.
第二拥有者位,用于指示多核处理器中,第二数据块的拥有者处理器核。The second owner bit is used to indicate the owner processor core of the second data block in the multi-core processor.
其中,可以将该部分用于指示第一私有缓存相关信息的对应附属标识位,确定为初始附属信息中的第二附属标识位。This part may be used to indicate a corresponding subsidiary identification bit of the first private cache related information, and may be determined as the second subsidiary identification bit in the initial subsidiary information.
在一些实施例中,根据附属目录中的设定顺序对共享缓存的第一附属标识位和第一私有缓存的第二附属标识位进行组合,从而生成共享缓存的附属目录中对应的完整附属标识位。In some embodiments, the first subsidiary identification bit of the shared cache and the second subsidiary identification bit of the first private cache are combined according to a setting order in the subsidiary directory to generate a corresponding complete subsidiary identification bit in the subsidiary directory of the shared cache.
S502,从写入后信息中,获取待存储数据在附属标识位上对应的标识信息,并将标识信息标记至对应的附属标识位,以生成待存储数据的附属信息。S502, obtaining identification information corresponding to the data to be stored on the subsidiary identification bit from the written information, and marking the identification information to the corresponding subsidiary identification bit to generate the subsidiary information of the data to be stored.
本公开实施例中,根据共享缓存的附属目录中的初始附属信息上设置的附属标识位,获取待存储数据的写入后信息中对应的标识信息。 In the disclosed embodiment, corresponding identification information in the post-write information of the data to be stored is obtained according to the subsidiary identification bit set on the initial subsidiary information in the subsidiary directory of the shared cache.
在一些实施例中,将获取到的标识信息标记至对应的附属标识位上,进而生成待存储数据对应的附属信息。In some embodiments, the acquired identification information is marked on the corresponding subsidiary identification bit, thereby generating subsidiary information corresponding to the data to be stored.
需要说明的是,可以将待存储数据所存储的缓存确定为待存储数据的目标缓存,根据目标缓存的不同,可以生成待存储数据在不同目标缓存下的不同的附属信息。It should be noted that the cache where the data to be stored is stored may be determined as the target cache of the data to be stored, and different subsidiary information of the data to be stored in different target caches may be generated according to different target caches.
在一些实施例中,确定多级缓存系统中,待存储数据存储的目标缓存。In some embodiments, a target cache in a multi-level cache system in which data is to be stored is determined.
在一些实施例中,待存储数据可以仅存储于共享缓存,该场景下,共享缓存即为待存储数据存储的目标缓存。In some embodiments, the data to be stored may be stored only in a shared cache. In this scenario, the shared cache is the target cache for storing the data to be stored.
在一些实施例中,待存储数据可以仅存储于第一私有缓存,该场景下,第一私有缓存即为待存储数据存储的目标缓存。In some embodiments, the data to be stored may be stored only in the first private cache. In this scenario, the first private cache is the target cache for storing the data to be stored.
在一些实施例中,待存储数据可以同时存储于共享缓存和第一私有缓存,该场景下,共享缓存和第一私有缓存均为待存储数据存储的目标缓存。In some embodiments, the data to be stored may be stored in a shared cache and a first private cache at the same time. In this scenario, both the shared cache and the first private cache are target caches for storing the data to be stored.
在一些实施例中,根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息,响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息。In some embodiments, according to the target cache, target identification information corresponding to the initial subsidiary information of the shared cache is obtained, and in response to generating data to be stored according to the target identification information, the target subsidiary information is written into the subsidiary directory.
在待存储数据可以仅存储于共享缓存的场景下,可以在待存储数据存储至共享缓存时,获取初始附属信息对应的第一标识信息,并将第一标识信息标记至附属标识位上,生成待存储数据存储至共享缓存时,写入共享缓存的附属目录中的第一附属信息。In a scenario where the data to be stored can be stored only in a shared cache, when the data to be stored is stored in the shared cache, first identification information corresponding to the initial subsidiary information can be obtained, and the first identification information can be marked on the subsidiary identification bit, so as to generate the first subsidiary information written into the subsidiary directory of the shared cache when the data to be stored is stored in the shared cache.
本公开实施例中,响应于待存储数据仅存储于共享缓存,将该场景下,从写入后信息中获取到的初始附属信息的附属标识位上所需的标识信息,确定为第一标识信息。In the embodiment of the present disclosure, in response to the data to be stored being stored only in the shared cache, the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the first identification information.
在该场景下,从写入后信息获取到的第一标识信息可以包括:In this scenario, the first identification information obtained from the post-writing information may include:
在写入地址位上标记的,待存储数据在共享缓存中存储对应的第一数据块在共享缓存中的第一写入地址。The first write address in the shared cache of the first data block corresponding to the data to be stored in the shared cache is marked on the write address bit.
在地址有效位上标记的,第一写入地址有效。Marked on the address valid bit, the first write address is valid.
在第一有效位上标记的,第一数据块的状态有效。Marked on the first valid bit, the status of the first data block is valid.
在第一状态位上标记的,待存储数据在共享缓存中是否被写过数据。The first status bit indicates whether the data to be stored has been written in the shared cache.
在数据域行号位上标记的,第一数据块在共享缓存的数据存储阵列中的数据域中的存储行号。The storage row number of the first data block in the data domain of the data storage array of the shared cache is marked on the data domain row number bit.
在第二有效位上标记的无效。Invalid marked on the second significant bit.
在第二状态位上标记的无效。Invalid flagged in the second status bit.
在备份位上标记的无效。Invalid marked in the backup position.
在第一拥有者位标记的无效。The first owner bit is marked invalid.
在第二拥有者位上标记的无效。Invalid marked in the second owner bit.
需要说明的是,由于该场景下待存储数据仅存储于共享缓存,因此,该场景下的初始附属信息中用于指示第一私有缓存相关信息的附属标识位上的第一标识信息均为无效类的指示信息。It should be noted that, since the data to be stored in this scenario is only stored in the shared cache, the first identification information on the subsidiary identification bit used to indicate the first private cache related information in the initial subsidiary information in this scenario is all invalid indication information.
在待存储数据可以仅存储于第一私有缓存的场景下,响应于待存储数据写入第一私有缓存,获取初始附属信息的第二标识信息,并响应于将第二标识信息标记至附属标识位上生成待存储数据存储至第一私有缓存,写入共享缓存的附属目录中的第二附属信息。In a scenario where the data to be stored can be stored only in the first private cache, in response to the data to be stored being written into the first private cache, second identification information of the initial subsidiary information is obtained, and in response to marking the second identification information onto the subsidiary identification bit, the data to be stored is generated to be stored in the first private cache, and second subsidiary information is written into the subsidiary directory of the shared cache.
本公开实施例中,响应于待存储数据仅存储于第一私有缓存,将该场景下,从写入后信息中获取到的初始附属信息的附属标识位上所需的标识信息,确定为第二标识信息。In the disclosed embodiment, in response to the data to be stored being stored only in the first private cache, the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the second identification information.
在该场景下,从写入后信息获取到的第二标识信息可以包括:In this scenario, the second identification information obtained from the post-writing information may include:
在写入地址位上标记的,待存储数据在第一私有缓存中存储对应的第二数据块在第一私有缓存中的第二写入地址。The data to be stored is marked on the write address bit and the corresponding second data block is stored in the first private cache at the second write address in the first private cache.
在地址有效位上标记的,第二写入地址有效。Marked on the address valid bit, the second write address is valid.
在第一有效位上标记的无效。其中,在第一有效位上的标记的无效的场景下,第一状态位处于无效状态。The mark on the first valid bit is invalid. Wherein, in the scenario where the mark on the first valid bit is invalid, the first state bit is in an invalid state.
在数据域行号位上标记的无效。The mark on the row number position of the data field is invalid.
在第二有效位上标记的,第二数据块的状态有效。Marked on the second valid bit, the status of the second data block is valid.
在第二状态位上标记的,第二数据块的第二数据状态为独占状态(EXC)或共享状态(SHD)。 The second data state of the second data block marked on the second state bit is an exclusive state (EXC) or a shared state (SHD).
在备份位上标记的,在多核处理器中存储有第二数据块的备份数据块的备份处理器核。The backup processor core marked on the backup bit stores a backup data block of the second data block in the multi-core processor.
在第一拥有者位上标记的,多核处理器中是否存在第二数据块的拥有者处理器核。The first owner bit is marked to determine whether there is an owner processor core of the second data block in the multi-core processor.
在第二拥有者位上标记的,在多核处理器中第二数据块的拥有者处理器核。The processor core marked in the second owner bit is the owner of the second data block in the multi-core processor.
需要说明的是,由于该场景下待存储数据仅存储于第一私有缓存,因此,该场景下的初始附属信息中用于指示共享缓存相关信息的附属标识位上的第二标识信息均为无效类的指示信息。It should be noted that, since the data to be stored in this scenario is only stored in the first private cache, the second identification information on the subsidiary identification bit used to indicate the shared cache related information in the initial subsidiary information in this scenario is all invalid indication information.
在待存储数据同时存储于共享缓存和第一私有缓存的场景下,响应于待存储数据写入共享缓存和第一私有缓存,获取初始附属信息的第三标识信息,并响应于将第三标识信息标记至附属标识位上生成待存储数据存储至共享缓存和第一私有缓存,写入共享缓存的附属目录中的第三附属信息。In a scenario where the data to be stored is stored in both the shared cache and the first private cache, in response to the data to be stored being written into the shared cache and the first private cache, the third identification information of the initial subsidiary information is obtained, and in response to marking the third identification information onto the subsidiary identification bit, the data to be stored is generated and stored in the shared cache and the first private cache, and the third subsidiary information is written into the subsidiary directory of the shared cache.
本公开实施例中,响应于待存储数据同时存储于共享缓存和第一私有缓存,将该场景下,从写入后信息中获取到的初始附属信息的附属标识位上所需的标识信息,确定为第三标识信息。In the embodiment of the present disclosure, in response to the data to be stored being stored in the shared cache and the first private cache at the same time, the identification information required on the subsidiary identification bit of the initial subsidiary information obtained from the post-write information in this scenario is determined as the third identification information.
在该场景下,从写入后信息获取到的第三标识信息可以包括:In this scenario, the third identification information obtained from the post-writing information may include:
在写入地址位上标记的,第一数据块在共享缓存中的第三写入地址,和/或,第二数据块在第一私有缓存中的第四写入地址。The third write address of the first data block in the shared cache and/or the fourth write address of the second data block in the first private cache are marked on the write address bit.
在地址有效位上标记的,第三写入地址和/或第四写入地址有效。It is marked on the address valid bit that the third write address and/or the fourth write address is valid.
在第一有效位上标记的,第一数据块的状态有效。Marked on the first valid bit, the status of the first data block is valid.
在第一状态位上标记的,待存储数据在共享缓存中是否被写过数据。The first status bit indicates whether the data to be stored has been written in the shared cache.
在数据域行号位上标记的,第一数据块在共享缓存的数据存储阵列中的数据域中的存储行号。The storage row number of the first data block in the data domain of the data storage array of the shared cache is marked on the data domain row number bit.
在第二有效位上标记的,第二数据块的状态有效。Marked on the second valid bit, the status of the second data block is valid.
在第二状态位上标记的,第二数据块的第二数据状态为独占状态(EXC)或共享状态(SHD)。The second data state of the second data block marked on the second state bit is an exclusive state (EXC) or a shared state (SHD).
在备份位上标记的,在多核处理器中存储有第二数据块的备份数据块的备份处理器核。The backup processor core marked on the backup bit stores a backup data block of the second data block in the multi-core processor.
在第一拥有者位上标记的,多核处理器中是否存在第二数据块的拥有者处理器核。The first owner bit is marked to determine whether there is an owner processor core of the second data block in the multi-core processor.
在第二拥有者位上标记的,在多核处理器中第二数据块的拥有者处理器核。The processor core marked in the second owner bit is the owner of the second data block in the multi-core processor.
需要说明的是,共享缓存和第一私有缓存之间存在设定的关联关系,其中,响应于共享缓存和第一私有缓存之间为不包含关系(exclusive),待存储数据可仅存储于第一私有缓存;响应于共享缓存和第一私有缓存之间为包含关系(inclusive),待存储数据可同时存储于共享缓存和第一私有缓存;响应于共享缓存和第一私有缓存之间为非包含关系(non-inclusive),待存储数据可存储于共享缓存和/或第一私有缓存。It should be noted that there is a set association relationship between the shared cache and the first private cache, wherein, in response to the shared cache and the first private cache being a non-inclusive relationship (exclusive), the data to be stored can be stored only in the first private cache; in response to the shared cache and the first private cache being an inclusive relationship (inclusive), the data to be stored can be stored in both the shared cache and the first private cache; in response to the shared cache and the first private cache being a non-inclusive relationship (non-inclusive), the data to be stored can be stored in the shared cache and/or the first private cache.
在一些实施例中,根据第一标识信息生成第一附属信息后,可以将第一附属信息写入共享缓存的附属目录中,作为待存储数据存储于共享缓存时,在共享缓存的标签域中维护的稀疏目录。In some embodiments, after the first subsidiary information is generated according to the first identification information, the first subsidiary information may be written into a subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in the shared cache.
相应地,根据第二标识信息生成第二附属信息后,可以将第二附属信息写入共享缓存的附属目录中,作为待存储数据存储于第一私有缓存时,在共享缓存的标签域中维护的稀疏目录。Accordingly, after the second subsidiary information is generated according to the second identification information, the second subsidiary information can be written into the subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in the first private cache.
相应地,根据第三标识信息生成第三附属信息后,可以将第三附属信息写入共享缓存的附属目录中,作为待存储数据同时存储于共享缓存和第一私有缓存时,在共享缓存的标签域中维护的稀疏目录。Accordingly, after the third subsidiary information is generated according to the third identification information, the third subsidiary information can be written into the subsidiary directory of the shared cache as a sparse directory maintained in the tag field of the shared cache when the data to be stored is stored in both the shared cache and the first private cache.
在一些实施例中,设定如图3所示的多核处理器上的多级缓存系统,其中,多核处理器包含128个处理器核,每个缓存行512位,物理地址40位。In some embodiments, a multi-level cache system on a multi-core processor is set as shown in FIG3 , wherein the multi-core processor includes 128 processor cores, each cache line has 512 bits, and a physical address of 40 bits.
设定待存储数据A存储于共享缓存和第一私有缓存,其中,共享缓存中存储的第一数据块A1的物理写入地址(paddr,Physical Address)为,paddr0:0x802d7950(对应二进制:0000 0000 1000 0000 0010 1101 0111 1001 0101 0000),第一数据块A1在附属信息中的第一有效位标记为有效、第一状态位标记为被写过数据状态。The data A to be stored is assumed to be stored in a shared cache and a first private cache, wherein the physical write address (paddr) of the first data block A1 stored in the shared cache is paddr0: 0x802d7950 (corresponding to binary: 0000 0000 1000 0000 0010 1101 0111 1001 0101 0000), and the first valid bit of the first data block A1 in the supplementary information is marked as valid, and the first status bit is marked as the data status that has been written.
相应地,第一私有缓存中存储的第二数据块A2在附属信息中的第二状态位标记为独占状态(EXC),存储第二数据块A2的处理器核为127号处理器核(7’b1111111),第一私有缓存中待存储数据A存储的第二数据块A2的拥有者处理器核为127号处理器核。Correspondingly, the second status bit of the second data block A2 stored in the first private cache in the auxiliary information is marked as an exclusive state (EXC), the processor core storing the second data block A2 is processor core No. 127 (7’b1111111), and the owner processor core of the second data block A2 stored in the data A to be stored in the first private cache is processor core No. 127.
在一些实施例中,待存储数据B的第一数据块B1仅存储于共享缓存,其物理写入地址为paddr1:0xf75dde08(对应二进制:0000 0000 0000 0111 0101 1101 1101 1110 0000 1000),其中,In some embodiments, the first data block B1 of the data B to be stored is only stored in the shared cache, and its physical write address is paddr1: 0xf75dde08 (corresponding to binary: 0000 0000 0000 0111 0101 1101 1101 1110 0000 1000), where:
在一些实施例中,待存储数据A和待存储数据B存储于多级缓存系统,对应的附属信息可以结合图6理解。 In some embodiments, the data to be stored A and the data to be stored B are stored in a multi-level cache system, and the corresponding auxiliary information can be understood in conjunction with FIG. 6 .
其中,如图6所示,valid表示有效,inv表示无效,EXC表示独占状态,SHD表示共享状态,第一状态位上的1表示被写过数据,0表示未被写过数据,第一拥有者位上的1表示存在拥有者处理器核,0表示不存在拥有者处理器核。As shown in FIG6 , valid indicates valid, inv indicates invalid, EXC indicates exclusive state, SHD indicates shared state, 1 on the first state bit indicates that data has been written, 0 indicates that data has not been written, 1 on the first owner bit indicates that an owner processor core exists, and 0 indicates that an owner processor core does not exist.
本公开实施例提出的多级缓存系统的数据存储方法,获取共享缓存的附属目录中的初始附属信息,根据初始附属信息的附属标识位,从待存储数据的写入后信息中获取对应的标识信息。在一些实施例中,将标识信息标记至对应的附属标识位上,从而生成待存储数据对应的附属信息。本公开实施例中,通过对附属标识位的设置,实现了多级缓存系统中目录的可拓展性,根据附属标识位获取待存储数据的写入后信息对应的标识信息,进而生成对应的附属信息,使得附属信息可以写入共享缓存的标签域中的附属目录,进而实现了共享缓存的附属目录中对于待存储数据的写入后信息的维护和记录,节约了多级缓存系统中目录维护的资源,优化了多级缓存系统的性能。The data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the initial subsidiary information in the subsidiary directory of the shared cache, and obtains the corresponding identification information from the post-write information of the data to be stored according to the subsidiary identification bit of the initial subsidiary information. In some embodiments, the identification information is marked on the corresponding subsidiary identification bit, thereby generating the subsidiary information corresponding to the data to be stored. In the embodiment of the present disclosure, the scalability of the directory in the multi-level cache system is achieved by setting the subsidiary identification bit, and the identification information corresponding to the post-write information of the data to be stored is obtained according to the subsidiary identification bit, and then the corresponding subsidiary information is generated, so that the subsidiary information can be written into the subsidiary directory in the tag field of the shared cache, thereby realizing the maintenance and recording of the post-write information of the data to be stored in the subsidiary directory of the shared cache, saving the resources for directory maintenance in the multi-level cache system, and optimizing the performance of the multi-level cache system.
上述实施例中,关于待存储数据写入附属目录,可结合图7进一步理解,图7为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图,如图7所示,该方法包括:S701-S702。In the above embodiment, regarding writing the data to be stored into the auxiliary directory, it can be further understood in conjunction with Figure 7. Figure 7 is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 7, the method includes: S701-S702.
S701,响应于附属目录中无可供待存储数据对应的附属信息写入的对应行,获取附属目录的第一替换策略。S701: In response to the fact that there is no corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, a first replacement strategy of the subsidiary directory is obtained.
在一些实施例中,在附属信息写入共享缓存的附属目录的过程中,存在可能附属目录被占满。In some embodiments, during the process of writing the auxiliary information into the auxiliary directory of the shared cache, there is a possibility that the auxiliary directory is filled.
可以理解为,附属目录中无可供附属信息写入的对应行,在该场景下,可以获取设定的处理方法,并根据获取到的处理方法在附属目录中,为附属信息空出可供写入的对应行。It can be understood that there is no corresponding row in the subsidiary directory for writing the subsidiary information. In this scenario, the set processing method can be obtained, and according to the obtained processing method, a corresponding row for writing the subsidiary information can be vacated in the subsidiary directory.
其中,可以将该场景下的处理方法确定为第一替换策略。在一些实施例中,第一替换策略可以包括随机替换策略,最近最少使用替换策略、最不经常使用替换策略以及先进先出替换策略等。The processing method in this scenario may be determined as the first replacement strategy. In some embodiments, the first replacement strategy may include a random replacement strategy, a least recently used replacement strategy, a least frequently used replacement strategy, and a first-in-first-out replacement strategy.
S702,根据第一替换策略,确定附属目录中的第一替换信息,删除第一替换信息并将附属信息写入第一替换信息的对应行,并同步删除第一替换信息对应的数据块。S702, according to the first replacement strategy, determine the first replacement information in the subsidiary directory, delete the first replacement information and write the subsidiary information into the corresponding row of the first replacement information, and simultaneously delete the data block corresponding to the first replacement information.
本公开实施例中,根据第一替换策略的具体限定,可以从附属目录中获取需要进行替换的标签,并将其确定为第一替换信息。In the embodiment of the present disclosure, according to the specific definition of the first replacement strategy, the label that needs to be replaced can be obtained from the subsidiary directory and determined as the first replacement information.
在一些实施例中,响应于第一替换策略为随机替换策略,可以随机选择一个标签作为第一替换信息。In some embodiments, in response to the first replacement strategy being a random replacement strategy, a tag may be randomly selected as the first replacement information.
在一些实施例中,响应于第一替换策略为最近最少使用替换策略,可以将设定时间范围内使用频率最低的标签,作为第一替换信息。In some embodiments, in response to the first replacement strategy being the least recently used replacement strategy, the tag with the lowest frequency of use within a set time range may be used as the first replacement information.
在一些实施例中,确定第一替换信息在附属目录中的所在行,并将待存储数据对应的附属信息写入该行,并将第一替换信息的相关信息进行删除。In some embodiments, the row where the first replacement information is located in the subsidiary directory is determined, and the subsidiary information corresponding to the data to be stored is written into the row, and the related information of the first replacement information is deleted.
在一些实施例中,附属目录是为了实现对多级缓存系统中的数据的相关写入后信息的维护,因此,在第一替换信息被替换删除后,需要对第一替换信息对应的存储数据进行相应的替换删除。In some embodiments, the subsidiary directory is used to maintain the relevant post-write information of the data in the multi-level cache system. Therefore, after the first replacement information is replaced and deleted, the storage data corresponding to the first replacement information needs to be replaced and deleted accordingly.
在一些实施例中,响应于第一替换信息对应的数据块存储于共享缓存,第一替换信息上的第一有效位需标识为有效,在该场景下,可对第一替换信息对应的数据块进行删除。In some embodiments, in response to the data block corresponding to the first replacement information being stored in the shared cache, the first valid bit on the first replacement information needs to be marked as valid. In this scenario, the data block corresponding to the first replacement information can be deleted.
其中,可以通过第一替换信息的数据域行号位上的标识信息,确定对应的数据块所在的存储位置,进而对该位置上的数据块进行删除。The storage location of the corresponding data block can be determined through the identification information on the row number position of the data field of the first replacement information, and then the data block at the location can be deleted.
在一些实施例中,响应于第一替换信息对应的数据块存储于第一私有缓存,第二替换信息上的第二有效位需标识为有效,且该数据块所属的第一私有缓存所在的处理器核为第二替换信息的备份位上指示的备份处理器核之一,在该场景下,可对第一替换信息对应的数据块进行删除。In some embodiments, in response to the data block corresponding to the first replacement information being stored in the first private cache, the second valid bit on the second replacement information needs to be marked as valid, and the processor core where the first private cache to which the data block belongs is located is one of the backup processor cores indicated on the backup bit of the second replacement information. In this scenario, the data block corresponding to the first replacement information can be deleted.
其中,可以将待存储数据对应的附属信息中获取到的待存储数据对应的数据块在第一私有缓存中的Index和Block offset作为该数据块的低位地址,将第一替换信息的写入地址位指示的地址作为该数据块的高位地址,进而确定第一替换信息对应的数据块在第一私有缓存中的存储位置。Among them, the Index and Block offset of the data block corresponding to the data to be stored obtained from the supplementary information corresponding to the data to be stored in the first private cache can be used as the low-order address of the data block, and the address indicated by the write address bit of the first replacement information can be used as the high-order address of the data block, thereby determining the storage position of the data block corresponding to the first replacement information in the first private cache.
本公开实施例提出的多级缓存系统的数据存储方法,响应于共享缓存的附属目录中无可供附属信息写入的对应行,获取附属目录的第一替换策略,并根据第一替换策略从附属目录中确定进行替换的第一替换信息,在一些实施例中,将附属信息写入第一替换信息在附属目录中的所在行,并将第一替换信息删除。相应地,确定第一替换信息在多级缓存系统中对应的数据块,并将其从对应的存储位置中删除。本公开实施例中,通过设定的第一替换策略,实现了对附属目录被占满场景的异常处理,通过维护附属目录实现对多级缓存系统中数据清理,优化了多级缓存系统的性能。 The data storage method of the multi-level cache system proposed in the embodiment of the present disclosure obtains the first replacement strategy of the subsidiary directory in response to the absence of a corresponding row for writing subsidiary information in the subsidiary directory of the shared cache, and determines the first replacement information to be replaced from the subsidiary directory according to the first replacement strategy. In some embodiments, the subsidiary information is written to the row where the first replacement information is located in the subsidiary directory, and the first replacement information is deleted. Accordingly, the data block corresponding to the first replacement information in the multi-level cache system is determined, and it is deleted from the corresponding storage location. In the embodiment of the present disclosure, by setting the first replacement strategy, exception handling is implemented for the scenario where the subsidiary directory is full, and data cleaning in the multi-level cache system is implemented by maintaining the subsidiary directory, thereby optimizing the performance of the multi-level cache system.
上述实施例中,关于待存储数据写入目标缓存,可结合图8进一步理解,图8为本公开另一实施例的多级缓存系统的数据存储方法的流程示意图,如图8所示,该方法包括:S801-S804。In the above embodiment, regarding writing the data to be stored into the target cache, it can be further understood in conjunction with Figure 8, which is a flow chart of a data storage method of a multi-level cache system in another embodiment of the present disclosure. As shown in Figure 8, the method includes: S801-S804.
S801,响应于共享缓存的数据存储阵列的数据域中,无可供待存储数据的第一数据块存储的对应位置,获取共享缓存的第二替换策略。S801, in response to the fact that there is no corresponding location for storing a first data block of data to be stored in a data domain of a data storage array of a shared cache, a second replacement strategy of the shared cache is obtained.
本公开实施例中,响应于存储有待存储数据的第一数据块写入共享缓存的过程中,存在可能,共享缓存中无可供存储有待存储数据的第一数据块写入的对应位置,在该场景下,可以获取共享缓存的数据存储阵列对应的相关处理方法,并根据获取到的处理方法为第一数据块空出可供存储的对应位置。In an embodiment of the present disclosure, in response to a process in which a first data block storing data to be stored is written into a shared cache, it is possible that there is no corresponding location in the shared cache for storing the first data block of data to be stored. In this scenario, a relevant processing method corresponding to the data storage array of the shared cache can be obtained, and a corresponding location for storage of the first data block can be vacated according to the obtained processing method.
其中,可以将该场景下获取到的处理方法确定为第二替换策略。在一些实施例中,第二替换策略可以包括随机替换策略,最近最少使用替换策略、最不经常使用替换策略以及先进先出替换策略等。The processing method obtained in this scenario can be determined as the second replacement strategy. In some embodiments, the second replacement strategy can include a random replacement strategy, a least recently used replacement strategy, a least frequently used replacement strategy, and a first-in-first-out replacement strategy.
需要说明的是,共享缓存的数据存储阵列的数据域和信息域中的存储位置存在设定的关联关系,在数据域中无可供待存储数据的第一数据块存储的对应位置的场景下,信息域中同样无可供存储第一数据块对应的附属信息的附属信息路号和附属信息行号的对应位置。It should be noted that there is a set association between the storage locations in the data domain and the information domain of the shared cache data storage array. In a scenario where there is no corresponding location in the data domain for storing the first data block of data to be stored, there is also no corresponding location in the information domain for storing the subsidiary information path number and the subsidiary information row number of the subsidiary information corresponding to the first data block.
因此,可以根据第二替换策略,将数据域中为第一数据块空出的可供存储的对应位置,相应地,将该数据域中对应位置在信息域中对应的附属信息路号和附属信息行号对应的存储位置空出,并在第一数据块存储至数据域时,将第一数据块对应的附属信息在附属目录中的附属信息行号和附属信息路号写入信息域中的对应位置。Therefore, according to the second replacement strategy, the corresponding position in the data domain that is vacated for storage of the first data block can be vacated accordingly, and the storage position corresponding to the supplementary information path number and the supplementary information row number corresponding to the corresponding position in the data domain in the information domain can be vacated, and when the first data block is stored in the data domain, the supplementary information row number and the supplementary information path number of the supplementary information corresponding to the first data block in the supplementary directory can be written into the corresponding position in the information domain.
S802,根据第二替换策略,确定数据域中的第二替换数据块,将第一数据块存储至第二替换数据块所属的第二替换位置,并删除第二替换位置上的第二替换数据块。S802, according to the second replacement strategy, determine a second replacement data block in the data domain, store the first data block to a second replacement position to which the second replacement data block belongs, and delete the second replacement data block at the second replacement position.
在一些实施例中,可以根据第二替换策略的相关限定,从共享缓存的数据存储阵列中获取可以进行替换的数据块,并将其确定为第二替换数据块。In some embodiments, according to relevant definitions of the second replacement strategy, a data block that can be replaced can be obtained from the data storage array of the shared cache and determined as the second replacement data block.
在一些实施例中,确定第二数据块在共享缓存中所属的存储位置,并将其确定为共享缓存中为第一数据块空出的第二替换位置。In some embodiments, a storage location to which the second data block belongs in the shared cache is determined and determined as a second replacement location vacated for the first data block in the shared cache.
确定第二替换位置之后,可以将第一数据块存储于第二替换位置,并将第二替换数据块从第二替换位置上删除。After the second replacement position is determined, the first data block may be stored in the second replacement position, and the second replacement data block may be deleted from the second replacement position.
S803,确定第二替换数据块在附属目录中对应的第二替换信息。S803: Determine second replacement information corresponding to the second replacement data block in the subsidiary directory.
本公开实施例中,共享缓存中存储的数据块在附属目录中存在对应的附属信息,为了保证附属目录与多级缓存中存储数据的数据块之间的强关联关系,在删除了第二替换数据块之后,需要将附属目录中与第二替换数据块对应的附属信息进行删除。In the embodiment of the present disclosure, the data blocks stored in the shared cache have corresponding subsidiary information in the subsidiary directory. In order to ensure a strong association between the subsidiary directory and the data blocks storing data in the multi-level cache, after deleting the second replacement data block, the subsidiary information corresponding to the second replacement data block in the subsidiary directory needs to be deleted.
在一些实施例中,从数据存储阵列的信息域中,获取第二替换数据块对应的第二替换信息的替换附属信息行号和替换附属信息路号。In some embodiments, the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block are obtained from the information field of the data storage array.
在一些实施例中,在数据块存储至共享缓存的数据存储阵列的数据域时,其在信息域中存在对应的记录信息,其中,可以将该数据块在附属目录中对应的标签的相关信息存储于信息域中。In some embodiments, when a data block is stored in the data domain of the data storage array of the shared cache, corresponding record information exists in the information domain, wherein relevant information of the tag corresponding to the data block in the subsidiary directory can be stored in the information domain.
本公开实施例中,共享缓存的附属目录可以为如图9所示的多路组目录,因此,附属目录中的附属信息存在对应的附属信息路号和附属信息行号。In the disclosed embodiment, the subsidiary directory of the shared cache may be a multi-way group directory as shown in FIG. 9 . Therefore, the subsidiary information in the subsidiary directory has corresponding subsidiary information way numbers and subsidiary information row numbers.
在图9所示的多路组附属目录中,附属信息组1的附属信息路号为0,附属信息组2的附属信息路号为1,附属信息组3的附属信息路号为2,以此类推。In the multi-way group subsidiary directory shown in FIG9 , the subsidiary information path number of subsidiary information group 1 is 0, the subsidiary information path number of subsidiary information group 2 is 1, the subsidiary information path number of subsidiary information group 3 is 2, and so on.
相应地,如图9所示,附属信息组1中的附属信息A处于附属信息组1中的第一行,则附属信息A在附属信息组1中的附属信息行号为0,附属信息B处于附属信息组2中的第三行,则附属信息B的附属信息行号为2,附属信息C处于附属信息组3中的第二行,则附属信息C的附属信息行号为1,以此类推。Correspondingly, as shown in Figure 9, the supplementary information A in the supplementary information group 1 is in the first row of the supplementary information group 1, and the supplementary information row number of the supplementary information A in the supplementary information group 1 is 0, the supplementary information B is in the third row of the supplementary information group 2, and the supplementary information row number of the supplementary information B is 2, the supplementary information C is in the second row of the supplementary information group 3, and the supplementary information row number of the supplementary information C is 1, and so on.
由此可知,附属信息A在图9所示的附属目录中的附属信息行号为0,附属信息路号为0,附属信息B在图9所示的附属目录中的附属信息行号为2,附属信息路号为1,附属信息C在图9所示的附属目录中的附属信息行号为1,附属信息路号为3。From this, it can be seen that the supplementary information row number of the supplementary information A in the supplementary directory shown in Figure 9 is 0, and the supplementary information path number is 0, the supplementary information row number of the supplementary information B in the supplementary directory shown in Figure 9 is 2, and the supplementary information path number is 1, and the supplementary information row number of the supplementary information C in the supplementary directory shown in Figure 9 is 1, and the supplementary information path number is 3.
在一些实施例中,获取附属信息在附属目录中的附属信息路号和附属信息行号后,可以将其作为数据块对应的记录信息,存储于数据存储阵列的信息域中。如图10所示,不同的数据块存储于数据存储阵列的不同行,在信息域中的存在的对应行则可以记录数据块对应的附属信息在附属目录中的附属信息 行号和附属信息路号。In some embodiments, after obtaining the path number and row number of the subsidiary information in the subsidiary directory, the path number and row number of the subsidiary information can be used as the record information corresponding to the data block and stored in the information field of the data storage array. As shown in FIG10 , different data blocks are stored in different rows of the data storage array, and the corresponding rows in the information field can record the subsidiary information corresponding to the data block in the subsidiary directory. Line number and attached information route number.
因此,可以从第二替换数据块在数据存储阵列的信息域的记录信息中,获取第二替换数据块对应的附属信息的附属信息路号和附属信息行号,并将其确定为替换附属信息路号和替换附属信息行号。Therefore, the subsidiary information path number and the subsidiary information row number of the subsidiary information corresponding to the second replacement data block can be obtained from the record information of the second replacement data block in the information domain of the data storage array, and determined as the replacement subsidiary information path number and the replacement subsidiary information row number.
根据第二替换数据块对应的替换附属信息路号和替换附属信息行号,在附属目录中进行查询,进而确定第二替换数据块对应的标签,并将其确定为第二替换信息。According to the replacement subsidiary information path number and the replacement subsidiary information row number corresponding to the second replacement data block, a query is performed in the subsidiary directory to determine the label corresponding to the second replacement data block and determine it as the second replacement information.
S804,确定附属目录中第二替换信息删除的对应行,并将第一数据块对应的附属信息写入删除的对应行。S804, determining the corresponding row in the subsidiary directory where the second replacement information is deleted, and writing the subsidiary information corresponding to the first data block into the corresponding row deleted.
本公开实施例中,确定第二替换信息后,可以将其进行删除处理,并将删除后的对应行作为供第一数据块对应的附属信息写入的对应行。In the embodiment of the present disclosure, after the second replacement information is determined, it can be deleted, and the corresponding row after the deletion is used as the corresponding row for writing the supplementary information corresponding to the first data block.
可以理解为,第二替换信息从附属目录中删除之后,可以将第一数据块对应的附属信息,存储于第二替换信息从附属目录删除后空出的对应行。It can be understood that after the second replacement information is deleted from the subsidiary directory, the subsidiary information corresponding to the first data block can be stored in the corresponding row vacated after the second replacement information is deleted from the subsidiary directory.
如图9所示,设定附属信息C为第二替换信息,则确定附属信息C为第二替换信息后,可以将附属信息C从其所在行中删除,并将删除后得到的对应行作为第一数据块对应的附属信息写入的对应行。As shown in FIG9 , the subsidiary information C is set as the second replacement information. After determining that the subsidiary information C is the second replacement information, the subsidiary information C can be deleted from the row where it is located, and the corresponding row obtained after the deletion is used as the corresponding row where the subsidiary information corresponding to the first data block is written.
本公开实施例提出的多级缓存系统的数据存储方法,共享缓存中无可供第一数据块存储时对应位置时,获取共享缓存对应的第二替换策略,根据第二替换策略从共享缓存的数据域中确定对应的第二替换数据块,在一些实施例中,获取第二替换数据块在共享缓存中存储的第二替换位置,将第二替换位置上的第二替换数据块删除并将待存储数据存储的第一数据块写入。相应地,获取第二替换数据块在附属目录中对应的第二替换信息并删除。本公开实施例中,通过设定的第二替换策略,实现了对共享缓存的数据域中无可供存储的对应位置的场景的异常处理,在对共享缓存中的数据进行维护管理的同时,实现了对附属目录的同步,优化了附属目录的维护管理方法,进而优化了多级缓存系统的性能。The data storage method of the multi-level cache system proposed in the embodiment of the present disclosure is that when there is no corresponding position available for storing the first data block in the shared cache, the second replacement strategy corresponding to the shared cache is obtained, and the corresponding second replacement data block is determined from the data domain of the shared cache according to the second replacement strategy. In some embodiments, the second replacement position where the second replacement data block is stored in the shared cache is obtained, the second replacement data block at the second replacement position is deleted, and the first data block of the data to be stored is written. Accordingly, the second replacement information corresponding to the second replacement data block in the subsidiary directory is obtained and deleted. In the embodiment of the present disclosure, by setting the second replacement strategy, the exception handling of the scenario where there is no corresponding position available for storage in the data domain of the shared cache is realized, and while the data in the shared cache is maintained and managed, the synchronization of the subsidiary directory is realized, the maintenance and management method of the subsidiary directory is optimized, and the performance of the multi-level cache system is optimized.
上述实施例中,关于第一私有缓存向共享缓存发送失效处理请求以及共享缓存进行的相关的应答,可结合图11进一步理解,图11为本公开另一实施例的多级缓存系统的访问方法的流程示意图,如图11所示,该方法包括:S1101-S1103。In the above embodiment, regarding the invalidation processing request sent by the first private cache to the shared cache and the related response of the shared cache, it can be further understood in conjunction with Figure 11. Figure 11 is a flow chart of the access method of the multi-level cache system of another embodiment of the present disclosure. As shown in Figure 11, the method includes: S1101-S1103.
S1101,响应于多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求的访问状态为访问失效,第一私有缓存向多级缓存系统中的共享缓存发送失效处理请求。S1101: In response to an access status of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system.
本公开实施例中,第一私有缓存向第二私有缓存发送的访问请求的访问状态存在可能出现访问失效状态,其中,响应于目标附属信息指示,第一私有缓存对第二私有缓存发送的访问请求未在第一私有缓存中命中,确定访问请求的访问状态为访问失效。In the disclosed embodiment, the access status of the access request sent by the first private cache to the second private cache may be in an access failure state, wherein, in response to the target attached information indication, the access request sent by the first private cache to the second private cache does not hit in the first private cache, and the access status of the access request is determined to be an access failure.
在一些实施例中,可以根据目标附属信息中附属标识位上的标识信息,确定第一私有缓存向第二私有缓存发送的访问请求所属的请求类型,进而确定第一私有缓存对第二私有缓存发送的访问请求的访问状态。In some embodiments, the request type of the access request sent by the first private cache to the second private cache can be determined based on the identification information on the subsidiary identification bit in the target subsidiary information, and then the access status of the access request sent by the first private cache to the second private cache can be determined.
在一些实施例中,第二私有缓存向第一私有缓存发起的访问请求,可以包括读访问请求,也可以包括写访问请求。In some embodiments, the access request initiated by the second private cache to the first private cache may include a read access request or a write access request.
在一些实施例中,在第二私有缓存向第一私有缓存发起的读访问请求的场景下,若读访问请求对应的目标访问数据块在接收到读访问请求的第一私有缓存中不存在,或者其对应的目标访问数据块在接收到读访问请求的第一私有缓存中所处的状态为无效状态(INV),则可以确定该读访问请求在第一私有缓存中未命中。In some embodiments, in a scenario where a read access request is initiated by the second private cache to the first private cache, if the target access data block corresponding to the read access request does not exist in the first private cache that receives the read access request, or the corresponding target access data block is in an invalid state (INV) in the first private cache that receives the read access request, it can be determined that the read access request has not hit in the first private cache.
在一些实施例中,可以判断,第二私有缓存向第一私有缓存发起的读访问请求在第一私有缓存中读失效,其中,响应于访问请求为读访问请求且读访问请求未在第一私有缓存中命中,确定第一私有缓存对读访问请求读失效,第一私有缓存生成读访问请求对应的读失效处理请求,并将其作为第一读失效处理请求(ReqRead)发送至共享缓存。In some embodiments, it can be determined that a read access request initiated by the second private cache to the first private cache is read invalidated in the first private cache, wherein, in response to the access request being a read access request and the read access request not hitting in the first private cache, it is determined that the first private cache read invalidates the read access request, the first private cache generates a read invalidation processing request corresponding to the read access request, and sends it as a first read invalidation processing request (ReqRead) to the shared cache.
在一些实施例中,在第二私有缓存向第一私有缓存发起的写访问请求的场景下,响应于写访问请求对应的目标访问数据块在接收到写访问请求的第一私有缓存中不存在,或者其对应的目标访问数据块在接收到写访问请求的第一私有缓存中所处的状态为无效状态(INV),或者其对应的目标访问数据块在接收到写访问请求的第一私有缓存中所处的状态为共享状态(SHD),可以确定该写访问请求在第一私有缓存中未命中。 In some embodiments, in a scenario where a write access request is initiated by the second private cache to the first private cache, in response to the target access data block corresponding to the write access request not existing in the first private cache that receives the write access request, or the corresponding target access data block in the first private cache that receives the write access request is in an invalid state (INV), or the corresponding target access data block in the first private cache that receives the write access request is in a shared state (SHD), it can be determined that the write access request does not hit in the first private cache.
在一些实施例中,可以判断,第二私有缓存向第一私有缓存发起的写访问请求在第一私有缓存中写失效,其中,响应于访问请求为写访问请求且写访问请求未在第一私有缓存中命中,确定第一私有缓存对写访问请求写失效,第一私有缓存生成写访问请求对应的写失效处理请求,并作为第一写失效处理请求(ReqWrite)发送至共享缓存。In some embodiments, it can be determined that a write access request initiated by the second private cache to the first private cache is write-failed in the first private cache, wherein, in response to the access request being a write access request and the write access request not hitting in the first private cache, it is determined that the first private cache write-failed the write access request, the first private cache generates a write-failure processing request corresponding to the write access request, and sends it to the shared cache as a first write-failure processing request (ReqWrite).
在一些实施例中,在第二私有缓存向第一私有缓存发起的设定访问请求的场景下,若设定访问请求对应的目标访问数据块在接收到访问请求的第一私有缓存中被替换,则可以确定,该访问请求在第一私有缓存中未命中。In some embodiments, in a scenario where a set access request is initiated by the second private cache to the first private cache, if the target access data block corresponding to the set access request is replaced in the first private cache that receives the access request, it can be determined that the access request did not hit in the first private cache.
在一些实施例中,可以判断,第二私有缓存向第一私有缓存发起的设定访问请求在第一私有缓存中访问失效,其中,响应于第一私有缓存中的数据块被替换,第一私有缓存向共享缓存发送替换请求。In some embodiments, it can be determined that a set access request initiated by the second private cache to the first private cache fails in the first private cache, wherein, in response to a data block in the first private cache being replaced, the first private cache sends a replacement request to the shared cache.
在一些实施例中,待存储数据可以同时存储于共享缓存和第一私有缓存中,在该场景下,为了维护数据的一致性,响应于第一私有缓存中的数据已经被替换,需要对共享缓存中的数据进行相应的替换处理。In some embodiments, the data to be stored may be stored in a shared cache and a first private cache at the same time. In this scenario, in order to maintain data consistency, in response to the data in the first private cache being replaced, the data in the shared cache needs to be replaced accordingly.
因此,共享缓存接收到第一私有缓存发送的替换请求之后,响应于共享缓存中存储有替换请求对应的替换数据块,共享缓存对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核。Therefore, after the shared cache receives the replacement request sent by the first private cache, in response to the replacement data block corresponding to the replacement request stored in the shared cache, the shared cache replaces the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
相应地,还可以对共享缓存的下一级存储系统中存储的对应数据进行替换处理,在一些实施例中,响应于共享缓存中不存在替换请求对应的替换数据块,在共享缓存的下一级存储系统中,确定替换请求对应的替换数据块,下一级存储系统对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核。Correspondingly, replacement processing can also be performed on the corresponding data stored in the next-level storage system of the shared cache. In some embodiments, in response to the absence of a replacement data block corresponding to the replacement request in the shared cache, the replacement data block corresponding to the replacement request is determined in the next-level storage system of the shared cache. The next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
其中,该接收对应应答的第一私有缓存,为存在数据块需要被替换并向共享缓存发送替换请求的第一私有缓存。The first private cache that receives the corresponding response is the first private cache that has a data block that needs to be replaced and sends a replacement request to the shared cache.
S1102,在共享缓存的附属目录中,确定访问请求在多级缓存系统中的目标访问数据块对应的附属信息,作为目标附属信息。S1102, determining in the subsidiary directory of the shared cache the subsidiary information corresponding to the target access data block of the access request in the multi-level cache system as the target subsidiary information.
本公开实施例中,可以根据目标访问数据块的相关信息,实现其在共享缓存的附属目录中的目标附属信息的确定。In the disclosed embodiment, the target subsidiary information of the target accessed data block in the subsidiary directory of the shared cache can be determined according to the relevant information of the target accessed data block.
其中,响应于目标访问数据块存储于第一私有缓存,可以根据第一私有缓存所属的处理器核的相关信息,从附属目录中确定目标访问数据块对应的目标附属信息。In response to the target access data block being stored in the first private cache, target subsidiary information corresponding to the target access data block may be determined from the subsidiary directory according to relevant information of the processor core to which the first private cache belongs.
在一些实施例中,响应于第一私有缓存所属的处理器核为目标访问数据块的备份处理器核,根据附属目录中的备份位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息。In some embodiments, in response to the processor core to which the first private cache belongs being a backup processor core of the target access data block, target subsidiary information corresponding to the target access data block in the subsidiary directory is determined according to identification information on the backup bit in the subsidiary directory.
在一些实施例中,可以获取目标访问数据块存储的第一私有缓存所属的处理器核的标识信息,并将其与附属目录的备份位上的标识信息进行对比,根据对比结果,从附属目录中确定对应的附属信息,并将其作为目标访问数据块在附属目录中对应的目标附属信息。In some embodiments, identification information of the processor core to which the first private cache storing the target access data block belongs can be obtained and compared with identification information on the backup bit of the subsidiary directory. Based on the comparison result, corresponding subsidiary information is determined from the subsidiary directory and used as the target subsidiary information corresponding to the target access data block in the subsidiary directory.
在一些实施例中,响应于第一私有缓存所属的处理器核为目标访问数据块的拥有者处理器核,根据附属目录中对应的拥有者位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息。In some embodiments, in response to the processor core to which the first private cache belongs being the owner processor core of the target access data block, target subsidiary information corresponding to the target access data block in the subsidiary directory is determined based on identification information on a corresponding owner bit in the subsidiary directory.
在一些实施例中,可以获取目标访问数据块存储的第一私有缓存所属的处理器核的标识信息,并将其与附属目录中对应的拥有者位上的标识信息进行对比,根据对比结果,从附属目录中确定对应的附属信息,并将其作为目标访问数据块在附属目录中对应的目标附属信息。In some embodiments, identification information of the processor core to which the first private cache storing the target access data block belongs can be obtained and compared with the identification information on the corresponding owner bit in the subsidiary directory. Based on the comparison result, the corresponding subsidiary information is determined from the subsidiary directory and used as the target subsidiary information corresponding to the target access data block in the subsidiary directory.
S1103,共享缓存根据目标附属信息,对失效处理请求进行应答。S1103, the shared cache responds to the invalidation processing request according to the target attachment information.
在一些实施例中,共享缓存可以从目标附属信息获取目标访问数据块的相关状态信息,并根据相关状态信息对第一私有缓存发送的失效处理请求进行应答。In some embodiments, the shared cache may obtain relevant status information of the target access data block from the target attachment information, and respond to the invalidation processing request sent by the first private cache according to the relevant status information.
其中,共享缓存可以根据目标附属信息上相关附属标识位上的标识信息,确定目标访问数据块的目标状态,在一些实施例中,共享缓存可以获取目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定目标访问数据块的目标状态。Among them, the shared cache can determine the target state of the target access data block based on the identification information on the relevant subsidiary identification bit in the target subsidiary information. In some embodiments, the shared cache can obtain the identification information on the valid bit and the target owner bit of the data block to be stored in the target subsidiary information to determine the target state of the target access data block.
在一些实施例中,响应于待存储数据块有效位的标识为有效(VALID),且目标拥有者位的标识为待存储数据块存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且dirty(VALID-DIRTY)。 In some embodiments, in response to the valid bit of the data block to be stored being marked as valid (VALID) and the target owner bit being marked as the owner processor core state of the data block to be stored, the target state of the target access data block is determined to be valid and dirty (VALID-DIRTY).
其中,响应于目标拥有者位标识待存储数据块存在拥有者处理器核,可以判定,该场景下的待存储数据块为dirty状态下的数据块,则可以将目标访问数据块的目标状态标记为有效且diry。In which, in response to the target owner bit identifying that the data block to be stored has an owner processor core, it can be determined that the data block to be stored in this scenario is a data block in the dirty state, and the target state of the target access data block can be marked as valid and dirty.
在一些实施例中,共享缓存根据目标状态,对失效处理请求进行应答。In some embodiments, the shared cache responds to the invalidation request based on the target state.
在一些实施例中,响应于目标状态为有效且dirty(VALID-DIRTY),共享缓存生成第一读失效处理请求对应的写回请求,作为第一写回请求(ReqWtbk)发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存。In some embodiments, in response to the target state being valid and dirty (VALID-DIRTY), the shared cache generates a write-back request corresponding to the first read invalidation processing request, and sends it as a first write-back request (ReqWtbk) to the first private cache on the owner processor core corresponding to the target access data block.
在一些实施例中,在第一私有缓存接收到第一写回请求之后,响应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成对应的写回请求,并作为第三写回请求(ReqWtbk请求)发送至第二私有缓存。In some embodiments, after the first private cache receives the first write back request, in response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a corresponding write back request and sends it to the second private cache as a third write back request (ReqWtbk request).
在一些实施例中,第二私有缓存根据第三写回请求,将其自身存储的备份数据块的状态调整至共享(SHD)状态,并将调整后的备份数据块写回第一私有缓存。In some embodiments, the second private cache adjusts the state of the backup data block stored in itself to the shared (SHD) state according to the third write-back request, and writes the adjusted backup data block back to the first private cache.
需要说明的是,第二私有缓存在对备份数据块的状态调整结束并写回第一私有缓存之后,可以将调整状态的目标访问数据块所属的第一私有缓存所在的处理器核,标记为调整至共享状态的目标访问数据块的拥有者处理器核,并在共享缓存的附属目录中更新。It should be noted that after the second private cache completes the status adjustment of the backup data block and writes it back to the first private cache, it can mark the processor core where the first private cache, to which the target access data block with the adjusted status belongs, is located as the owner processor core of the target access data block adjusted to the shared state, and update it in the subsidiary directory of the shared cache.
在一些实施例中,在第二私有缓存将其调整后的备份数据块的相关状态数据写回至第一私有缓存之后,第一私有缓存将其自身存储的目标访问数据块的状态调整至共享状态,并生成对应的写回应答,作为第一写回应答(RespWtbk)发送共享缓存。In some embodiments, after the second private cache writes the relevant status data of its adjusted backup data block back to the first private cache, the first private cache adjusts the status of its own stored target access data block to a shared status, and generates a corresponding write-back response, which is sent to the shared cache as a first write-back response (RespWtbk).
在一些实施例中,响应于目标状态为有效且dirty(VALID-DIRTY),共享缓存生成第一写失效处理请求对应的写回请求,并作为第一无效并写回请求(ReqINVWtbk)发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存。In some embodiments, in response to the target state being valid and dirty (VALID-DIRTY), the shared cache generates a write-back request corresponding to the first write invalidation processing request, and sends it as a first invalidation and write-back request (ReqINVWtbk) to the first private cache on the owner processor core corresponding to the target access data block.
在一些实施例中,响应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成对应的无效并写回请求,并作为第二无效并写回请求(ReqINVWtbk)发送至第二私有缓存。In some embodiments, in response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a corresponding invalidate and write back request and sends it to the second private cache as a second invalidate and write back request (ReqINVWtbk).
第二私有缓存接收到第二无效并写回请求之后,根据第二无效并写回请求,第二私有缓存调整备份数据块至无效状态,并将调整后的备份数据块写回第一私有缓存。After receiving the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state according to the second invalidation and write-back request, and writes the adjusted backup data block back to the first private cache.
在一些实施例中,第二私有缓存将调整后的备份数据块的相关数据写回至第一私有缓存之后,第一私有缓存调整目标访问数据块至无效状态,并生成对应的无效并写回应答,作为第一无效并写回应答(RespINVWtbk)发送共享缓存。In some embodiments, after the second private cache writes the relevant data of the adjusted backup data block back to the first private cache, the first private cache adjusts the target access data block to an invalid state and generates a corresponding invalidation and write-back response, which is sent to the shared cache as a first invalidation and write-back response (RespINVWtbk).
在一些实施例中,响应于待存储数据块有效位的标识为有效(VALID),且目标拥有者位的标识为待存储数据块不存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且clean(VALID-CLEAN)。In some embodiments, in response to the valid bit of the data block to be stored being marked as valid (VALID) and the target owner bit being marked as the data block to be stored having no owner processor core state, the target state of the target access data block is determined to be valid and clean (VALID-CLEAN).
其中,响应于目标拥有者位标识待存储数据块不存在拥有者处理器核,可以判定,该场景下的待存储数据块为clean状态下的数据块,则可以将目标访问数据块的目标状态标记为有效且clean。In which, in response to the target owner bit indicating that the data block to be stored does not have an owner processor core, it can be determined that the data block to be stored in this scenario is a data block in a clean state, and the target state of the target access data block can be marked as valid and clean.
在一些实施例中,共享缓存根据目标状态,对失效处理请求进行应答。In some embodiments, the shared cache responds to the invalidation request based on the target state.
在一些实施例中,响应于目标状态为有效且clean(VALID-CLEAN),共享缓存生成第一读失效处理请求对应的写回请求,并作为第二写回请求(ReqWtbkFwd)发送至目标访问数据块对应的任一备份处理器核上的第一私有缓存。In some embodiments, in response to the target state being valid and clean (VALID-CLEAN), the shared cache generates a write-back request corresponding to the first read invalidation processing request, and sends it as a second write-back request (ReqWtbkFwd) to the first private cache on any backup processor core corresponding to the target access data block.
在一些实施例中,接收到第二写回请求的第一私有缓存,可以将目标访问数据块中的数据,发送至共享缓存。In some embodiments, the first private cache that receives the second write-back request may send the data in the target access data block to the shared cache.
在一些实施例中,响应于目标状态为有效且clean(VALID-CLEAN),共享缓存生成第一写失效处理请求对应的无效请求,并作为第一无效请求(ReqINV)发送至目标访问数据块对应的全部备份处理器核上的第一私有缓存。In some embodiments, in response to the target state being valid and clean (VALID-CLEAN), the shared cache generates an invalidation request corresponding to the first write invalidation processing request, and sends it as a first invalidation request (ReqINV) to the first private caches on all backup processor cores corresponding to the target access data block.
在一些实施例中,第一私有缓存接收到第一无效请求之后,对其对应的第二私有缓存中是否存储有目标访问数据块的备份数据块进行识别,其中,响应于识别到第二私有缓存中存储有目标访问数据块的备份数据块,第一私有缓存生成对应的无效请求,并作为第二无效请求(ReqINV)发送至第二私有缓存。In some embodiments, after receiving the first invalidation request, the first private cache identifies whether a backup data block of the target access data block is stored in its corresponding second private cache, wherein, in response to identifying that the backup data block of the target access data block is stored in the second private cache, the first private cache generates a corresponding invalidation request and sends it to the second private cache as a second invalidation request (ReqINV).
第二私有缓存接收到第二无效请求后,根据第二无效请求,第二私有缓存调整备份数据块至无效状 态,并将调整后的备份数据块写回第一私有缓存。After the second private cache receives the second invalidation request, the second private cache adjusts the backup data block to an invalid state according to the second invalidation request. state, and writes the adjusted backup data block back to the first private cache.
在一些实施例中,第一私有缓存调整目标访问数据块至无效状态,并生成对应的无效应答,作为第一无效应答(RespINV)发送至共享缓存。In some embodiments, the first private cache adjusts the target access data block to an invalid state and generates a corresponding invalidation response, which is sent to the shared cache as a first invalidation response (RespINV).
在另一些实施例中,共享缓存还可以根据目标访问数据块对应的目标附属信息指示的相关信息,对接收到的第一私有缓存发送的失效处理请求进行应答。In some other embodiments, the shared cache may also respond to the invalidation processing request received from the first private cache according to the relevant information indicated by the target attachment information corresponding to the target access data block.
在一些实施例中,响应于共享缓存接收到第一私有缓存发送的第一读失效处理请求,可以根据目标附属信息指示的相关信息,对第一读失效处理请求进行应答。In some embodiments, in response to the shared cache receiving the first read invalidation processing request sent by the first private cache, the first read invalidation processing request may be responded to according to the relevant information indicated by the target subsidiary information.
在一些实施例中,响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的读失效应答(RespRead),并发送至发出第一读失效处理请求的第一私有缓存。In some embodiments, in response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response (RespRead) and sends it to the first private cache that issued the first read invalidation processing request.
在一些实施例中,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为dirty状态,共享缓存接收到第一写回应答后,生成对应的读失效应答(RespRead),并发送至发出第一读失效处理请求的第一私有缓存。In some embodiments, in response to the target attachment information indicating that the target access data block in the first private cache is in a dirty state, after the shared cache receives the first write-back response, it generates a corresponding read invalidation response (RespRead) and sends it to the first private cache that issued the first read invalidation processing request.
在一些实施例中,响应于共享缓存接收到第一私有缓存发送的第一写失效处理请求,可以根据目标附属信息指示的相关信息,对第一写失效处理请求进行应答。In some embodiments, in response to the shared cache receiving the first write-invalidation processing request sent by the first private cache, the first write-invalidation processing request may be responded to according to the relevant information indicated by the target subsidiary information.
在一些实施例中,响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存。In some embodiments, in response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write invalidation response and sends it to the first private cache that issued the first write invalidation processing request.
在一些实施例中,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存。In some embodiments, in response to the target attachment information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write invalidation response and sends it to the first private cache that issued the first write invalidation processing request.
在一些实施例中,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效并写回应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存。In some embodiments, in response to the target attachment information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation and write-back response, it generates a corresponding write-failure response and sends it to the first private cache that issued the first write-failure processing request.
本公开实施例提出的多级缓存系统的访问方法,响应于多级缓存系统中的第二私有缓存对第一私有缓存发起的访问请求在第一私有缓存中访问失效,第一私有缓存可以向共享缓存发起失效处理请求,共享缓存根据访问请求对应的目标访问数据块,确定其在附属目录中对应的目标附属信息,根据目标附属信息中的标识信息,共享缓存生成失效处理请求的相关应答,并返回发起失效处理请求的第一私有缓存。本公开实施例中,响应于第二私有缓存向第一私有缓存的访问请求访问失效,通过第一私有缓存向共享缓存发送的失效处理请求,使得共享缓存可以通过其标签域中维护的附属目录,实现对失效处理请求的应答,进而使得第一私有缓存可以实现对第二私有缓存的相关应答,实现了异常访问场景下的异常处理,提高了多级缓存系统的稳定性,通过对附属目录的访问,获取到目标访问数据块在多个处理器核上的写入后信息,优化了多级缓存系统的访问方法,提高了访问效率,优化了访问结果。The access method of the multi-level cache system proposed in the embodiment of the present disclosure is that in response to the access request initiated by the second private cache in the multi-level cache system to the first private cache, the access is invalid in the first private cache, and the first private cache can initiate an invalidation processing request to the shared cache. The shared cache determines the corresponding target subsidiary information in the subsidiary directory according to the target access data block corresponding to the access request, and generates a relevant response to the invalidation processing request according to the identification information in the target subsidiary information, and returns it to the first private cache that initiated the invalidation processing request. In the embodiment of the present disclosure, in response to the access request of the second private cache to the first private cache, the access is invalid, and the invalidation processing request sent by the first private cache to the shared cache enables the shared cache to respond to the invalidation processing request through the subsidiary directory maintained in its tag domain, thereby enabling the first private cache to respond to the second private cache, realizing exception processing in abnormal access scenarios, improving the stability of the multi-level cache system, and obtaining the post-write information of the target access data block on multiple processor cores through access to the subsidiary directory, optimizing the access method of the multi-level cache system, improving access efficiency, and optimizing access results.
上述实施例中,关于第一私有缓存的信息更新,可结合图12进一步理解,图12为本公开另一实施例的多级缓存系统的访问方法的流程示意图,如图12所示,该方法包括:S1201-S1202。In the above embodiment, the information update of the first private cache can be further understood in conjunction with Figure 12. Figure 12 is a flow chart of an access method of a multi-level cache system according to another embodiment of the present disclosure. As shown in Figure 12, the method includes: S1201-S1202.
S1201,响应于目标附属信息指示,目标访问数据块在多级缓存系统的第一私有缓存中不存在,获取共享缓存的附属目录的替换策略,并根据替换策略对共享缓存的附属目录进行更新。S1201, in response to the target attachment information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtain a replacement policy for an attachment directory of the shared cache, and update the attachment directory of the shared cache according to the replacement policy.
在一些实施例中,共享缓存的标签域中的附属目录中可能存在附属信息的标识信息,与多级缓存系统中的实际写入后信息不匹配的情况。In some embodiments, there may be identification information of the subsidiary information in the subsidiary directory in the tag field of the shared cache, which does not match the actual post-write information in the multi-level cache system.
在一些实施例中,访问请求需要访问的目标访问数据块在附属目录中对应的目标附属信息指示,目标访问数据块在多级缓存系统的第一私有缓存中不存在,可以理解为,当前共享缓存内的附属目录中的信息与多级缓存系统中数据的写入后信息之间存在差异,因此,需要对附属目录中的信息进行更新。In some embodiments, the target access data block that the access request needs to access is indicated by the target subsidiary information corresponding to the subsidiary directory, and the target access data block does not exist in the first private cache of the multi-level cache system. It can be understood that there is a difference between the information in the subsidiary directory in the current shared cache and the post-write information of the data in the multi-level cache system. Therefore, the information in the subsidiary directory needs to be updated.
其中,可以获取共享缓存的附属目录对应的替换策略,并根据对应替换策略对附属目录进行相关信息的更新。The replacement policy corresponding to the subsidiary directory of the shared cache may be obtained, and the relevant information of the subsidiary directory may be updated according to the corresponding replacement policy.
S1202,根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新。S1202: Update the first private cache according to the updated subsidiary information in the updated subsidiary directory.
在一些实施例中,响应于更新附属信息指示,第一私有缓存内的对应的标签对应数据块为有效且 clean状态,该场景下,可以理解为,该数据块为多级缓存系统中的clean数据块,因此,若该数据块存在对应的拥有者处理器核,则共享缓存生成对应的无效请求,并将其作为第三无效请求,发送第三无效请求至该数据块对应的拥有者处理器核上的第一私有缓存。In some embodiments, in response to the update of the auxiliary information indication, the corresponding tag corresponding data block in the first private cache is valid and In the clean state, in this scenario, it can be understood that the data block is a clean data block in the multi-level cache system. Therefore, if the data block has a corresponding owner processor core, the shared cache generates a corresponding invalidation request and uses it as the third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block.
在一些实施例中,将拥有者处理器核上的第一私有缓存内存储的对应数据块的状态调整至无效,以保证该数据块在多级缓存系统中处于clean状态。In some embodiments, the state of the corresponding data block stored in the first private cache on the owner processor core is adjusted to invalid to ensure that the data block is in a clean state in the multi-level cache system.
在另一些实施例中,响应于更新附属信息指示,第一私有缓存内的对应的标签对应数据块为有效且dirty状态,该场景下,可以理解为,该数据块为多级缓存系统中的dirty数据块。In other embodiments, in response to an indication of updating the ancillary information, a data block corresponding to a corresponding tag in the first private cache is valid and dirty. In this scenario, it can be understood that the data block is a dirty data block in a multi-level cache system.
在一些实施例中,需要对该数据块对应的非拥有者处理器核上的第一私有缓存中存储的备份数据进行无效。其中,共享缓存可以生成对应的无效请求,并将其作为第四无效请求发送至该数据块对应的非拥有者处理器核上的第一私有缓存。In some embodiments, the backup data stored in the first private cache on the non-owner processor core corresponding to the data block needs to be invalidated, wherein the shared cache can generate a corresponding invalidation request and send it as a fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block.
在一些实施例中,将非拥有者处理器核上的第一私有缓存内存储的对应数据块的状态调整至无效,以保证该数据块在多级缓存系统中处于dirty状态。In some embodiments, the state of a corresponding data block stored in a first private cache on a non-owner processor core is adjusted to invalid, so as to ensure that the data block is in a dirty state in the multi-level cache system.
在另一些实施例中,响应于更新附属信息指示,第一私有缓存内的对应的标签对应数据块为有效且dirty状态,该场景下,该数据块为多级缓存系统中的存在拥有者处理器核的数据块。In other embodiments, in response to an indication of updating the auxiliary information, a data block corresponding to a corresponding tag in the first private cache is in a valid and dirty state. In this scenario, the data block is a data block having an owner processor core in a multi-level cache system.
在一些实施例中,共享缓存还可以生成对应的无效并写回请求,并作为第三无效并写回请求发送至的标签对应数据块对应的拥有者处理器核上的第一私有缓存,或者,发送到独占标签对应数据块的备份处理器核上的第一私有缓存。In some embodiments, the shared cache can also generate a corresponding invalidate and write back request, and send it as a third invalidate and write back request to the first private cache on the owner processor core corresponding to the data block corresponding to the tag, or to the first private cache on the backup processor core that exclusively owns the data block corresponding to the tag.
需要说明的是,响应于共享缓存中存储有标签对应数据块对应的备份数据块,且更新附属信息的标识信息与标签对应数据块在第一私有缓存中的写入后信息不匹配,共享缓存需要对其自身存储的相关数据进行对应的替换处理,其中,共享缓存可以对自身的数据存储阵列中的数据域中的存储的备份数据块进行替换处理。It should be noted that, in response to the shared cache storing a backup data block corresponding to the data block corresponding to the tag, and the identification information of the updated auxiliary information does not match the post-write information of the data block corresponding to the tag in the first private cache, the shared cache needs to perform corresponding replacement processing on the related data stored in itself, wherein the shared cache can replace the backup data blocks stored in the data domain in its own data storage array.
本公开实施例提出的多级缓存系统的访问方法,响应于目标访问数据块对应的目标附属信息的标识信息中指示,第一私有缓存中不存在对应的目标访问数据块的相关信息,需要对共享缓存的附属目录进行更新,获取更新后的附属目录,并根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新。本公开实施例中,通过对共享缓存的附属目录的更新维护,提高了多级缓存系统的稳定性,优化了多级缓存系统的访问方法,提高了访问效率,优化了访问结果。The access method of the multi-level cache system proposed in the embodiment of the present disclosure responds to the indication in the identification information of the target subsidiary information corresponding to the target access data block that the relevant information of the corresponding target access data block does not exist in the first private cache, and it is necessary to update the subsidiary directory of the shared cache, obtain the updated subsidiary directory, and update the information of the first private cache according to the updated subsidiary information in the updated subsidiary directory. In the embodiment of the present disclosure, by updating and maintaining the subsidiary directory of the shared cache, the stability of the multi-level cache system is improved, the access method of the multi-level cache system is optimized, the access efficiency is improved, and the access results are optimized.
与上述几种实施例提出的多级缓存系统的访问方法相对应,本公开的一个实施例还提出了一种多级缓存系统的访问装置,由于本公开实施例提出的多级缓存系统的访问装置与上述几种实施例提出的多级缓存系统的访问方法相对应,因此上述多级缓存系统的访问方法的实施方式也适用于本公开实施例提出的多级缓存系统的访问装置,在下述实施例中不再详细描述。Corresponding to the access methods of the multi-level cache system proposed in the above-mentioned embodiments, an embodiment of the present disclosure also proposes an access device for the multi-level cache system. Since the access device for the multi-level cache system proposed in the embodiment of the present disclosure corresponds to the access methods for the multi-level cache system proposed in the above-mentioned embodiments, the implementation methods of the access methods for the multi-level cache system are also applicable to the access device for the multi-level cache system proposed in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
图13为本公开一实施例的多级缓存系统的访问装置的结构示意图,如图13所示,多级缓存系统的访问装置1300,包括获取模块131、访问模块132、应答模块133,其中:FIG. 13 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG. 13 , the access device 1300 of the multi-level cache system includes an acquisition module 131, an access module 132, and a response module 133, wherein:
获取模块131,用于获取多级缓存系统的访问请求;An acquisition module 131 is used to acquire an access request of a multi-level cache system;
访问模块132,用于根据访问请求,从多级缓存系统的附属目录中,获取访问请求在多级缓存系统中的目标访问数据块以及目标访问数据块的目标附属信息,其中,附属目录存储于多级缓存系统中的共享缓存上;The access module 132 is used to obtain, according to the access request, a target access data block of the access request in the multi-level cache system and target attachment information of the target access data block from an attachment directory of the multi-level cache system, wherein the attachment directory is stored in a shared cache in the multi-level cache system;
应答模块133,用于根据目标附属信息,对访问请求进行应答。The response module 133 is used to respond to the access request according to the target attached information.
本公开实施例中,应答模块133,还用于:根据目标附属信息,确定访问请求的访问状态;共享缓存对处于访问状态下的访问请求进行应答。In the disclosed embodiment, the response module 133 is further used to: determine the access status of the access request according to the target attached information; and the shared cache responds to the access request in the access status.
本公开实施例中,附属目录存储于多级缓存系统中的共享缓存上的标签域中。In the disclosed embodiment, the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
本公开实施例中,应答模块133,还用于:获取多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求,其中,第一私有缓存和第二私有缓存为多核处理器的私有缓存,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存;在共享缓存的附属目录中,确定访问请求在多级缓存系统中的目标访问数据块对应的附属信息,作为目标附属信息;获取目标附属信息的附属标识位上的附属信息,并根据附属标识位上的附属信息,获取访问请求的访问状态。In the disclosed embodiment, the response module 133 is further used to: obtain an access request sent by the first private cache to the second private cache in the multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache; determine, in the subsidiary directory of the shared cache, subsidiary information corresponding to a target access data block of the access request in the multi-level cache system as target subsidiary information; obtain subsidiary information on the subsidiary identification bit of the target subsidiary information, and obtain the access status of the access request based on the subsidiary information on the subsidiary identification bit.
本公开实施例中,应答模块133,还用于:响应于目标附属信息指示,第一私有缓存对第二私有缓 存发送的访问请求未在第一私有缓存中命中,确定访问请求的访问状态为访问失效。In the embodiment of the present disclosure, the response module 133 is further configured to: in response to the target auxiliary information indication, the first private cache responds to the second private cache The access request sent by the storage does not hit in the first private cache, and the access status of the access request is determined to be access failure.
本公开实施例中,应答模块133,还用于:响应于多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求的访问状态为访问失效,第一私有缓存向多级缓存系统中的共享缓存发送失效处理请求;共享缓存根据目标附属信息,对失效处理请求进行应答。In the disclosed embodiment, the response module 133 is also used for: in response to the access status of an access request sent by a first private cache to a second private cache in a multi-level cache system being access invalid, the first private cache sends an invalidation processing request to a shared cache in the multi-level cache system; and the shared cache responds to the invalidation processing request based on the target attached information.
本公开实施例中,应答模块133,还用于:响应于访问请求为读访问请求且读访问请求未在第一私有缓存中命中,确定第一私有缓存对读访问请求读失效,第一私有缓存生成读访问请求对应的第一读失效处理请求,并发送至共享缓存;响应于访问请求为写访问请求且写访问请求未在第一私有缓存中命中,确定第一私有缓存对写访问请求写失效,第一私有缓存生成写访问请求对应的第一写失效处理请求,并发送至共享缓存。In the disclosed embodiment, the response module 133 is further used for: in response to an access request being a read access request and the read access request not hitting the first private cache, determining that the first private cache has read-failed the read access request, the first private cache generating a first read-failure processing request corresponding to the read access request, and sending it to the shared cache; in response to an access request being a write access request and the write access request not hitting the first private cache, determining that the first private cache has write-failed the write access request, the first private cache generating a first write-failure processing request corresponding to the write access request, and sending it to the shared cache.
本公开实施例中,应答模块133,还用于:响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的读失效应答,并发送至发出第一读失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为dirty状态,共享缓存接收到第一写回应答后,生成对应的读失效应答,并发送至发出第一读失效处理请求的第一私有缓存。In the disclosed embodiment, the response module 133 is further used for: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response, and sends it to the first private cache that issued the first read invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is in a dirty state, after receiving the first write back response, the shared cache generates a corresponding read invalidation response, and sends it to the first private cache that issued the first read invalidation processing request.
本公开实施例中,应答模块133,还用于:响应于目标附属信息指示,第一私有缓存中不存在目标访问数据块,获取目标访问数据块对应的数据后,共享缓存生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存;或者,响应于目标附属信息指示,第一私有缓存中的目标访问数据块为有效且clean状态,共享缓存接收到第一无效并写回应答后,生成对应的写失效应答,并发送至发出第一写失效处理请求的第一私有缓存。In the disclosed embodiment, the response module 133 is further used for: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache, after obtaining the data corresponding to the target access data block, the shared cache generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request; or, in response to the target subsidiary information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation response, it generates a corresponding write-invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request.
本公开实施例中,应答模块133,还用于:响应于第一私有缓存中的数据块被替换,第一私有缓存向共享缓存发送替换请求。In the embodiment of the present disclosure, the response module 133 is further configured to: in response to a data block in the first private cache being replaced, the first private cache sends a replacement request to the shared cache.
本公开实施例中,应答模块133,还用于:响应于共享缓存中存储有替换请求对应的替换数据块,共享缓存对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核;响应于共享缓存中不存在替换请求对应的替换数据块,在共享缓存的下一级存储系统中,确定替换请求对应的替换数据块,下一级存储系统对替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核。In the disclosed embodiment, the response module 133 is also used for: in response to the shared cache storing a replacement data block corresponding to the replacement request, the shared cache performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs; in response to the shared cache not having the replacement data block corresponding to the replacement request, in the next-level storage system of the shared cache, determining the replacement data block corresponding to the replacement request, the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
本公开实施例中,访问模块132,还用于:响应于第一私有缓存所属的处理器核为目标访问数据块的备份处理器核,根据附属目录中的备份位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息;响应于第一私有缓存所属的处理器核为目标访问数据块的拥有者处理器核,根据附属目录中对应的拥有者位上的标识信息,确定目标访问数据块在附属目录中对应的目标附属信息。In the disclosed embodiment, the access module 132 is further used to: in response to the processor core to which the first private cache belongs being the backup processor core of the target access data block, determine the target subsidiary information corresponding to the target access data block in the subsidiary directory according to the identification information on the backup bit in the subsidiary directory; in response to the processor core to which the first private cache belongs being the owner processor core of the target access data block, determine the target subsidiary information corresponding to the target access data block in the subsidiary directory according to the identification information on the corresponding owner bit in the subsidiary directory.
本公开实施例中,应答模块133,还用于:共享缓存获取目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定目标访问数据块的目标状态;共享缓存根据目标状态,对失效处理请求进行应答。In the disclosed embodiment, the response module 133 is also used for: the shared cache obtains identification information on the valid bit of the data block to be stored and the target owner bit in the target subsidiary information, and determines the target state of the target access data block; the shared cache responds to the invalidation processing request according to the target state.
本公开实施例中,应答模块133,还用于:响应于待存储数据块有效位的标识为有效,且目标拥有者位的标识为待存储数据块存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且dirty;响应于待存储数据块有效位的标识为有效,且目标拥有者位的标识为待存储数据块不存在拥有者处理器核状态,确定目标访问数据块的目标状态为有效且clean。In the disclosed embodiment, the response module 133 is further used to: in response to the valid bit of the data block to be stored being marked as valid, and the target owner bit being marked as the existence of an owner processor core state of the data block to be stored, determine that the target state of the target access data block is valid and dirty; in response to the valid bit of the data block to be stored being marked as valid, and the target owner bit being marked as the existence of an owner processor core state of the data block to be stored, determine that the target state of the target access data block is valid and clean.
本公开实施例中,应答模块133,还用于:响应于目标状态为有效且dirty,共享缓存生成第一读失效处理请求对应的第一写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存;响应于目标状态为有效且clean,共享缓存生成第一读失效处理请求对应的第二写回请求,并发送至目标访问数据块对应的任一备份处理器核上的第一私有缓存。In the disclosed embodiment, the response module 133 is also used for: in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request, and sends it to the first private cache on any backup processor core corresponding to the target access data block.
本公开实施例中,应答模块133,还用于:响应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成第三写回请求并发送至第二私有缓存;根据第三写回请求,第二私有缓存调整备份数据块至共享状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目 标访问数据块至共享状态。In the embodiment of the present disclosure, the response module 133 is further used to: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a third write-back request and sends it to the second private cache; according to the third write-back request, the second private cache adjusts the backup data block to a shared state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to the shared state, and writes the adjusted backup data block back to the first private cache; The tag accesses the data block to a shared state.
本公开实施例中,应答模块133,还用于:将调整状态的目标访问数据块所属的第一私有缓存所在的处理器核,标记为调整至共享状态的目标访问数据块的拥有者处理器核,并在共享缓存的附属目录中更新。In the disclosed embodiment, the response module 133 is further used to: mark the processor core where the first private cache to which the target access data block whose state is adjusted belongs is located as the owner processor core of the target access data block adjusted to the shared state, and update it in the subsidiary directory of the shared cache.
本公开实施例中,应答模块133,还用于:第一私有缓存将目标访问数据块中的数据,发送至共享缓存。In the disclosed embodiment, the response module 133 is further configured to: the first private cache sends the data in the target access data block to the shared cache.
本公开实施例中,应答模块133,还用于:响应于目标状态为有效且dirty,共享缓存生成第一写失效处理请求对应的第一无效并写回请求,并发送至目标访问数据块对应的拥有者处理器核上的第一私有缓存;响应于目标状态为有效且clean,共享缓存生成第一写失效处理请求对应的第一无效请求,并发送至目标访问数据块对应的全部备份处理器核上的第一私有缓存。In the disclosed embodiment, the response module 133 is also used for: in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block; in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private cache on all backup processor cores corresponding to the target access data block.
本公开实施例中,应答模块133,还用于:响应于识别到第二私有缓存中存储有目标访问数据块对应的备份数据块,第一私有缓存生成第二无效并写回请求并发送至第二私有缓存;根据第二无效并写回请求,第二私有缓存调整备份数据块至无效状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目标访问数据块至无效状态,并生成第一无效并写回应答发送共享缓存。In the disclosed embodiment, the response module 133 is also used for: in response to identifying that the backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a second invalidation and write-back request and sends it to the second private cache; according to the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation and write-back response and sends it to the shared cache.
本公开实施例中,应答模块133,还用于:响应于识别到第二私有缓存中存储有目标访问数据块的备份数据块,第一私有缓存生成第二无效请求并发送至第二私有缓存;根据第二无效请求,第二私有缓存调整备份数据块至无效状态,并将调整后的备份数据块写回第一私有缓存;第一私有缓存调整目标访问数据块至无效状态,并生成第一无效应答发送至共享缓存。In the disclosed embodiment, the response module 133 is further used for: in response to identifying that a backup data block of the target access data block is stored in the second private cache, the first private cache generates a second invalidation request and sends it to the second private cache; according to the second invalidation request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache; the first private cache adjusts the target access data block to an invalid state, and generates a first invalidation response and sends it to the shared cache.
本公开实施例中,应答模块133,还用于:拥有者处理器核上的第一私有缓存,将目标访问数据块中的数据发送至共享缓存。In the disclosed embodiment, the response module 133 is further configured to: the first private cache on the owner processor core sends the data in the target access data block to the shared cache.
本公开实施例中,应答模块133,还用于:响应于目标附属信息指示,目标访问数据块在多级缓存系统的第一私有缓存中不存在,获取共享缓存的附属目录的替换策略,并根据替换策略对共享缓存的附属目录进行更新;根据更新后附属目录中的更新附属信息,对第一私有缓存进行信息更新。In the disclosed embodiment, the response module 133 is also used to: in response to the target subsidiary information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtain the replacement strategy of the subsidiary directory of the shared cache, and update the subsidiary directory of the shared cache according to the replacement strategy; and update the first private cache according to the updated subsidiary information in the updated subsidiary directory.
本公开实施例中,应答模块133,还用于:响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且clean状态,共享缓存生成第三无效请求,并发送第三无效请求至附属信息对应数据块对应的拥有者处理器核上的第一私有缓存;响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且dirty状态,共享缓存生成第四无效请求,并发送第四无效请求至附属信息对应数据块对应的非拥有者处理器核上的第一私有缓存。In the disclosed embodiment, the response module 133 is further used for: in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a clean state, the shared cache generates a third invalidation request, and sends the third invalidation request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information; in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and in a dirty state, the shared cache generates a fourth invalidation request, and sends the fourth invalidation request to the first private cache on the non-owner processor core corresponding to the data block corresponding to the subsidiary information.
本公开实施例中,应答模块133,还用于:响应于更新附属信息指示,第一私有缓存内的附属信息对应数据块为有效且dirty状态,共享缓存生成第三无效并写回请求,并发送第三无效并写回请求至附属信息对应数据块对应的拥有者处理器核上的第一私有缓存,或者,发送至独占附属信息对应数据块的备份处理器核上的第一私有缓存。In the disclosed embodiment, the response module 133 is also used for: in response to an indication of updating the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a third invalidation and write-back request, and sends the third invalidation and write-back request to the first private cache on the owner processor core corresponding to the data block corresponding to the subsidiary information, or, sends it to the first private cache on the backup processor core that exclusively owns the data block corresponding to the subsidiary information.
本公开实施例中,应答模块133,还用于:响应于共享缓存中存储有附属信息对应数据块对应的备份数据块,且更新附属信息的标识信息与附属信息对应数据块在第一私有缓存中的写入后信息不匹配,共享缓存对自身的数据存储阵列中的数据域中的存储的备份数据块进行替换处理。In the disclosed embodiment, the response module 133 is also used for: in response to the shared cache storing a backup data block corresponding to the data block corresponding to the subsidiary information, and the identification information of the updated subsidiary information does not match the post-write information of the data block corresponding to the subsidiary information in the first private cache, the shared cache replaces the backup data block stored in the data domain in its own data storage array.
本公开实施例提出的多级缓存系统的访问装置,获取多级缓存系统的访问请求,并根据访问请求对多级缓存系统中的共享缓存上存储的附属目录进行读取,以获取访问请求在多级缓存系统中对应的目标访问数据块以及目标访问数据块对应的目标附属信息。在一些实施例中,根据目标附属信息,对访问请求进行应答。本公开实施例中,多级缓存系统的共享缓存上存在附属目录,实现了对多级缓存系统中存储的数据块的有效管理,通过读取附属目录获取访问请求对应的目标访问数据块对应的目标附属信息,并根据目标附属信息对访问请求进行应答,简化了访问请求对应的应答信息的获取方法,从而降低了对访问请求进行应答对多级缓存系统造成的负荷程度,提高了多级缓存系统性能的稳定性,进而降低了访问请求的访问延迟,优化了多级缓存系统的访问方法,提高了多级缓存系统的访问效率,节约了多级缓存系统的资源。The access device of the multi-level cache system proposed in the embodiment of the present disclosure obtains the access request of the multi-level cache system, and reads the subsidiary directory stored on the shared cache in the multi-level cache system according to the access request, so as to obtain the target access data block corresponding to the access request in the multi-level cache system and the target subsidiary information corresponding to the target access data block. In some embodiments, the access request is responded to according to the target subsidiary information. In the embodiment of the present disclosure, there is a subsidiary directory on the shared cache of the multi-level cache system, which realizes the effective management of the data blocks stored in the multi-level cache system, obtains the target subsidiary information corresponding to the target access data block corresponding to the access request by reading the subsidiary directory, and responds to the access request according to the target subsidiary information, which simplifies the method for obtaining the response information corresponding to the access request, thereby reducing the load degree caused by responding to the access request on the multi-level cache system, improving the stability of the performance of the multi-level cache system, thereby reducing the access delay of the access request, optimizing the access method of the multi-level cache system, improving the access efficiency of the multi-level cache system, and saving the resources of the multi-level cache system.
与上述几种实施例提出的多级缓存系统的数据存储方法相对应,本公开的一个实施例还提出了一种多级缓存系统的数据存储装置,由于本公开实施例提出的多级缓存系统的数据存储装置与上述几种实施 例提出的多级缓存系统的数据存储方法相对应,因此上述多级缓存系统的数据存储方法的实施方式也适用于本公开实施例提出的多级缓存系统的数据存储装置,在下述实施例中不再详细描述。Corresponding to the data storage methods of the multi-level cache system proposed in the above-mentioned embodiments, an embodiment of the present disclosure further proposes a data storage device of the multi-level cache system. The data storage method for the multi-level cache system proposed in the example corresponds to the data storage method for the multi-level cache system, so the implementation method of the above-mentioned data storage method for the multi-level cache system is also applicable to the data storage device for the multi-level cache system proposed in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
图14为本公开一实施例的多级缓存系统的访问装置的结构示意图,如图14所示,多级缓存系统的数据存储装置1400,包括第一写入模块141和第二写入模块142,其中:FIG14 is a schematic diagram of the structure of an access device of a multi-level cache system according to an embodiment of the present disclosure. As shown in FIG14 , a data storage device 1400 of a multi-level cache system includes a first writing module 141 and a second writing module 142, wherein:
第一写入模块141,用于将待存储数据写入多级缓存系统,并获取待存储数据在多级缓存系统中的写入后信息;A first writing module 141 is used to write the data to be stored into the multi-level cache system and obtain the post-writing information of the data to be stored in the multi-level cache system;
第二写入模块142,用于生成待存储数据的写入后信息对应的附属信息,并将附属信息写入多级缓存系统的附属目录中,其中,附属目录存储于多级缓存系统中的共享缓存上。The second writing module 142 is used to generate subsidiary information corresponding to the written information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored in a shared cache in the multi-level cache system.
本公开实施例中,多级缓存系统中包括共享缓存、第一私有缓存和第二私有缓存,共享缓存为多级缓存系统所属的多核处理器中的共享缓存,第一私有缓存和第二私有缓存为多核处理器的私有缓存;其中,多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。In an embodiment of the present disclosure, a multi-level cache system includes a shared cache, a first private cache, and a second private cache. The shared cache is a shared cache in a multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are private caches of the multi-core processor; wherein each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
本公开实施例中,附属目录存储于多级缓存系统中的共享缓存上的标签域中。In the disclosed embodiment, the subsidiary directory is stored in a tag field on a shared cache in a multi-level cache system.
本公开实施例中,多级缓存系统中包括第一私有缓存,其中,第一私有缓存为多级缓存系统所属的多核处理器中部分处理器核的共享缓存。In the embodiment of the present disclosure, the multi-level cache system includes a first private cache, wherein the first private cache is a shared cache of some processor cores in a multi-core processor to which the multi-level cache system belongs.
本公开实施例中,第二写入模块142,还用于:获取共享缓存的初始附属信息中的附属标识位;从写入后信息中,获取待存储数据在附属标识位的标识信息,并将标识信息标记至对应的附属标识位,以生成待存储数据的附属信息。In the embodiment of the present disclosure, the second writing module 142 is also used to: obtain the subsidiary identification bit in the initial subsidiary information of the shared cache; obtain the identification information of the data to be stored in the subsidiary identification bit from the written information, and mark the identification information to the corresponding subsidiary identification bit to generate the subsidiary information of the data to be stored.
本公开实施例中,第二写入模块142,还用于:写入地址位,用于指示存储待存储数据的数据块的写入地址;地址有效位,用于指示存储数据块的写入地址是否有效;第一有效位,用于指示存储于共享缓存中的第一数据块是否有效,其中,第一数据块为共享缓存中存储待存储数据的数据块;第一状态位,用于指示待存储数据在共享缓存中是否被写过数据;数据域行号位,用于指示第一数据块在共享缓存的数据存储阵列的数据域中的存储行号。In the disclosed embodiment, the second write module 142 is further used for: writing an address bit, used to indicate the write address of a data block storing data to be stored; an address valid bit, used to indicate whether the write address of the stored data block is valid; a first valid bit, used to indicate whether a first data block stored in a shared cache is valid, wherein the first data block is a data block storing data to be stored in the shared cache; a first status bit, used to indicate whether the data to be stored has been written in the shared cache; and a data domain row number bit, used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
本公开实施例中,第二写入模块142,还用于:第二有效位,用于指示存储于第一私有缓存中的第二数据块是否有效,其中,第二数据块为第一私有缓存中存储待存储数据的数据块;第二状态位,用于指示第二数据块在多核处理器的全部第一私有缓存中的第二数据状态,其中,第二数据状态为独占状态(EXC)或共享状态(SHD);备份位,用于指示在多核处理器中,存储有第二数据块的备份数据块的备份处理器核;第一拥有者位,用于指示多核处理器中是否存在第二数据块的拥有者处理器核;第二拥有者位,用于指示多核处理器中,第二数据块的拥有者处理器核。In the disclosed embodiment, the second write module 142 is also used for: a second valid bit, used to indicate whether the second data block stored in the first private cache is valid, wherein the second data block is a data block storing data to be stored in the first private cache; a second status bit, used to indicate the second data status of the second data block in all first private caches of the multi-core processor, wherein the second data status is an exclusive status (EXC) or a shared status (SHD); a backup bit, used to indicate a backup processor core in the multi-core processor that stores a backup data block of the second data block; a first owner bit, used to indicate whether there is an owner processor core of the second data block in the multi-core processor; and a second owner bit, used to indicate the owner processor core of the second data block in the multi-core processor.
本公开实施例中,第二写入模块142,还用于:确定多级缓存系统中,待存储数据写入的目标缓存;根据目标缓存,获取共享缓存的初始附属信息对应的目标标识信息;响应于根据目标标识信息生成待存储数据存储至目标缓存,写入附属目录中的目标附属信息。In the disclosed embodiment, the second writing module 142 is also used to: determine a target cache in a multi-level cache system, into which the data to be stored is written; obtain target identification information corresponding to the initial subsidiary information of the shared cache according to the target cache; and write the target subsidiary information in the subsidiary directory in response to generating the data to be stored in the target cache according to the target identification information.
本公开实施例中,第二写入模块142,还用于:响应于待存储数据存储至共享缓存,获取初始附属信息对应的第一标识信息。In the embodiment of the present disclosure, the second writing module 142 is further used to: in response to the data to be stored being stored in the shared cache, obtain the first identification information corresponding to the initial subsidiary information.
本公开实施例中,第二写入模块142,还用于:响应于将第一标识信息标记至附属标识位上生成待存储数据存储至共享缓存,写入共享缓存的附属目录中的第一附属信息。In the disclosed embodiment, the second writing module 142 is further used to: in response to marking the first identification information to the subsidiary identification bit to generate the data to be stored in the shared cache, write the first subsidiary information in the subsidiary directory of the shared cache.
本公开实施例中,第二写入模块142,还用于:响应于待存储数据写入第一私有缓存,获取初始附属信息的第二标识信息。In the embodiment of the present disclosure, the second writing module 142 is further used to: in response to the data to be stored being written into the first private cache, obtain the second identification information of the initial subsidiary information.
本公开实施例中,第二写入模块142,还用于:响应于将第二标识信息标记至附属标识位上生成待存储数据存储至第一私有缓存,写入共享缓存的附属目录中的第二附属信息。In the disclosed embodiment, the second writing module 142 is further used to: in response to marking the second identification information to the subsidiary identification bit, generate the data to be stored and store it in the first private cache, and write the second subsidiary information in the subsidiary directory of the shared cache.
本公开实施例中,第二写入模块142,还用于:响应于待存储数据写入共享缓存和第一私有缓存,获取初始附属信息的第三标识信息。In the embodiment of the present disclosure, the second writing module 142 is further used to: in response to the data to be stored being written into the shared cache and the first private cache, obtain the third identification information of the initial subsidiary information.
本公开实施例中,第二写入模块142,还用于:响应于将第三标识信息标记至附属标识位上生成待存储数据存储至共享缓存和第一私有缓存,写入共享缓存的附属目录中的第三附属信息。In the disclosed embodiment, the second writing module 142 is further used to: in response to marking the third identification information to the subsidiary identification bit to generate data to be stored in the shared cache and the first private cache, write the third subsidiary information in the subsidiary directory of the shared cache.
本公开实施例中,第二写入模块142,还用于:响应于待存储数据存储于共享缓存,获取附属信息在附属目录中的附属信息路号和附属信息行号;将附属信息路号和附属信息行号,写入共享缓存的数据存储阵列的信息域中。 In the embodiment of the present disclosure, the second writing module 142 is also used to: in response to the data to be stored being stored in the shared cache, obtain the subsidiary information path number and the subsidiary information row number in the subsidiary directory; write the subsidiary information path number and the subsidiary information row number into the information field of the data storage array of the shared cache.
本公开实施例中,第二写入模块142,还用于:响应于附属目录中无可供待存储数据对应的附属信息写入的对应行,获取附属目录的第一替换策略;根据第一替换策略,确定附属目录中的第一替换信息,删除第一替换信息并将附属信息写入第一替换信息的对应行,并同步删除第一替换信息对应的数据块。In the embodiment of the present disclosure, the second writing module 142 is also used to: in response to the absence of a corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, obtain a first replacement strategy for the subsidiary directory; determine the first replacement information in the subsidiary directory according to the first replacement strategy, delete the first replacement information and write the subsidiary information into the corresponding row of the first replacement information, and synchronously delete the data block corresponding to the first replacement information.
本公开实施例中,第二写入模块142,还用于:响应于共享缓存的数据存储阵列的数据域中,无可供待存储数据的第一数据块存储的对应位置,获取共享缓存的第二替换策略;根据第二替换策略,确定数据域中的第二替换数据块,将第一数据块存储至第二替换数据块所属的第二替换位置,并删除第二替换位置上的第二替换数据块;确定第二替换数据块在附属目录中对应的第二替换信息;确定附属目录中第二替换信息删除的对应行,并将第一数据块对应的附属信息写入删除的对应行。In the disclosed embodiment, the second writing module 142 is further used to: obtain a second replacement strategy of the shared cache in response to the fact that there is no corresponding location for storing the first data block of data to be stored in the data domain of the data storage array of the shared cache; determine the second replacement data block in the data domain according to the second replacement strategy, store the first data block to the second replacement location to which the second replacement data block belongs, and delete the second replacement data block at the second replacement location; determine the second replacement information corresponding to the second replacement data block in the subsidiary directory; determine the corresponding row in the subsidiary directory where the second replacement information is deleted, and write the subsidiary information corresponding to the first data block into the corresponding row deleted.
本公开实施例中,第二写入模块142,还用于:从数据存储阵列的信息域中,获取第二替换数据块对应的第二替换信息的替换附属信息行号和替换附属信息路号;根据替换附属信息行号和替换附属信息路号,从共享缓存的附属目录中,确定第二替换信息。In the disclosed embodiment, the second writing module 142 is also used to: obtain the replacement subsidiary information row number and the replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block from the information domain of the data storage array; and determine the second replacement information from the subsidiary directory of the shared cache according to the replacement subsidiary information row number and the replacement subsidiary information path number.
本公开实施例提出的多级缓存系统的数据存储装置,获取待存储数据在多级缓存系统中的写入后信息,根据写入后信息生成待存储数据对应的附属信息,并将其写入多级缓存系统中用于共享的共享缓存的附属目录中。本公开实施例中,生成待存储数据在多级缓存系统中的写入后信息对应的附属信息,并将其写入多级缓存系统中的共享缓存的附属目录中,使得通过读取共享缓存的标签域中的附属目录,可以实现对待存储数据在多级缓存系统中的写入后信息的获取,简化了待存储数据的写入后信息的获取方法,提高了对多级缓存系统中的待存储数据的写入后信息的获取效率,节约了多级缓存系统中目录维护的资源,实现了多级缓存系统中的目录的可扩展,优化了多级缓存系统的性能。The data storage device of the multi-level cache system proposed in the embodiment of the present disclosure obtains the post-write information of the data to be stored in the multi-level cache system, generates the subsidiary information corresponding to the data to be stored according to the post-write information, and writes it into the subsidiary directory of the shared cache used for sharing in the multi-level cache system. In the embodiment of the present disclosure, the subsidiary information corresponding to the post-write information of the data to be stored in the multi-level cache system is generated, and written into the subsidiary directory of the shared cache in the multi-level cache system, so that the post-write information of the data to be stored in the multi-level cache system can be obtained by reading the subsidiary directory in the tag field of the shared cache, which simplifies the method for obtaining the post-write information of the data to be stored, improves the efficiency of obtaining the post-write information of the data to be stored in the multi-level cache system, saves the resources for directory maintenance in the multi-level cache system, realizes the scalability of the directory in the multi-level cache system, and optimizes the performance of the multi-level cache system.
为了实现上述实施例,本公开实施例还提出一种电子设备1500,如图15所示,该电子设备1500具体可包括:存储器1501、处理器1502及存储在存储器1501上并可在处理器1502上运行的计算机程序,处理器1502执行程序时,实现如上述实施例所示的多级缓存系统的数据存储方法或多级缓存系统的访问方法。In order to implement the above embodiments, the embodiments of the present disclosure also propose an electronic device 1500, as shown in Figure 15, the electronic device 1500 may specifically include: a memory 1501, a processor 1502, and a computer program stored in the memory 1501 and executable on the processor 1502. When the processor 1502 executes the program, it implements the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
为了实现上述实施例,本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行,以实现如上述实施例所示的多级缓存系统的数据存储方法或多级缓存系统的访问方法。In order to implement the above embodiments, the embodiments of the present disclosure also propose a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement a data storage method of a multi-level cache system or an access method of a multi-level cache system as shown in the above embodiments.
为了实现上述实施例,本公开实施例还提出一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如上述实施例所示的多级缓存系统的数据存储方法或多级缓存系统的访问方法。In order to implement the above embodiments, the embodiments of the present disclosure also propose a computer program product, including a computer program, which, when executed by a processor, implements the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
为了实现上述实施例,本公开实施例还提出一种计算机程序,包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得所述计算机执行如上述实施例所示的多级缓存系统的数据存储方法或多级缓存系统的访问方法。In order to implement the above embodiments, the embodiments of the present disclosure also propose a computer program, including computer program code. When the computer program code runs on a computer, the computer executes the data storage method of the multi-level cache system or the access method of the multi-level cache system as shown in the above embodiments.
需要说明的是,前述对多级缓存系统的数据存储方法及装置和多级缓存系统的访问方法及装置的解释说明也适用于上述实施例中的电子设备、存储介质、计算机程序产品和计算机程序,此处不再赘述。It should be noted that the above explanations of the data storage method and device of the multi-level cache system and the access method and device of the multi-level cache system are also applicable to the electronic devices, storage media, computer program products and computer programs in the above embodiments and will not be repeated here.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本公开的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本公开的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
尽管上面已经示出和描述了本公开的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本公开的限制,本领域的普通技术人员在本公开的范围内可以对上述实施例进行变化、修改、替换和变型。本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。 Although the embodiments of the present disclosure have been shown and described above, it is understood that the above embodiments are exemplary and cannot be understood as limiting the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure. All embodiments of the present disclosure may be performed alone or in combination with other embodiments, and are all deemed to be within the scope of protection claimed by the present disclosure.

Claims (50)

  1. 一种多级缓存系统的访问方法,其特征在于,所述方法包括:A method for accessing a multi-level cache system, characterized in that the method comprises:
    获取多级缓存系统的访问请求;Get access requests to the multi-level cache system;
    根据所述访问请求,从所述多级缓存系统的附属目录中,获取所述访问请求在所述多级缓存系统中的目标访问数据块以及所述目标访问数据块的目标附属信息,其中,所述附属目录存储于所述多级缓存系统中的共享缓存上;According to the access request, obtaining, from an auxiliary directory of the multi-level cache system, a target access data block of the access request in the multi-level cache system and target auxiliary information of the target access data block, wherein the auxiliary directory is stored on a shared cache in the multi-level cache system;
    根据所述目标附属信息,对所述访问请求进行应答。The access request is responded to according to the target attached information.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述目标附属信息,对所述访问请求进行应答,包括:The method according to claim 1, wherein responding to the access request according to the target attached information comprises:
    根据所述目标附属信息,确定所述访问请求的访问状态;Determining the access status of the access request according to the target attached information;
    所述共享缓存对处于所述访问状态下的所述访问请求进行应答。The shared cache responds to the access request in the access state.
  3. 根据权利要求1所述的方法,其特征在于,所述附属目录存储于所述多级缓存系统中的共享缓存上的标签域中。The method according to claim 1 is characterized in that the subsidiary directory is stored in a tag field on a shared cache in the multi-level cache system.
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述目标附属信息,确定所述访问请求的访问状态,包括:The method according to claim 2, characterized in that the determining the access status of the access request according to the target attached information comprises:
    获取所述多级缓存系统中第一私有缓存对第二私有缓存发送的访问请求,其中,所述第一私有缓存和所述第二私有缓存为多核处理器的私有缓存,所述多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存;Obtaining an access request sent by a first private cache to a second private cache in the multi-level cache system, wherein the first private cache and the second private cache are private caches of a multi-core processor, and each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache;
    在所述共享缓存的附属目录中,确定所述访问请求在所述多级缓存系统中的目标访问数据块对应的附属信息,作为所述目标附属信息;Determining, in the subsidiary directory of the shared cache, subsidiary information corresponding to a target access data block of the access request in the multi-level cache system as the target subsidiary information;
    获取所述目标附属信息的附属标识位上的附属信息,并根据所述附属标识位上的附属信息,获取所述访问请求的所述访问状态。The auxiliary information on the auxiliary identification bit of the target auxiliary information is obtained, and the access status of the access request is obtained according to the auxiliary information on the auxiliary identification bit.
  5. 根据权利要求2所述的方法,其特征在于,所述根据所述目标附属信息,确定所述访问请求的访问状态,包括:The method according to claim 2, characterized in that the determining the access status of the access request according to the target attached information comprises:
    响应于所述目标附属信息指示,第一私有缓存对第二私有缓存发送的所述访问请求未在所述第一私有缓存中命中,确定所述访问请求的所述访问状态为访问失效。In response to the target attachment information indicating that the access request sent by the first private cache to the second private cache does not hit in the first private cache, it is determined that the access status of the access request is access failure.
  6. 根据权利要求5所述的方法,其特征在于,所述共享缓存对处于所述访问状态下的所述访问请求进行应答,包括:The method according to claim 5, characterized in that the shared cache responds to the access request in the access state, comprising:
    响应于所述多级缓存系统中所述第一私有缓存对所述第二私有缓存发送的所述访问请求的所述访问状态为所述访问失效,所述第一私有缓存向所述共享缓存发送失效处理请求;In response to the access status of the access request sent by the first private cache to the second private cache in the multi-level cache system being the access failure, the first private cache sending an invalidation processing request to the shared cache;
    所述共享缓存根据所述目标附属信息,对所述失效处理请求进行应答。The shared cache responds to the invalidation processing request according to the target attachment information.
  7. 根据权利要求6所述的方法,其特征在于,所述响应于所述多级缓存系统中所述第一私有缓存对所述第二私有缓存发送的所述访问请求的所述访问状态为所述访问失效,所述第一私有缓存向所述共享缓存发送失效处理请求,包括:The method according to claim 6, characterized in that in response to the access status of the access request sent by the first private cache to the second private cache in the multi-level cache system being the access invalidation, the first private cache sending an invalidation processing request to the shared cache comprises:
    响应于所述访问请求为读访问请求且所述读访问请求未在所述第一私有缓存中命中,确定所述第一私有缓存对所述读访问请求读失效,所述第一私有缓存生成所述读访问请求对应的第一读失效处理请求,并发送至所述共享缓存;In response to the access request being a read access request and the read access request not being hit in the first private cache, determining that the first private cache read-invalidates the read access request, the first private cache generates a first read-invalidation processing request corresponding to the read access request, and sends the request to the shared cache;
    响应于所述访问请求为写访问请求且所述写访问请求未在所述第一私有缓存中命中,确定所述第一私有缓存对所述写访问请求写失效,所述第一私有缓存生成所述写访问请求对应的第一写失效处理请求,并发送至所述共享缓存。In response to the access request being a write access request and the write access request not hitting the first private cache, it is determined that the first private cache write-invalidates the write access request, the first private cache generates a first write-invalidate processing request corresponding to the write access request, and sends it to the shared cache.
  8. 根据权利要求7所述的方法,其特征在于,所述第一私有缓存生成所述读访问请求对应的第一读失效处理请求,并发送至所述共享缓存之后,还包括:The method according to claim 7, characterized in that after the first private cache generates a first read invalidation processing request corresponding to the read access request and sends it to the shared cache, it also includes:
    响应于所述目标附属信息指示,所述第一私有缓存中不存在所述目标访问数据块,获取所述目标访问数据块对应的数据后,所述共享缓存生成对应的读失效应答,并发送至发出所述第一读失效处理请求的第一私有缓存;或者, In response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining data corresponding to the target access data block, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request; or,
    响应于所述目标附属信息指示,所述第一私有缓存中的所述目标访问数据块为dirty状态,所述共享缓存接收到第一写回应答后,生成对应的读失效应答,并发送至发出所述第一读失效处理请求的第一私有缓存。In response to the target attachment information indicating that the target access data block in the first private cache is in a dirty state, after receiving the first write-back response, the shared cache generates a corresponding read invalidation response and sends it to the first private cache that issued the first read invalidation processing request.
  9. 根据权利要求7所述的方法,其特征在于,所述第一私有缓存生成所述写访问请求对应的第一写失效处理请求,并发送至所述共享缓存之后,还包括:The method according to claim 7, characterized in that after the first private cache generates a first write invalidation processing request corresponding to the write access request and sends it to the shared cache, it also includes:
    响应于所述目标附属信息指示,所述第一私有缓存中不存在所述目标访问数据块,获取所述目标访问数据块对应的数据后,所述共享缓存生成对应的写失效应答,并发送至发出所述第一写失效处理请求的第一私有缓存;或者,In response to the target attachment information indicating that the target access data block does not exist in the first private cache, after obtaining data corresponding to the target access data block, the shared cache generates a corresponding write invalidation response and sends it to the first private cache that issued the first write invalidation processing request; or
    响应于所述目标附属信息指示,所述第一私有缓存中的所述目标访问数据块为有效且clean状态,所述共享缓存接收到第一无效应答后,生成对应的写失效应答,并发送至发出所述第一写失效处理请求的第一私有缓存;或者,In response to the target attachment information indicating that the target access data block in the first private cache is valid and in a clean state, the shared cache generates a corresponding write-invalidation response after receiving the first invalidation response, and sends it to the first private cache that issued the first write-invalidation processing request; or
    响应于所述目标附属信息指示,所述第一私有缓存中的所述目标访问数据块为有效且clean状态,所述共享缓存接收到第一无效并写回应答后,生成对应的写失效应答,并发送至发出所述第一写失效处理请求的第一私有缓存。In response to the target attachment information indicating that the target access data block in the first private cache is valid and clean, after the shared cache receives the first invalidation and write-back response, it generates a corresponding write-invalidation response and sends it to the first private cache that issued the first write-invalidation processing request.
  10. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, characterized in that the method further comprises:
    响应于所述第一私有缓存中的数据块被替换,所述第一私有缓存向所述共享缓存发送替换请求。In response to a data block in the first private cache being replaced, the first private cache sends a replacement request to the shared cache.
  11. 根据权利要求10所述的方法,其特征在于,所述响应于所述第一私有缓存中的数据块被替换,所述第一私有缓存向所述共享缓存发送替换请求之后,还包括:The method according to claim 10, characterized in that in response to the data block in the first private cache being replaced, after the first private cache sends a replacement request to the shared cache, it further comprises:
    响应于所述共享缓存中存储有所述替换请求对应的替换数据块,所述共享缓存对所述替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核;In response to the shared cache storing a replacement data block corresponding to the replacement request, the shared cache performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs;
    响应于所述共享缓存中不存在所述替换请求对应的替换数据块,在所述共享缓存的下一级存储系统中,确定所述替换请求对应的替换数据块,所述下一级存储系统对所述替换请求对应的替换数据块进行替换处理,并生成对应的应答发送至对应的第一私有缓存所属的处理器核。In response to the fact that a replacement data block corresponding to the replacement request does not exist in the shared cache, a replacement data block corresponding to the replacement request is determined in a next-level storage system of the shared cache, and the next-level storage system performs replacement processing on the replacement data block corresponding to the replacement request, and generates a corresponding response and sends it to the processor core to which the corresponding first private cache belongs.
  12. 根据权利要求4所述的方法,其特征在于,所述在所述共享缓存的附属目录中,确定所述访问请求在所述多级缓存系统中的目标访问数据块对应的附属信息,作为所述目标附属信息,包括:The method according to claim 4 is characterized in that the determining, in the subsidiary directory of the shared cache, subsidiary information corresponding to the target access data block of the access request in the multi-level cache system as the target subsidiary information comprises:
    响应于所述第一私有缓存所属的处理器核为所述目标访问数据块的备份处理器核,根据所述附属目录中的备份位上的标识信息,确定所述目标访问数据块在所述附属目录中对应的所述目标附属信息;In response to the processor core to which the first private cache belongs being a backup processor core of the target access data block, determining the target subsidiary information corresponding to the target access data block in the subsidiary directory according to identification information on the backup bit in the subsidiary directory;
    响应于所述第一私有缓存所属的处理器核为所述目标访问数据块的拥有者处理器核,根据所述附属目录中对应的拥有者位上的标识信息,确定所述目标访问数据块在所述附属目录中对应的所述目标附属信息。In response to the processor core to which the first private cache belongs being the owner processor core of the target access data block, the target subsidiary information corresponding to the target access data block in the subsidiary directory is determined according to identification information on the corresponding owner bit in the subsidiary directory.
  13. 根据权利要求6所述的方法,其特征在于,所述共享缓存根据所述目标附属信息,对所述失效处理请求进行应答,包括:The method according to claim 6, wherein the shared cache responds to the invalidation processing request according to the target attachment information, comprising:
    所述共享缓存获取所述目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定所述目标访问数据块的目标状态;The shared cache obtains identification information on a valid bit of the data block to be stored and a target owner bit in the target subsidiary information, and determines a target state of the target access data block;
    所述共享缓存根据所述目标状态,对所述失效处理请求进行应答。The shared cache responds to the invalidation processing request according to the target state.
  14. 根据权利要求13所述的方法,其特征在于,所述共享缓存获取所述目标附属信息中待存储数据块有效位和目标拥有者位上的标识信息,确定所述目标访问数据块的目标状态,包括:The method according to claim 13, characterized in that the shared cache obtains identification information on a valid bit of the data block to be stored and a target owner bit in the target auxiliary information to determine a target state of the target access data block, comprising:
    响应于所述待存储数据块有效位的标识为有效,且所述目标拥有者位的标识为所述待存储数据块存在拥有者处理器核状态,确定所述目标访问数据块的所述目标状态为有效且dirty;In response to the identification of the valid bit of the data block to be stored being valid, and the identification of the target owner bit being that the data block to be stored has an owner processor core state, determining that the target state of the target access data block is valid and dirty;
    响应于所述待存储数据块有效位的标识为有效,且所述目标拥有者位的标识为所述待存储数据块不存在拥有者处理器核状态,确定所述目标访问数据块的所述目标状态为有效且clean。In response to the valid bit of the data block to be stored being marked as valid and the target owner bit being marked as a state where the data block to be stored has no owner processor core, the target state of the target access data block is determined to be valid and clean.
  15. 根据权利要求14所述的方法,其特征在于,所述共享缓存根据所述目标状态,对所述失效处理请求进行应答,包括:The method according to claim 14, wherein the shared cache responds to the invalidation processing request according to the target state, comprising:
    响应于所述目标状态为有效且dirty,所述共享缓存生成第一读失效处理请求对应的第一写回请求,并发送至所述目标访问数据块对应的拥有者处理器核上的第一私有缓存;In response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request, and sends the first private cache on the owner processor core corresponding to the target access data block;
    响应于所述目标状态为有效且clean,所述共享缓存生成所述第一读失效处理请求对应的第二写回 请求,并发送至所述目标访问数据块对应的任一备份处理器核上的第一私有缓存。In response to the target state being valid and clean, the shared cache generates a second write-back corresponding to the first read invalidation processing request. The request is sent to the first private cache on any backup processor core corresponding to the target access data block.
  16. 根据权利要求15所述的方法,其特征在于,所述响应于所述目标状态为有效且dirty,所述共享缓存生成第一读失效处理请求对应的第一写回请求,并发送至所述目标访问数据块对应的拥有者处理器核上的第一私有缓存之后,还包括:The method according to claim 15, characterized in that, in response to the target state being valid and dirty, the shared cache generates a first write-back request corresponding to the first read invalidation processing request and sends it to the first private cache on the owner processor core corresponding to the target access data block, further comprising:
    响应于识别到所述第二私有缓存中存储有所述目标访问数据块对应的备份数据块,所述第一私有缓存生成第三写回请求并发送至所述第二私有缓存;In response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a third write-back request and sends it to the second private cache;
    根据所述第三写回请求,所述第二私有缓存调整所述备份数据块至共享状态,并将调整后的备份数据块写回所述第一私有缓存;According to the third write-back request, the second private cache adjusts the backup data block to a shared state, and writes the adjusted backup data block back to the first private cache;
    所述第一私有缓存调整所述目标访问数据块至共享状态。The first private cache adjusts the target access data block to a shared state.
  17. 根据权利要求16所述的方法,其特征在于,所述第一私有缓存调整所述目标访问数据块至共享状态之后,还包括:The method according to claim 16, characterized in that after the first private cache adjusts the target access data block to a shared state, it also includes:
    将调整状态的目标访问数据块所属的第一私有缓存所在的处理器核,标记为调整至共享状态的目标访问数据块的拥有者处理器核,并在所述共享缓存的附属目录中更新。The processor core where the first private cache to which the target access data block whose state is adjusted belongs is marked as the owner processor core of the target access data block adjusted to the shared state, and updated in the subsidiary directory of the shared cache.
  18. 根据权利要求17所述的方法,其特征在于,所述响应于所述目标状态为有效且clean,所述共享缓存生成所述第一读失效处理请求对应的第二写回请求,并发送至所述目标访问数据块对应的任一备份处理器核上的第一私有缓存之后,还包括:The method according to claim 17, characterized in that, in response to the target state being valid and clean, the shared cache generates a second write-back request corresponding to the first read invalidation processing request and sends it to the first private cache on any backup processor core corresponding to the target access data block, further comprising:
    所述第一私有缓存将所述目标访问数据块中的数据,发送至所述共享缓存。The first private cache sends the data in the target access data block to the shared cache.
  19. 根据权利要求14所述的方法,其特征在于,所述共享缓存根据所述目标状态,对所述失效处理请求进行应答,包括:The method according to claim 14, wherein the shared cache responds to the invalidation processing request according to the target state, comprising:
    响应于所述目标状态为有效且dirty,所述共享缓存生成第一写失效处理请求对应的第一无效并写回请求,并发送至所述目标访问数据块对应的拥有者处理器核上的第一私有缓存;In response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends the request to a first private cache on an owner processor core corresponding to the target access data block;
    响应于所述目标状态为有效且clean,所述共享缓存生成所述第一写失效处理请求对应的第一无效请求,并发送至所述目标访问数据块对应的全部备份处理器核上的第一私有缓存。In response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends the first private caches on all backup processor cores corresponding to the target access data block.
  20. 根据权利要求19所述的方法,其特征在于,所述响应于所述目标状态为有效且dirty,所述共享缓存生成第一写失效处理请求对应的第一无效并写回请求,并发送至所述目标访问数据块对应的拥有者处理器核上的第一私有缓存之后,还包括:The method according to claim 19, characterized in that, in response to the target state being valid and dirty, the shared cache generates a first invalidation and write-back request corresponding to the first write invalidation processing request, and sends it to the first private cache on the owner processor core corresponding to the target access data block, and further comprises:
    响应于识别到所述第二私有缓存中存储有所述目标访问数据块对应的备份数据块,所述第一私有缓存生成第二无效并写回请求并发送至所述第二私有缓存;In response to identifying that a backup data block corresponding to the target access data block is stored in the second private cache, the first private cache generates a second invalidate and write back request and sends it to the second private cache;
    根据所述第二无效并写回请求,所述第二私有缓存调整所述备份数据块至无效状态,并将调整后的备份数据块写回所述第一私有缓存;According to the second invalidation and write-back request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache;
    所述第一私有缓存调整所述目标访问数据块至无效状态,并生成第一无效并写回应答发送所述共享缓存。The first private cache adjusts the target access data block to an invalid state, and generates a first invalidate and write back response to send to the shared cache.
  21. 根据权利要求19所述的方法,其特征在于,所述响应于所述目标状态为有效且clean,所述共享缓存生成所述第一写失效处理请求对应的第一无效请求,并发送至所述目标访问数据块对应的全部备份处理器核上的第一私有缓存之后,还包括:The method according to claim 19, characterized in that, in response to the target state being valid and clean, the shared cache generates a first invalidation request corresponding to the first write invalidation processing request, and sends it to the first private caches on all backup processor cores corresponding to the target access data block, further comprising:
    响应于识别到所述第二私有缓存中存储有所述目标访问数据块的备份数据块,所述第一私有缓存生成第二无效请求并发送至所述第二私有缓存;In response to identifying that a backup data block of the target access data block is stored in the second private cache, the first private cache generates a second invalidation request and sends it to the second private cache;
    根据所述第二无效请求,所述第二私有缓存调整所述备份数据块至无效状态,并将调整后的备份数据块写回所述第一私有缓存;According to the second invalidation request, the second private cache adjusts the backup data block to an invalid state, and writes the adjusted backup data block back to the first private cache;
    所述第一私有缓存调整所述目标访问数据块至无效状态,并生成第一无效应答发送至所述共享缓存。The first private cache adjusts the target access data block to an invalid state, and generates a first invalidation response and sends it to the shared cache.
  22. 根据权利要求21所述的方法,其特征在于,所述方法还包括:The method according to claim 21, characterized in that the method further comprises:
    所述拥有者处理器核上的第一私有缓存,将所述目标访问数据块中的数据发送至所述共享缓存。The first private cache on the owner processor core sends the data in the target access data block to the shared cache.
  23. 根据权利要求1-22中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 22, characterized in that the method further comprises:
    响应于目标附属信息指示,所述目标访问数据块在所述多级缓存系统的第一私有缓存中不存在,获取所述共享缓存的附属目录的替换策略,并根据所述替换策略对所述共享缓存的所述附属目录进行更 新;In response to the target attachment information indicating that the target access data block does not exist in the first private cache of the multi-level cache system, obtaining a replacement strategy for the attachment directory of the shared cache, and updating the attachment directory of the shared cache according to the replacement strategy. new;
    根据更新后附属目录中的更新附属信息,对所述第一私有缓存进行信息更新。The first private cache is updated according to the updated subsidiary information in the updated subsidiary directory.
  24. 根据权利要求23所述的方法,其特征在于,所述根据更新后附属目录中的更新附属信息,对所述第一私有缓存进行信息更新,包括:The method according to claim 23, characterized in that the updating of information in the first private cache according to the updated subsidiary information in the updated subsidiary directory comprises:
    响应于所述更新附属信息指示,所述第一私有缓存内的附属信息对应数据块为有效且clean状态,所述共享缓存生成第三无效请求,并发送所述第三无效请求至所述附属信息对应数据块的拥有者处理器核上的第一私有缓存;In response to the update auxiliary information indication, the data block corresponding to the auxiliary information in the first private cache is valid and in a clean state, the shared cache generates a third invalidation request, and sends the third invalidation request to the first private cache on the processor core that owns the data block corresponding to the auxiliary information;
    响应于所述更新附属信息指示,所述第一私有缓存内的附属信息对应数据块为有效且dirty状态,所述共享缓存生成第四无效请求,并发送所述第四无效请求至所述附属信息对应数据块的非拥有者处理器核上的第一私有缓存。In response to the update of the subsidiary information indication, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a fourth invalidation request, and sends the fourth invalidation request to the first private cache on the non-owner processor core of the data block corresponding to the subsidiary information.
  25. 根据权利要求23所述的方法,其特征在于,所述根据更新后附属目录中的更新附属信息,对所述第一私有缓存进行信息更新,还包括:The method according to claim 23, wherein the updating of information in the first private cache according to the updated subsidiary information in the updated subsidiary directory further comprises:
    响应于所述更新附属信息指示,所述第一私有缓存内的附属信息对应数据块为有效且dirty状态,所述共享缓存生成第三无效并写回请求,并发送所述第三无效并写回请求至所述附属信息对应数据块的拥有者处理器核上的第一私有缓存,或者,发送所述第三无效并写回请求至独占所述附属信息对应数据块的备份处理器核上的第一私有缓存。In response to the update indication of the subsidiary information, the data block corresponding to the subsidiary information in the first private cache is valid and dirty, the shared cache generates a third invalidation and write-back request, and sends the third invalidation and write-back request to the first private cache on the processor core that owns the data block corresponding to the subsidiary information, or sends the third invalidation and write-back request to the first private cache on the backup processor core that exclusively owns the data block corresponding to the subsidiary information.
  26. 根据权利要求25所述的方法,其特征在于,所述方法还包括:The method according to claim 25, characterized in that the method further comprises:
    响应于所述共享缓存中存储有所述附属信息对应数据块的备份数据块,且所述更新附属信息的标识信息与所述附属信息对应数据块在所述第一私有缓存中的写入后信息不匹配,所述共享缓存对自身的数据存储阵列中的数据域中的存储的备份数据块进行替换处理。In response to the shared cache storing a backup data block of the data block corresponding to the subsidiary information, and the identification information of the updated subsidiary information does not match the post-write information of the data block corresponding to the subsidiary information in the first private cache, the shared cache replaces the backup data block stored in the data domain in its own data storage array.
  27. 一种多级缓存系统的数据存储方法,其特征在于,所述方法包括:A data storage method for a multi-level cache system, characterized in that the method comprises:
    将待存储数据写入多级缓存系统,并获取所述待存储数据在所述多级缓存系统中的写入后信息;Writing the data to be stored into the multi-level cache system, and obtaining the post-writing information of the data to be stored in the multi-level cache system;
    生成所述待存储数据的所述写入后信息对应的附属信息,并将所述附属信息写入所述多级缓存系统的附属目录中,其中,所述附属目录存储于所述多级缓存系统中的共享缓存上。Generate subsidiary information corresponding to the post-write information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system.
  28. 根据权利要求27所述的方法,其特征在于,所述多级缓存系统中包括共享缓存、第一私有缓存和第二私有缓存,所述共享缓存为所述多级缓存系统所属的多核处理器中的共享缓存,所述第一私有缓存和所述第二私有缓存为所述多核处理器的私有缓存;The method according to claim 27 is characterized in that the multi-level cache system includes a shared cache, a first private cache, and a second private cache, the shared cache is a shared cache in a multi-core processor to which the multi-level cache system belongs, and the first private cache and the second private cache are private caches of the multi-core processor;
    其中,所述多核处理器中的每个处理器核包括至少一个第一私有缓存和/或至少一个第二私有缓存。Each processor core in the multi-core processor includes at least one first private cache and/or at least one second private cache.
  29. 根据权利要求27所述的方法,其特征在于,所述附属目录存储于所述多级缓存系统中的共享缓存上的标签域中。The method according to claim 27 is characterized in that the subsidiary directory is stored in a tag field on a shared cache in the multi-level cache system.
  30. 根据权利要求28所述的方法,其特征在于,所述第一私有缓存为所述多核处理器中部分处理器核的共享缓存。The method according to claim 28 is characterized in that the first private cache is a shared cache of some processor cores in the multi-core processor.
  31. 根据权利要求28所述的方法,其特征在于,所述生成所述待存储数据的所述写入后信息对应的附属信息,包括:The method according to claim 28, characterized in that the generating of the auxiliary information corresponding to the post-writing information of the data to be stored comprises:
    获取所述共享缓存的初始附属信息中的附属标识位;Obtaining an attachment identification bit in the initial attachment information of the shared cache;
    从所述写入后信息中,获取所述待存储数据在所述附属标识位的标识信息,并将所述标识信息标记至对应的附属标识位,以生成所述待存储数据的附属信息。The identification information of the data to be stored in the subsidiary identification bit is obtained from the written information, and the identification information is marked to the corresponding subsidiary identification bit to generate the subsidiary information of the data to be stored.
  32. 根据权利要求31所述的方法,其特征在于,所述初始附属信息中的附属标识位,包括:The method according to claim 31, characterized in that the attachment identification bit in the initial attachment information comprises:
    写入地址位,用于指示存储所述待存储数据的数据块的写入地址;A write address bit, used to indicate a write address of a data block storing the data to be stored;
    地址有效位,用于指示存储所述数据块的写入地址是否有效;An address valid bit, used to indicate whether the write address storing the data block is valid;
    第一有效位,用于指示存储于所述共享缓存中的第一数据块是否有效,其中,所述第一数据块为所述共享缓存中存储所述待存储数据的数据块;A first valid bit, used to indicate whether a first data block stored in the shared cache is valid, wherein the first data block is a data block in the shared cache storing the data to be stored;
    第一状态位,用于指示所述待存储数据在所述共享缓存中是否被写过数据;A first status bit, used to indicate whether the data to be stored has been written in the shared cache;
    数据域行号位,用于指示所述第一数据块在所述共享缓存的数据存储阵列的数据域中的存储行号。The data domain row number bit is used to indicate the storage row number of the first data block in the data domain of the data storage array of the shared cache.
  33. 根据权利要求32所述的方法,其特征在于,所述初始附属信息中的附属标识位,还包括:The method according to claim 32, characterized in that the attachment identification bit in the initial attachment information further includes:
    第二有效位,用于指示存储于所述第一私有缓存中的第二数据块是否有效,其中,所述第二数据块 为所述第一私有缓存中存储所述待存储数据的数据块;A second valid bit is used to indicate whether the second data block stored in the first private cache is valid. storing a data block of the data to be stored in the first private cache;
    第二状态位,用于指示所述第二数据块在所述多核处理器的全部第一私有缓存中的第二数据状态,其中,所述第二数据状态为独占状态(EXC)或共享状态(SHD);A second state bit, used to indicate a second data state of the second data block in all first private caches of the multi-core processor, wherein the second data state is an exclusive state (EXC) or a shared state (SHD);
    备份位,用于指示在所述多核处理器中,存储有所述第二数据块的备份数据块的备份处理器核;A backup bit, used to indicate a backup processor core storing a backup data block of the second data block in the multi-core processor;
    第一拥有者位,用于指示所述多核处理器中是否存在所述第二数据块的拥有者处理器核;A first owner bit, used to indicate whether there is an owner processor core of the second data block in the multi-core processor;
    第二拥有者位,用于指示所述多核处理器中,所述第二数据块的拥有者处理器核。The second owner bit is used to indicate the owner processor core of the second data block in the multi-core processor.
  34. 根据权利要求33所述的方法,其特征在于,所述方法包括:The method according to claim 33, characterized in that the method comprises:
    确定所述多级缓存系统中,所述待存储数据写入的目标缓存;Determine a target cache in the multi-level cache system into which the data to be stored is written;
    根据所述目标缓存,获取所述共享缓存的所述初始附属信息对应的目标标识信息;According to the target cache, obtaining target identification information corresponding to the initial subsidiary information of the shared cache;
    响应于根据所述目标标识信息生成所述待存储数据存储至所述目标缓存,写入所述附属目录中的目标附属信息。In response to generating the data to be stored according to the target identification information, storing the data in the target cache, and writing the target subsidiary information in the subsidiary directory.
  35. 根据权利要求34所述的方法,其特征在于,所述根据所述目标缓存,获取所述共享缓存的所述初始附属信息对应的目标标识信息,包括:The method according to claim 34, characterized in that the step of obtaining, according to the target cache, target identification information corresponding to the initial subsidiary information of the shared cache comprises:
    响应于所述待存储数据存储至所述共享缓存,获取所述初始附属信息对应的第一标识信息。In response to the data to be stored being stored in the shared cache, first identification information corresponding to the initial subsidiary information is acquired.
  36. 根据权利要求35所述的方法,其特征在于,所述响应于根据所述目标标识信息生成所述待存储数据存储至所述目标缓存,写入所述附属目录中的目标附属信息,包括:The method according to claim 35, characterized in that the response to generating the data to be stored according to the target identification information and storing it in the target cache, writing the target subsidiary information in the subsidiary directory comprises:
    响应于将所述第一标识信息标记至所述附属标识位上生成所述待存储数据存储至所述共享缓存,写入所述附属目录中的第一附属信息。In response to marking the first identification information onto the subsidiary identification bit, the data to be stored is generated and stored in the shared cache, and the first subsidiary information is written into the subsidiary directory.
  37. 根据权利要求34所述的方法,其特征在于,所述根据所述目标缓存,获取所述共享缓存的所述初始附属信息对应的目标标识信息,包括:The method according to claim 34, characterized in that the step of obtaining, according to the target cache, target identification information corresponding to the initial subsidiary information of the shared cache comprises:
    响应于所述待存储数据写入所述第一私有缓存,获取所述初始附属信息的第二标识信息。In response to the data to be stored being written into the first private cache, second identification information of the initial subsidiary information is acquired.
  38. 根据权利要求37所述的方法,其特征在于,所述响应于根据所述目标标识信息生成所述待存储数据存储至所述目标缓存,写入所述附属目录中的目标附属信息,包括:The method according to claim 37, characterized in that the response to generating the data to be stored according to the target identification information and storing it in the target cache, writing the target subsidiary information in the subsidiary directory comprises:
    响应于将所述第二标识信息标记至所述附属标识位上生成所述待存储数据存储至所述第一私有缓存,写入所述附属目录中的第二附属信息。In response to marking the second identification information onto the subsidiary identification bit, the data to be stored is generated and stored in the first private cache, and the second subsidiary information is written into the subsidiary directory.
  39. 根据权利要求34所述的方法,其特征在于,所述根据所述目标缓存,获取所述共享缓存的所述初始附属信息对应的目标标识信息,包括:The method according to claim 34, characterized in that the step of obtaining, according to the target cache, target identification information corresponding to the initial subsidiary information of the shared cache comprises:
    响应于所述待存储数据写入所述共享缓存和所述第一私有缓存,获取所述初始附属信息的第三标识信息。In response to the data to be stored being written into the shared cache and the first private cache, third identification information of the initial subsidiary information is acquired.
  40. 根据权利要求39所述的方法,其特征在于,所述响应于根据所述目标标识信息生成所述待存储数据存储至所述目标缓存,写入所述附属目录中的目标附属信息,包括:The method according to claim 39, characterized in that the response to generating the data to be stored according to the target identification information and storing it in the target cache, writing the target subsidiary information in the subsidiary directory comprises:
    响应于将所述第三标识信息标记至所述附属标识位上生成所述待存储数据存储至所述共享缓存和所述第一私有缓存,写入所述附属目录中的第三附属信息。In response to marking the third identification information onto the subsidiary identification bit, the data to be stored is generated and stored in the shared cache and the first private cache, and the third subsidiary information is written into the subsidiary directory.
  41. 根据权利要求27所述的方法,其特征在于,所述将所述附属信息写入所述多级缓存系统的附属目录中之后,还包括:The method according to claim 27, characterized in that after writing the auxiliary information into the auxiliary directory of the multi-level cache system, it also includes:
    响应于所述待存储数据存储于所述共享缓存,获取所述附属信息在所述附属目录中的附属信息路号和附属信息行号;In response to the data to be stored being stored in the shared cache, obtaining an auxiliary information path number and an auxiliary information row number of the auxiliary information in the auxiliary directory;
    将所述附属信息路号和所述附属信息行号,写入所述共享缓存的数据存储阵列的信息域中。The subsidiary information path number and the subsidiary information row number are written into the information field of the data storage array of the shared cache.
  42. 根据权利要求27-41中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 27 to 41, characterized in that the method further comprises:
    响应于所述附属目录中无可供所述待存储数据对应的附属信息写入的对应行,获取所述附属目录的第一替换策略;In response to the absence of a corresponding row in the subsidiary directory for writing the subsidiary information corresponding to the data to be stored, obtaining a first replacement strategy for the subsidiary directory;
    根据所述第一替换策略,确定所述附属目录中的第一替换信息,删除所述第一替换信息并将所述附属信息写入所述第一替换信息的对应行,并同步删除所述第一替换信息对应的数据块。According to the first replacement strategy, the first replacement information in the subsidiary directory is determined, the first replacement information is deleted and the subsidiary information is written into a corresponding row of the first replacement information, and the data block corresponding to the first replacement information is deleted synchronously.
  43. 根据权利要求27-41中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 27 to 41, characterized in that the method further comprises:
    响应于所述共享缓存的数据存储阵列的数据域中,无可供所述待存储数据的第一数据块存储的对应位置,获取所述共享缓存的第二替换策略; In response to the fact that there is no corresponding location for storing the first data block of the data to be stored in the data domain of the data storage array of the shared cache, obtaining a second replacement strategy of the shared cache;
    根据所述第二替换策略,确定所述数据域中的第二替换数据块,将所述第一数据块存储至所述第二替换数据块所属的第二替换位置,并删除所述第二替换位置上的所述第二替换数据块;According to the second replacement strategy, determine a second replacement data block in the data domain, store the first data block to a second replacement position to which the second replacement data block belongs, and delete the second replacement data block at the second replacement position;
    确定所述第二替换数据块在所述附属目录中对应的第二替换信息;Determine second replacement information corresponding to the second replacement data block in the subsidiary directory;
    确定所述附属目录中所述第二替换信息删除的对应行,并将所述第一数据块对应的附属信息写入所述删除的对应行。Determine the corresponding row in the subsidiary directory where the second replacement information is deleted, and write the subsidiary information corresponding to the first data block into the corresponding row deleted.
  44. 根据权利要求43所述的方法,其特征在于,所述确定所述第二替换数据块在所述附属目录中对应的第二替换信息,包括:The method according to claim 43, characterized in that the determining of the second replacement information corresponding to the second replacement data block in the subsidiary directory comprises:
    从所述数据存储阵列的信息域中,获取所述第二替换数据块对应的第二替换信息的替换附属信息行号和替换附属信息路号;Acquire, from the information field of the data storage array, a replacement subsidiary information row number and a replacement subsidiary information path number of the second replacement information corresponding to the second replacement data block;
    根据所述替换附属信息行号和所述替换附属信息路号,从所述附属目录中确定所述第二替换信息。The second replacement information is determined from the subsidiary directory according to the replacement subsidiary information row number and the replacement subsidiary information path number.
  45. 一种多级缓存系统的访问装置,其特征在于,所述装置包括:An access device for a multi-level cache system, characterized in that the device comprises:
    获取模块,用于获取多级缓存系统的访问请求;An acquisition module, used to acquire access requests to a multi-level cache system;
    访问模块,用于根据所述访问请求,从所述多级缓存系统的附属目录中,获取所述访问请求在所述多级缓存系统中的目标访问数据块以及所述目标访问数据块的目标附属信息,其中,所述附属目录存储于所述多级缓存系统中的共享缓存上;An access module, configured to obtain, according to the access request, a target access data block of the access request in the multi-level cache system and target attachment information of the target access data block from an attachment directory of the multi-level cache system, wherein the attachment directory is stored on a shared cache in the multi-level cache system;
    应答模块,用于根据所述目标附属信息,对所述访问请求进行应答。A response module is used to respond to the access request according to the target attached information.
  46. 一种多级缓存系统的数据存储装置,其特征在于,所述装置包括:A data storage device for a multi-level cache system, characterized in that the device comprises:
    第一写入模块,用于将待存储数据写入多级缓存系统,并获取所述待存储数据在所述多级缓存系统中的写入后信息;A first writing module, used for writing the data to be stored into the multi-level cache system, and obtaining the post-writing information of the data to be stored in the multi-level cache system;
    第二写入模块,用于生成所述待存储数据的所述写入后信息对应的附属信息,并将所述附属信息写入所述多级缓存系统的附属目录中,其中,所述附属目录存储于所述多级缓存系统中的共享缓存上。The second writing module is used to generate subsidiary information corresponding to the post-writing information of the data to be stored, and write the subsidiary information into a subsidiary directory of the multi-level cache system, wherein the subsidiary directory is stored on a shared cache in the multi-level cache system.
  47. 一种电子设备,其特征在于,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时,实现如权利要求1-26或权利要求27-44中任一项所述的方法。An electronic device, characterized in that it comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the method described in any one of claims 1 to 26 or claims 27 to 44.
  48. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-26或权利要求27-44中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method according to any one of claims 1 to 26 or claims 27 to 44 is implemented.
  49. 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序在被处理器执行时实现如权利要求1-26或权利要求27-44中任一项所述的方法。A computer program product, characterized in that it comprises a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 26 or claims 27 to 44.
  50. 一种计算机程序,其特征在于,包括计算机程序代码,当所述计算机程序代码在计算机上运行时,使得所述计算机执行如权利要求1-26或权利要求27-44中任一项所述的方法。 A computer program, characterized in that it comprises computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 26 or claims 27 to 44.
PCT/CN2023/104895 2022-09-28 2023-06-30 Access method and apparatus and data storage method and apparatus for multi-level cache system WO2024066613A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211190657.XA CN115328820B (en) 2022-09-28 2022-09-28 Access method of multi-level cache system, data storage method and device
CN202211190657.X 2022-09-28

Publications (1)

Publication Number Publication Date
WO2024066613A1 true WO2024066613A1 (en) 2024-04-04

Family

ID=83913860

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104895 WO2024066613A1 (en) 2022-09-28 2023-06-30 Access method and apparatus and data storage method and apparatus for multi-level cache system

Country Status (2)

Country Link
CN (1) CN115328820B (en)
WO (1) WO2024066613A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115328820B (en) * 2022-09-28 2022-12-20 北京微核芯科技有限公司 Access method of multi-level cache system, data storage method and device
CN117472802B (en) * 2023-12-28 2024-03-29 北京微核芯科技有限公司 Cache access method, processor, electronic device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181490A1 (en) * 2016-12-27 2018-06-28 Eta Scale Ab System and method for self-invalidation, self-downgrade cachecoherence protocols
CN112416615A (en) * 2020-11-05 2021-02-26 珠海格力电器股份有限公司 Multi-core processor, method and device for realizing cache consistency of multi-core processor and storage medium
CN113342709A (en) * 2021-06-04 2021-09-03 海光信息技术股份有限公司 Method for accessing data in a multiprocessor system and multiprocessor system
CN114036084A (en) * 2021-11-17 2022-02-11 海光信息技术股份有限公司 Data access method, shared cache, chip system and electronic equipment
CN115328820A (en) * 2022-09-28 2022-11-11 北京微核芯科技有限公司 Access method of multi-level cache system, data storage method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8271898B1 (en) * 2009-06-04 2012-09-18 Mellmo Inc. Predictive scrolling
CN103955435B (en) * 2014-04-09 2017-01-11 上海理工大学 Method for establishing access by fusing multiple levels of cache directories
CN104317736B (en) * 2014-09-28 2017-09-01 曙光信息产业股份有限公司 A kind of distributed file system multi-level buffer implementation method
CN105677580B (en) * 2015-12-30 2019-04-12 杭州华为数字技术有限公司 The method and apparatus of access cache

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181490A1 (en) * 2016-12-27 2018-06-28 Eta Scale Ab System and method for self-invalidation, self-downgrade cachecoherence protocols
CN112416615A (en) * 2020-11-05 2021-02-26 珠海格力电器股份有限公司 Multi-core processor, method and device for realizing cache consistency of multi-core processor and storage medium
CN113342709A (en) * 2021-06-04 2021-09-03 海光信息技术股份有限公司 Method for accessing data in a multiprocessor system and multiprocessor system
CN114036084A (en) * 2021-11-17 2022-02-11 海光信息技术股份有限公司 Data access method, shared cache, chip system and electronic equipment
CN115328820A (en) * 2022-09-28 2022-11-11 北京微核芯科技有限公司 Access method of multi-level cache system, data storage method and device

Also Published As

Publication number Publication date
CN115328820A (en) 2022-11-11
CN115328820B (en) 2022-12-20

Similar Documents

Publication Publication Date Title
WO2024066613A1 (en) Access method and apparatus and data storage method and apparatus for multi-level cache system
KR102193689B1 (en) Systems and methods for efficient cache line handling based on predictions
US8307149B2 (en) Nonvolatile memory device including a logical-to-physical logig-to-physical address conversion table, a temporary block and a temporary table
KR100389867B1 (en) Flash memory management method
US7761655B2 (en) Storage system and method of preventing deterioration of write performance in storage system
US6901483B2 (en) Prioritizing and locking removed and subsequently reloaded cache lines
US8745334B2 (en) Sectored cache replacement algorithm for reducing memory writebacks
US8291175B2 (en) Processor-bus attached flash main-memory module
CN110321301B (en) Data processing method and device
CN106201335B (en) Storage system
JP2017151982A (en) System and method for caching in data storage subsystem
WO2013123855A1 (en) Read-write control method for memory, and corresponding memory and server
JP3866447B2 (en) Directory entry allocation system and method for use in multiprocessor node data processing system
KR101779174B1 (en) Data discard method for journaling filesystem and memory management apparatus thereof
CN107341114B (en) Directory management method, node controller and system
US8977816B2 (en) Cache and disk management method, and a controller using the method
CN111488125A (en) Cache Tier Cache optimization method based on Ceph cluster
KR20110046118A (en) Adaptive logging apparatus and method
CN111443874B (en) Solid-state disk memory cache management method and device based on content awareness and solid-state disk
US6298419B1 (en) Protocol for software distributed shared memory with memory scaling
CN110968266B (en) Storage management method and system based on heat degree
KR102220468B1 (en) Preemptive cache post-recording with transaction support
CN116755625A (en) Data processing method, device, equipment and readable storage medium
US7979638B2 (en) Method and system for accessing data using an asymmetric cache device
KR20040056308A (en) RAID control system for Sharing Logical Disk Units by Multiple RAID Controllers