WO2015014302A1 - 基于多级缓存的数据读/写方法、装置和计算机系统 - Google Patents

基于多级缓存的数据读/写方法、装置和计算机系统 Download PDF

Info

Publication number
WO2015014302A1
WO2015014302A1 PCT/CN2014/083467 CN2014083467W WO2015014302A1 WO 2015014302 A1 WO2015014302 A1 WO 2015014302A1 CN 2014083467 W CN2014083467 W CN 2014083467W WO 2015014302 A1 WO2015014302 A1 WO 2015014302A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
physical memory
data block
level
data
Prior art date
Application number
PCT/CN2014/083467
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP14832818.0A priority Critical patent/EP3029575A4/en
Publication of WO2015014302A1 publication Critical patent/WO2015014302A1/zh
Priority to US15/010,376 priority patent/US9864696B2/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/0893Caches characterised by their organisation or structure
    • G06F12/0897Caches characterised by their organisation or structure with two or more cache hierarchy levels
    • 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/10Address translation
    • G06F12/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/50Control mechanisms for virtual memory, cache or TLB
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory

Definitions

  • the present invention relates to the field of data reading and writing of computer systems, and more particularly to a data reading/writing method, apparatus and computer system based on multi-level cache.
  • Cache also known as cache
  • CPU central processing unit
  • Memory memory
  • the computer uses a three-level Cache structure, in which L1 (Level 1) uses a high-speed and small-capacity Cache, L2 (Level 2) uses a medium-capacity Cache, and L3 (Level 3) uses a low-speed and large-capacity Cache. Cache.
  • the specific process of the CPU performing the read operation in the prior art is as follows:
  • the system searches for the data by using the layer-by-layer lookup method. If the Cache misses (Cache miss ), go to the L2 Cache to find it, and so on, until the data is found.
  • Embodiments of the present invention provide a data read/write method, apparatus, and computer system based on multi-level cache, which help improve Cache access efficiency, thereby helping to reduce data read/write processes. Cache miss rate.
  • the present invention provides a data read/write method based on multi-level cache, including: acquiring a first query address of a first physical memory data block for which read/write data is directed;
  • the first cache location attribute is used to indicate a level at which the first physical memory data block can enter the cache
  • the first cache location attribute is the first physical memory data block in the page table cache TLB according to the accessed condition of the first physical memory data block.
  • the acquiring the first cache location attribute of the first physical memory data block includes:
  • the attribute information of the physical memory data block is stored in the TLB, including: physical memory The correspondence between the query address of the data block and the cache location attribute of the physical memory data block.
  • the first cache location attribute is set according to the accessed condition of the first physical memory data block, and is set in the system register for the first physical memory data block.
  • the acquiring the first cache location attribute of the first physical memory data block includes:
  • the cache location attribute stored in the current system register is read and used as the first cache location attribute of the first physical memory block; the system register is used to store the cache location attribute.
  • the reading/writing data of the first query address for the first physical memory data block in the hit cache includes: passing between the cache and the hit cache a direct data path for reading/writing data for a first query address of a first physical memory data block in the hit cache; or
  • the reading/writing data of the first query address for the first physical memory data block in the memory comprises: reading/writing to the first query address of the first physical memory data block in the memory by using a direct data path between the memory data.
  • the method further includes: at the cache level that the first cache location attribute indicates Backfilling the data that needs to be read to a level higher than the level of the hit cache; or,
  • the level of the hit cache is the highest level of the cache level indicated by the first cache location attribute, the data is not backfilled to other caches;
  • the method further includes: backfilling the data to be read back into the cache that can be entered by the first cache location attribute.
  • the method when writing data, the first query for the first physical memory data block in the hit cache After the address is written, the method further includes:
  • a shared data consistency request is initiated to other caches having a level equal to and/or lower than the level of the hit cache.
  • the first cache location attribute identifies that the first physical memory data block can enter the highest of the cache levels. Level, or a level of cache that identifies the first physical memory block that cannot be entered.
  • the present invention provides a data read/write device based on a multi-level cache, where the device is a central processing unit including a multi-level cache, and includes:
  • a first acquiring unit configured to acquire a first query address of the first physical memory data block for which the read/write data is directed;
  • a second acquiring unit configured to acquire a first cache location attribute of the first physical memory data block; the first cache location attribute is used to indicate a level at which the first physical memory data block can enter the cache;
  • the cache level that the first physical memory data block can enter according to the first cache location attribute obtained by the second obtaining unit is high. In the low order, query whether the cache hits until a cache hit or all caches are missed;
  • a read/write unit configured to: if a cache hit, read/write data to a first query address of the first physical memory data block in the cache that is hit by the query unit; or, if the query result of the query unit is all If the cache misses, the data is read/written for the first query address of the first physical memory data block in the memory.
  • the first cache location attribute is the first physical memory data block in the page table cache TLB according to the accessed condition of the first physical memory data block.
  • the second obtaining unit is configured to query, according to the attribute information of the physical memory data block stored in the TLB, the first cache location attribute corresponding to the first query address; the attribute information of the physical memory data block is stored in the TLB , including: the correspondence between the query address of the physical memory data block and the cache location attribute of the physical memory data block.
  • the first cache location attribute is set according to the accessed condition of the first physical memory data block, and is set in the system register for the first physical memory data block.
  • the second obtaining unit is configured to read a cache location attribute stored in a current system register, and serve as a first cache location attribute of the first physical memory data block; the system register is configured to store a cache location attribute.
  • the read/write unit is configured to: use, by using a direct data path with the hit cache, a first query for the first physical memory data block in the hit cache Address read/write data; or, the read/write unit is configured to read/write data to the first query address of the first physical memory data block in the memory through a direct data path with the memory
  • level of the hit cache is a non-highest level in the cache level that the first cache location attribute indicates, in the cache level that the first cache location attribute indicates, it will need to be read. Data is backfilled into a cache at a level higher than the level of the hit cache; or,
  • the level of the hit cache is the highest level of the cache level indicated by the first cache location attribute, the data is not backfilled to other caches;
  • the data to be read is backfilled into the cache that can be entered by the first cache location attribute.
  • the read/write unit is further configured to: when writing data, if the written data is shared data And, in the cache level that can be entered by the first cache location attribute, initiate a shared data consistency request to other caches having a level equal to and/or lower than the level of the hit cache.
  • the first cache location attribute identifies that the first physical memory data block can enter the highest cache level. Level, or a level of cache that identifies the first physical memory block that cannot be entered.
  • the invention provides a computer system comprising: a memory and the apparatus described above.
  • the data read/write method, device and computer system based on multi-level cache provided by the embodiment of the present invention can enter the cache level by the physical memory data block indicated by the cache location attribute, and can enter according to the indication thereof. Whether the level query cache is hit, can support the need to pass without access
  • Cache which hits the cache faster, helps improve Cache access efficiency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the Cache miss rate during data read/write; especially for some low access frequencies.
  • the cache location attribute can be restricted to avoid entering a high-level cache where resources are scarce, thereby helping to reduce the cache miss rate during data read/write.
  • FIG. 1 is a schematic diagram of a data read/write method based on multi-level cache according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a computer system according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a method for data read operation based on multi-level cache according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of another method for data read operation based on multi-level cache according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a method for data write operation based on multi-level cache according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of another method for data write operation based on multi-level cache according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an apparatus for data read/write operations based on multi-level cache according to an embodiment of the present invention.
  • the present invention provides a data read/write method based on multi-level cache, and the execution body thereof may be a CPU Core in a CPU including a multi-level cache, or a read/write function in a CPU including a multi-level cache. hardware equipment.
  • the method can be applied to a single-core computer system, and can also be applied to a multi-core computer system. As shown in FIG. 1, the method includes:
  • the physical memory data block refers to a storage unit for storing data in the computer system. For example, it may be a memory page, a memory segment, or a direct source. I/O data information, etc.; the size of these storage units is not limited and may be equal or unequal.
  • the query address may be a high-order bit of a physical address (PA, Physical Address) of the physical memory data block, which is of course not limited thereto.
  • the related object in the process of reading/writing data once is preceded by "first".
  • the first physical memory data block refers to a physical memory data block that is targeted during a read/write data process
  • the first query address refers to the high order bit of the physical address of the first physical memory data block.
  • the CPU Core may include a TLB (Translation Lookaside Buffer) or a page table buffer; this step may be performed by obtaining the upper bits of the physical address in the read/write data process in the TLB.
  • TLB Translation Lookaside Buffer
  • page table buffer a page table buffer
  • TLB is not limited to being set in the CPU Core.
  • the step may specifically be: when the device for reading/writing data based on the multi-level cache in the CPU Core issues a data read/write request, the device gives a virtual address (VA, Virtual Address), using the VA
  • VA virtual address
  • the upper bits are searched in the TLB, and the TLB is responsible for converting the virtual address into the upper bits of the physical address of the physical memory block, thereby enabling the device to obtain the upper bits of the physical address.
  • the first cache location attribute is used to identify a level at which the first physical memory data block can enter a cache.
  • the first cache location attribute is set for the first physical memory data block according to the accessed condition of the first physical memory data block.
  • the above cache location attribute may be set for the physical memory data block according to the accessed condition of the physical memory data block.
  • the access condition of the physical memory data block may be, but is not limited to, the access frequency of the physical memory data block, and may also be according to the attributes of the data block itself, for example: streaming media data, which is largely only required to be accessed once. Can be discarded, so these data do not need to enter the high-level cache.
  • attribute information of all physical memory data blocks is usually stored in the memory, this embodiment A number of bits may be added to the original physical memory data block attribute information in the memory to identify the cache location attribute of each physical memory data block.
  • the physical memory data block attribute information includes: physical memory data block Corresponding relationship between the query address and the cache location attribute of the physical memory data block; the cache location attribute may be directly set by the operating system when dividing the data block according to the accessed condition of the physical memory data block.
  • the memory will fill in the attribute information of the cache location attribute into the space used by the TLB to store the attribute item.
  • the cache location attribute can be filled in. , you can fill in directly, otherwise, you can increase the width of the original space to fill in the cache location attribute.
  • this step may be: when the device for reading/writing data based on the multi-level cache in the CPU Core issues a data read/write request, according to the query address and physical of the physical memory data block stored in the TLB. And corresponding to the first cache location attribute corresponding to the first query address.
  • the cache location attribute may be set to a system register included in the CPU, that is, a system register is added to store the cache location attribute.
  • the cache location attribute register is set by a new instruction, or by adding some bits to the original instruction set.
  • the step may be: when the device based on the multi-level cache data read/write in the CPU Core initiates a data read/write request, reading the cache location attribute stored in the current system register, and as the The first cache location attribute of the first physical memory data block.
  • the first cache location attribute identifies that the first physical memory data block can enter the highest level in the cache level, or identifies a cache level that the first physical memory data block cannot enter.
  • the first level cache (LI Cache ), the second level cache ( L2 Cache ), and the third level cache ( L3 Cache ) can be represented by 00, 01, and 10 respectively. If the cache location attribute is 01, and the memory data block can only enter the L2 Cache, the memory data block may enter the L2 Cache or the L3 Cache, but may not enter the LI Cache. If the cache location attribute is 01, and the memory data block cannot enter the L2 Cache, correspondingly, the cache location attribute controls the level of the physical memory data block entering the cache, including LI Cache and L3. Cache.
  • the first cache location attribute of the first physical memory data block for which the read/write data is directed may be acquired first for step S101 and step S102. And then acquiring the first query address of the first physical memory data block; regardless of the acquisition manner, the first query address and the first cache location attribute of the first physical memory data block must be obtained.
  • level of level 1 cache is the highest, the level of level 1 cache is the lowest, and the level of cache between level 1 cache and level N cache is decremented.
  • the process of querying whether an i (1 i N ) level cache is hit according to the first query address may be: using a middle number of bits of the virtual address to search in the i level cache, and selecting a set of Cache Line tags (Tag), The tag may be a high-order bit of the physical address PA. Then, the first query address obtained by the TLB is compared with the selected set of tags. If a tag of the Cache Line can match the PA high-order bit, the i-level cache hits. Otherwise, the i-level cache misses.
  • the step may be:
  • the device for reading/writing data based on the multi-level cache in the CPU Core ignores the LI Cache according to the cache location attribute, and directly queries whether the L2 Cache hits. If the L2 cache hits, the query process ends here. If the L2 Cache is missing, the L3 Cache is queried. If the L3 Cache hits, the query process ends here. If the L3 Cache is missing, since the L3 Cache is the last level cache, it means that the first cache location attribute control If all caches are missed, the query process ends here.
  • the cache location attribute obtained in S102 is 01, and indicates that the memory data block cannot enter the L2 cache, and correspondingly, the cache location attribute controls the physical memory data block to enter.
  • the level of caching includes L1 and L3. At this point, this step has The device can read and write the data cache based on the multi-level cache in the CPU Core according to the cache location attribute. If the LI Cache hits, the query process ends here. If the L1 Cache misses, the query L3 Whether the Cache hits, because the L3 Cache is the last level of cache, so the L3 Cache hits or misses, the query process ends here.
  • step S104 If there is a cache hit in this step, proceed to step S104; if all the caches in this step are missed, proceed to step S105.
  • a direct data path of each level of the multi-level cache-based data read/write device cached in the CPU Core may be added in advance.
  • the step may be: directly between the device and the hit cache.
  • the data path reads/writes data for the first query address of the first physical memory data block in the hit cache.
  • this step can be used to complete the data read/write.
  • the data read/write method based on the multi-level cache can enter the cache level by the physical memory data block indicated by the cache location attribute, and query whether the cache hits according to the level that can be entered according to the indication. It can support faster access to the cache without accessing the cache, which helps to improve the cache access efficiency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the cache miss rate during data read/write. Especially for some physical memory data blocks with low access frequency, the cache location attribute can be restricted to avoid entering the high-level Cache with resource shortage, which helps to reduce the Cache miss rate in the data read/write process.
  • the method further includes: backfilling the data to be read to a level higher than the level of the hit cache in the cache level that the first cache location attribute indicates Or; if the level of the hit cache is the highest level of the cache level indicated by the first cache location attribute, the data is not backfilled to other caches; or, if all caches are missed, The method further includes: backfilling data that needs to be read into a cache that is accessible to the first cache location attribute.
  • the cache location attribute obtained in S102 is 01, and indicates that the memory data block can only enter the L2 Cache, that is, the L2 Cache is the first cache location.
  • step S103 If the cache hit in step S103 is L2 Cache, since the L2 Cache is the highest level that can be entered by the first cache location attribute, the data is not backfilled to other caches (for example, LI Cache ).
  • the device for reading/writing data based on the multi-level cache in the CPU Core may be in the first or the same time after the data is read in the first physical memory data block in the L3 Cache in S104. Under the level indicated by the cache location attribute to enter the cache, the data to be read is backfilled into the L2 Cache. In this way, when the data is read/written again for the first physical memory data block, the L2 Cache can be hit once.
  • the data read/write device based on the multi-level cache in the CPU Core may need to read the data after the data is read in S105 for the first physical memory data block in the memory. Backfilled into L3 Cache and L2 Cache. This makes it possible to hit the L2 Cache with one query during the next read of the data.
  • the application with low Cache miss rate can prevent the data with low access frequency from being transferred into the Cache with high miss rate, thus avoiding unnecessary Cache data backfill.
  • the method further includes: if the written data In order to share data, the access indicated by the first cache location attribute is entered. In the cache level, a shared data consistency request is initiated to other caches having a level equal to and/or below the level of the hit cache.
  • the shared data is in a cache structure of a multi-core processor. If one CPU Core modifies a certain data and the data is in another CPU Core cache, the data is between different CPU Cores. Share data.
  • CPU CoreO CPU CoreO
  • CPU Corel CPU Corel
  • the cache location attribute obtained in S102 is 01
  • the memory data block can only enter the L2 Cache, that is, the attribute indicated by the first cache location attribute
  • the cache levels that can be entered are: L2, L3.
  • step S103 If the cache hit in step S103 is L2 Cache, and the data written in step S104 is shared data, then (1) in the computer system, in addition to the hit L2 Cache, other L2 Cache is included.
  • the multi-level cache-based data read/write device in the CPU Core initiates a shared data consistency request to other L2 Caches and the L3 Cache; (2) in the case where the computer system does not include other L2 Caches, the device only The L3 Cache initiates a shared data consistency request.
  • step S103 If the cache hit in step S103 is L3 Cache, and the data written in step S104 is shared data, then (1) in the computer system, in addition to the hit L3 Cache, other L3 Cache is included.
  • the multi-level cache-based data read/write device in the CPU Core only initiates a shared data consistency request to other L3 Caches; (2) in the case where the computer system does not include other L3 Caches, the device does not initiate shared data. Consistency request.
  • the cache hit in step S103 is L2 Cache
  • the data written in step S104 is shared data
  • the multi-level cache-based data read/write device in the CPU Core is directed to other L2 Caches and The L3 Cache initiates a shared data consistency request. At this time, other L2 Caches and L3 Caches are all invalidated.
  • the other is the way of writing through, specifically, according to the above description, in the cache level that the first cache location attribute indicates, the level is equal to and/or lower than the level of the hit cache.
  • the shared data in the other caches whose level is equal to the hit cache level is invalidated, if the hit cache level is not in the cache level that the first cache location attribute indicates The lowest level, the shared data in the low-level cache is updated by the newly written data.
  • step S103 For example, if the cache hit by the above step S103 is L2 Cache, and the data written by step S104 is shared data, the device for reading/writing data based on multi-level cache in the CPU Core is directed to other L2 Caches and L3s.
  • the Cache initiates a shared data consistency request. At this time, the shared data in the other L2 Cache is invalidated, and the shared data in the L3 Cache is updated.
  • An embodiment of the present invention provides a computer system, including: a memory and a device for reading/writing data based on a multi-level cache, wherein the device is a CPU including a multi-level cache, and the device is configured to perform each step in the above method.
  • the present invention also provides a specific example of the above method of reading/writing data.
  • a dual-core computer system is taken as an example, and the dual-core computer system has three levels of cache.
  • the computer system includes:
  • LI Cache Three levels of caching: LI Cache, including I-Cache (Instructor-Cache), D-Cache (Date-Cache), L2 Cache, L3 Cache; Memory And CPU Core.
  • I-Cache Instructor-Cache
  • D-Cache Date-Cache
  • L2 Cache L2 Cache
  • L3 Cache Memory And CPU Core.
  • the computer system may further include TLB: I-TLB (Instructor-TLB, instruction bypass conversion cache), D-TLB (Date-TLB, Data Bypass Conversion Cache).
  • TLB is responsible for the specific L1, which uses the high-speed and small-capacity Cache, the L2 uses the medium-capacity Cache, the L3 uses the low-speed and large-capacity Cache, and the L1/L2 Cache is private to each CPU Core, and the L3 Cache is more CPU Core sharing.
  • the so-called private cache is private to a CPU Core, so shared cache is shared by multiple CPU Cores.
  • the L1 and L2 Caches in the dotted line are the private cache of the CPU CoreO, the LI in the lower half of Figure 2, the L2 Cache is the private cache of the CPU Corel, and the L3 Cache is the CPU CoreO and CPU Corel's shared cache.
  • the physical memory data block is used as an example of a memory page (age).
  • the attribute information of a memory page is stored in a page table, and the page table of all the memory pages is stored in the memory. .
  • the attribute information of the memory page may indicate whether the memory page is shared, whether it can be entered into the cache, or the like.
  • the attribute information of the memory page further includes cache location attribute information of the physical memory page, and the cache location attribute information is set according to the case where the physical memory page is accessed.
  • the data reading method based on the multi-level cache specifically includes the following steps:
  • Step 1 Set the cache location property of the memory page.
  • CAL Cache Access Level
  • the highest accessible cache level in the cache level is another 'where the CAL information can be set directly by the operating system when the page is allocated.
  • the page of the memory The table is shown in Figure 3.
  • the CAL information corresponding to the upper bit PA-1 of the physical address is "10”
  • the CAL information corresponding to the upper bit PA-2 of the physical address is "00”
  • the upper bit of the physical address PA-3 corresponds.
  • the CAL information is "01" and so on.
  • Step 2 The CPU Core fills the page table in the above memory into the TLB entry (entry), and uses the reserved bits in the TLB entry to identify the CAL information. If there is no reserved bit, the width of the TLB entry can be increased.
  • PA-3 is taken as an example in the present embodiment, only the corresponding page table of PA-3 is shown in the TLB entry of FIG. 3, and other page tables also exist in the TLB entry.
  • the above two steps can be performed during system initialization, or before a certain program is run, without performing data read/write each time.
  • Step 3 The multi-level cache-based data read/write device in the CPU Core queries the high-order bits of the physical address of the memory page and the C AL information.
  • the multi-level cache-based data read/write device in the CPU Core initiates a request to read data
  • the virtual address VA-3 is given, and the virtual address VA-3 is queried in the TLB.
  • the CAL information corresponding to the upper bit PA-3 of the corresponding physical address and the PA-3 is "01".
  • Step 4 According to the CAL information corresponding to PA-3 and PA-3, it is "01" to query whether the L2 Cache is hit.
  • the LI Cache since the CAL information "01" identifies that the highest cache level of the memory page can be entered into the L2 Cache, the LI Cache is ignored, and an access request is directly sent to the L2 Cache, and the high-order bit PA of the physical address is sent. 3. The higher bit PA-3 of the physical address is compared with the tag in the L2 Cache to obtain a result of whether the L2 Cache hits.
  • Step 5 Transfer the required data to the device based on the multi-level cache based data read/write in the CPU Core through the direct data path.
  • the data read operation method based on the multi-level cache provided by the embodiment of the present invention can enter the cache level by the physical memory data block indicated by the cache location attribute, so that the CPU Core can follow It indicates whether the level of the query cache that can be entered is hit, which helps to enhance the cache hit rate and helps to reduce the cache miss rate during the data read operation.
  • Embodiment 2 :
  • the L2 Cache miss in step 4 is provided, and an embodiment is provided.
  • the first four steps in the first embodiment can be referred to, and no further details are provided herein.
  • Step 5 The device for reading/writing data based on the multi-level cache in the CPU Core uses the high-order bit PA of the physical address— 3Query whether the next level L3 Cache hits.
  • the multi-level cache-based data read/write device in the CPU Core compares the high bit PA-3 of the physical address with the Tag in the L3 Cache to obtain a result of whether the L3 Cache hits.
  • step 6 If the L3 Cache hits, proceed to step 6. If the L3 Cache misses, proceed to step 7.
  • Step 6 If the L3 Cache hits, the data to be read is transmitted to the multi-level cache-based data read/write device in the CPU Core through the direct data path, and the data is refilled into the L2 Cache.
  • Step 7 If the L3 Cache is missing, the multi-level cache-based data read/write device in the CPU Core searches for the data to be read in the memory page corresponding to the memory PA-3, and transmits the data through the direct data path. Give the device back to the L2 Cache and L3 Cache at the same time.
  • the data read operation method based on the multi-level cache can enter the cache level by the physical memory data block indicated by the cache location attribute, and can query whether the cache hits according to the level that can be entered according to the indication. It can support faster access to the cache without accessing the cache, which helps to improve the cache access efficiency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the cache miss rate during data read operations; For some physical memory data blocks with low access frequency, the cache location attribute can be restricted to avoid entering the high-level cache with resource shortage, which helps to reduce the cache miss rate during data read operation, and avoids Unnecessary Cache data backfill.
  • Embodiment 3 Embodiment 3:
  • the same memory page cache location attribute setting as in the first embodiment is used, that is, the same page table. Therefore, in this embodiment, when the device for reading/writing data based on the multi-level cache in the CPU Core initiates a data write request, the first four steps may refer to the first four steps in the first embodiment. The only difference is that The request to read the data is changed to the request to write the data, and the rest is not described here. If the L2 Cache is hit in step 4, as shown in FIG. 5, the embodiment further includes:
  • Step 5 Write the data to the L2 Cache.
  • step 5 if the data written in step 5 is shared data, the following steps may be performed to maintain the consistency of the shared data.
  • Step 6 The multi-level cache-based data read/write device in the CPU Core initiates a shared data consistency request to the other L2 Caches and the L3 Cache.
  • the shared data in the L3 Cache and other CPU Core L2 Caches is invalidated; if the L2 Cache uses the write pass mode, the shared data of the L3 Cache is newly written. The data of the L2 Cache is updated, and the shared data in the L2 Cache of other CPU Cores is invalidated.
  • the data write operation method based on the multi-level cache can enter the cache level by the physical memory data block indicated by the cache location attribute, and query whether the cache hits according to the level that can be entered according to the indication. It can support faster access to the cache without accessing the cache, which helps to improve the cache hit efficiency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the cache miss rate during data write operations; especially for For some physical memory data blocks with low access frequency, you can limit the cache location attribute to avoid entering the high-level cache where resources are scarce, which helps to reduce the cache miss rate during data write operations. In other words, it is possible to initiate a consistency request for a Cache that may have shared data, which reduces the lookup and detection of the Cache.
  • Embodiment 4 is possible to initiate a consistency request for a Cache that may have shared data, which reduces the lookup and detection of the Cache.
  • the CAL information can also be set by means of an instruction, and a system register is set for the CAL information, and the CAL information is not stored in the page table and the TLB, that is, a system is added.
  • the register is used to store the cache location attribute so that data read/write can be performed through the cache location attribute information stored in the system register.
  • the embodiment provides a data write operation method based on multi-level cache, and the specific steps include:
  • Step 1 Apply a CAL register (CALR, Cache Access Level Register) in the system register file.
  • CALR CalR, Cache Access Level Register
  • the system registers include MIDR (Main ID Register), PAR (Physical Address Register), CALR, and so on.
  • Step 3 The device for reading/writing data based on the multi-level cache in the CPU Core queries the upper bits of the physical address of the memory page.
  • the multi-level cache based data read/write device in the CPU Core initiates a data write request and sends the virtual address VA-1 to the TLB.
  • the TLB is responsible for translating the virtual address sent by the device into the upper bits of the physical address.
  • the TLB stores the attribute information of the memory page, including:
  • the high-order bits of the physical address are PA-1, PA2, PA3, PA-4, etc., but do not contain CAL information.
  • the device uses the virtual address VA-1 to perform a lookup in the TLB to obtain the physical address high bit PA-1 corresponding to the virtual address VA-1.
  • Step 5 Write the data directly to the L2 Cache.
  • the consistency of the shared data may be maintained by referring to the method of writing back or writing in the third embodiment, and details are not described herein again.
  • the physical memory data block indicated by the cache location attribute can enter the cache level, and can enter according to the indication thereof.
  • the level query cache is hit, can support the Cache that does not need to access, and hits the cache faster, which helps to improve the Cache access efficiency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the data write operation.
  • Cache miss rate especially for some physical memory data blocks with low access frequency, you can limit the cache location attribute to avoid entering the high-level Cache with resource shortage, which helps to reduce the cache miss during data write operation. rate.
  • the embodiment of the present invention further provides a multi-level cache based read/write device, which may be a functional module of the CPU Core, and each functional module in the device corresponds to the steps in the above method, and is not performed here. A detailed description.
  • the device 70 includes:
  • a first obtaining unit 701 configured to acquire a first query address of the first physical memory data block for which the read/write data is directed;
  • a second acquiring unit 702 configured to acquire a first cache location attribute of the first physical memory data block, where the first cache location attribute is used to indicate a level at which the first physical memory data block can enter a cache;
  • the query unit 703 according to the first query address obtained by the first obtaining unit 701, according to the cache level that the first physical memory data block indicated by the first cache location attribute obtained by the second obtaining unit 702 can enter High to low order, in turn, query whether the cache hits, until a cache Hit or all cache misses;
  • the reading and writing unit 704 is configured to: if a cache hit, read/write data to the first query address of the first physical memory data block in the cache that is hit by the query unit 703; or, if the query of the query unit 703 As a result, if all caches are missed, the data is read/written for the first query address of the first physical memory data block in memory.
  • the first cache location attribute is set for the first physical memory data block in the page table cache TLB according to the accessed condition of the first physical memory data block;
  • the second obtaining unit 702 is configured to query, according to the attribute information of the physical memory data block stored in the TLB, the first cache location attribute corresponding to the first query address; the attribute of the physical memory data block is stored in the TLB Information, including: the correspondence between the query address of the physical memory data block and the cache location attribute of the physical memory data block.
  • the first cache location attribute is set in the system register for the first physical memory data block according to the accessed condition of the first physical memory data block;
  • the second obtaining unit 702 is configured to read a cache location attribute stored in a current system register, and serve as a first cache location attribute of the first physical memory data block; the system register is configured to store a cache location attribute .
  • the reading and writing unit 704 is configured to read/write data by using a direct data path between the device 70 and the hit cache for the first query address of the first physical memory data block in the hit cache; or And for reading/writing data by using a direct data path between the device 70 and the memory for a first query address of the first physical memory data block in the memory.
  • the read/write unit 704 is further configured to: when reading data,
  • level of the hit cache is a non-highest level in the cache level that the first cache location attribute indicates, in the cache level that the first cache location attribute indicates, it will need to be read. Data is backfilled into a cache at a level higher than the level of the hit cache; or,
  • the level of the hit cache is the highest level of the cache level indicated by the first cache location attribute, the data is not backfilled to other caches;
  • the data to be read back is backfilled to the first cache location attribute. Indicates the cache that can be entered.
  • the read/write unit 704 is further configured to: when the data is written, if the written data is shared data, in the cache level that the first cache location attribute indicates, the level is equal to and / or other caches below the level of the hit cache to initiate a shared data consistency request.
  • the first cache location attribute identifies a highest level of the first physical memory data block that can enter the cache level, or identifies a cache level that the first physical memory data block cannot enter.
  • the device provided by the embodiment of the present invention can enter the cache level by the physical memory data block indicated by the cache location attribute, so that the query unit in the device can query whether the cache hits according to the level of the indicated entry level, and can support the need to bypass Cache access, faster hit cache, which helps to increase the cache access frequency, which in turn helps to enhance the cache hit rate. In other words, it helps to reduce the cache miss rate during data read/write; especially for some access frequencies.
  • the cache location attribute can be restricted from entering a high-level cache where resources are scarce, thereby helping to reduce the cache miss rate during data read/write.
  • the present invention also provides a computer system, the system comprising: a processor and a memory coupled to the processor;
  • the memory may be a memory, and a set of program codes is stored in the memory, and the processor is configured to invoke program code stored in the memory, where the program code is used to implement any of the above-mentioned multi-level based Cached data read/write method.
  • the processor is configured to invoke the multi-level cache-based data read/write program code to obtain a first query address of a first physical memory data block for which read/write data is directed; and acquire the first physical memory data a first cache location attribute of the block; the first cache location attribute is used to indicate a level at which the first physical memory data block can enter a cache; according to the first query address, according to the first cache location attribute Instructing the first physical memory data block to enter a cache level in descending order to query whether the cache hits until a cache hit or all cache misses; if a cache hit, then for the hit cache The first physical memory data block reads/writes data; or, if all caches are missed, reads/writes data for the first physical memory data block in the memory.
  • the processor is further configured to invoke the multi-level cache-based data read/write program code, according to the accessed condition of the first physical memory data block, in the page table cache TLB, the first Setting the physical memory data block; querying the first cache location attribute corresponding to the first query address according to the attribute information of the physical memory data block stored in the page table cache; and storing the physical memory data block in the TLB
  • the attribute information includes: a query address of the physical memory data block, and a corresponding relationship of the cache location attribute of the physical memory data block.
  • the processor is further configured to invoke the multi-level cache-based data read/write program code, where the first physical memory is in the system register according to the accessed condition of the first physical memory data block.
  • the data block is set; the cache location attribute stored in the current system register is read and used as the first cache location attribute of the first physical memory data block; the system register is used to store the cache location attribute.
  • the processor is further configured to invoke the multi-level cache-based data read/write program code, by using a direct data path between the hit cache, and the first physical memory data block in the hit cache.
  • the first query address reads/writes data; or, by means of a direct data path with the memory, reads/writes data for the first query address of the first physical memory data block in the memory.
  • the processor is further configured to invoke the multi-level cache-based data read program code, if the level of the hit cache is a non-highest level in the cache level indicated by the first cache location attribute
  • the method further includes: backfilling, to the cache level that the first cache location attribute indicates, the data to be read back to a cache whose level is higher than the level of the hit cache; or, if the cache is hit
  • the level of the first cache location attribute indicates the highest level of the cache level that can be entered, and the data is not backfilled to other caches; or, if all the caches are missed, the method further includes: The data is backfilled into the cache that can be entered by the first cache location attribute.
  • the processor is further configured to invoke the program code of the data writing based on the multi-level cache, and if the written data is shared data, the cache level that can be entered in the first cache location attribute Initiating a shared data consistency request to other caches of a level equal to and/or below the level of the hit cache.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the components displayed for the unit may or may not be physical units, ie may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the above software functional units are stored in a storage medium and include a number of instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform some of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. Medium.

Landscapes

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

Abstract

一种基于多级缓存的数据读/写方法、装置和计算机系统,涉及计算机系统的数据读写领域,用以在数据读/写过程中提高Cache访问效率。所述方法包括:获取读/写数据所针对的第一物理内存数据块的第一査询地址;获取第一物理内存数据块的第一缓存位置属性;根据第一査询地址,按照第一缓存位置属性所指示的第一物理内存数据块所能进入的缓存级别从高到低的顺序依次査询缓存是否命中,直至一个缓存命中或所有缓存均未命中为止;若一个缓存命中,则针对所命中缓存中的第一物理内存数据块的第一査询地址读/写数据;或,若所有缓存均未命中,则针对内存中的第一物理内存数据块的第一査询地址读/写数据。

Description

基于多级緩存的数据读 /写方法、 装置和计算机系统 本申请要求于 2013 年 7 月 31 日提交中国专利局、 申请号为 201310331344.6、 发明名称为"基于多级緩存的数据读 /写方法、 装置和计算机 系统"的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机系统的数据读写领域, 尤其涉及一种基于多级緩存的 数据读 /写方法、 装置和计算机系统。
背景技术
緩存 ( Cache, 也称为高速緩冲存储器)位于中央处理器(CPU, Central Processing Unit )和内存( Memory )之间, 主要是为了解决 CPU运算速度和 内存读写速度不匹配的问题。 目前计算机最多釆用三级 Cache结构, 其中 L1 ( Level 1 )釆用高速小容量的 Cache, L2(Level 2)釆用速度中等容量较大的 Cache, L3(Level 3)釆用低速大容量的 Cache。
基于上述的多级 Cache, 现有技术中 CPU执行读操作的具体过程如下: 当 CPU Core ( CPU核)在发出读数据请求时, 通过逐层查找的方式, 即 先从 LI Cache开始查找数据, 如果 Cache未命中 ( Cache miss ), 去 L2 Cache 中查找, 依次类推, 直至查找到数据为止。
在上述的过程中, 通常需要经过多次查找方可命中, 例如假如读操作针 对的数据存储在 L3 Cache中, 这样必须在 LI Cache和 L2 Cache均未命中的 情况下才会到 L3 Cache查找数据, 从而导致 Cache访问效率比较低。
发明内容
本发明的实施例提供了一种基于多级緩存的数据读 /写方法、 装置和计算 机系统, 有助于提高 Cache 访问效率, 进而有助于在数据读 /写过程中降低 Cache缺失率。
为达到上述目的, 本发明的实施例釆用如下技术方案:
第一方面, 本发明提供了一种基于多级緩存的数据读 /写方法, 包括: 获取读 /写数据所针对的第一物理内存数据块的第一查询地址;
获取所述第一物理内存数据块的第一緩存位置属性; 所述第一緩存位置 属性用于指示第一物理内存数据块所能进入緩存的级别;
根据所述第一查询地址, 按照所述第一緩存位置属性所指示的第一物理 内存数据块所能进入的緩存级别从高到低的顺序依次查询緩存是否命中, 直 至一个緩存命中或所有緩存均未命中为止;
若一个緩存命中, 则针对所命中緩存中的第一物理内存数据块的第一查 询地址读 /写数据; 或, 若所有緩存均未命中, 则针对内存中的第一物理内存 数据块的第一查询地址读 /写数据。
在第一种可能的实现方式中, 根据第一方面, 所述第一緩存位置属性为 根据第一物理内存数据块的被访问情况, 在页表緩存 TLB中为所述第一物理 内存数据块所设定的;
所述获取所述第一物理内存数据块的第一緩存位置属性包括:
根据页表緩存 TLB中存储的物理内存数据块的属性信息, 查询所述第一 查询地址对应的第一緩存位置属性; 所述 TLB中存储有物理内存数据块的属 性信息, 其中包括: 物理内存数据块的查询地址、 物理内存数据块的緩存位 置属性的对应关系。
在第二种可能的实现方式中, 根据第一方面, 所述第一緩存位置属性为 根据第一物理内存数据块的被访问情况, 在系统寄存器中为所述第一物理内 存数据块所设定的;
所述获取所述第一物理内存数据块的第一緩存位置属性包括:
读取当前系统寄存器中存储的緩存位置属性, 并其作为所述第一物理内 存数据块的第一緩存位置属性; 所述系统寄存器用于存储緩存位置属性。
在第三种可能的实现方式中, 根据第一方面, 所述针对所命中緩存中的 第一物理内存数据块的第一查询地址读 /写数据包括: 通过与所命中緩存间的 直接数据通路, 针对所命中緩存中的第一物理内存数据块的第一查询地址读 / 写数据; 或者,
所述针对内存中的第一物理内存数据块的第一查询地址读 /写数据包括: 通过与内存间的直接数据通路, 针对内存中的第一物理内存数据块的第一查 询地址读 /写数据。
在第四种可能的实现方式中, 结合第一方面或前三种可能的实现方式中 的任一种, 在读数据时,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的非最高级别, 则所述方法还包括: 在所述第一緩存位置属性指示的所能 进入的緩存级别中, 将需要读的数据回填到级别高于所命中緩存的级别的緩 存; 或者,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的最高级别, 则不向其他緩存回填数据; 或者,
若所有緩存均未命中, 则所述方法还包括: 将需要读的数据回填到所述 第一緩存位置属性指示的所能进入的緩存中。
在第五种可能的实现方式中, 结合第一方面或前三种可能的实现方式中 的任一种, 在写数据时, 在针对所命中緩存中的第一物理内存数据块的第一 查询地址写数据之后, 所述方法还包括:
若所写的数据为共享数据, 则在所述第一緩存位置属性指示的所能进入 的緩存级别中, 向级别等于和 /或低于所命中緩存的级别的其他緩存发起共享 数据一致性请求。
在第六种可能的实现方式中, 结合第一方面或前五种可能的实现方式中 的任一种, 所述第一緩存位置属性标识第一物理内存数据块所能进入緩存级 别中的最高级别, 或者标识第一物理内存数据块不能进入的緩存级别。
第二方面, 本发明提供了一种基于多级緩存的数据读 /写装置, 所述装置 为包括多级緩存的中央处理器, 包括:
第一获取单元, 用于获取读 /写数据所针对的第一物理内存数据块的第一 查询地址; 第二获取单元, 用于获取所述第一物理内存数据块的第一緩存位置属性; 所述第一緩存位置属性用于指示第一物理内存数据块所能进入緩存的级别; 查询单元, 用于根据所述第一获取单元得到的所述第一查询地址, 按照 第二获取单元得到的所述第一緩存位置属性所指示的所述第一物理内存数据 块所能进入的緩存级别从高到低的顺序依次查询緩存是否命中, 直至一个緩 存命中或所有緩存均未命中为止;
读写单元, 用于若一个緩存命中, 则针对所述查询单元所命中緩存中的 第一物理内存数据块的第一查询地址读 /写数据; 或, 若所述查询单元的查询 结果为所有緩存均未命中, 则针对内存中的第一物理内存数据块的第一查询 地址读 /写数据。
在第一种可能的实现方式中, 根据第二方面, 所述第一緩存位置属性为 根据第一物理内存数据块的被访问情况, 在页表緩存 TLB中为所述第一物理 内存数据块所设定的;
所述第二获取单元,用于根据 TLB中存储的物理内存数据块的属性信息, 查询所述第一查询地址对应的第一緩存位置属性; 所述 TLB中存储有物理内 存数据块的属性信息, 其中包括: 物理内存数据块的查询地址、 物理内存数 据块的緩存位置属性的对应关系。
在第二种可能的实现方式中, 根据第二方面, 所述第一緩存位置属性为 根据第一物理内存数据块的被访问情况, 在系统寄存器中为所述第一物理内 存数据块所设定的;
所述第二获取单元, 用于读取当前系统寄存器中存储的緩存位置属性, 并其作为所述第一物理内存数据块的第一緩存位置属性; 所述系统寄存器用 于存储緩存位置属性。
在第三种可能的实现方式中, 根据第二方面, 所述读写单元, 用于通过 与所命中緩存间的直接数据通路, 针对所命中緩存中的第一物理内存数据块 的第一查询地址读 /写数据; 或者, 所述读写单元用于通过与内存间的直接数 据通路, 针对内存中的第一物理内存数据块的第一查询地址读 /写数据
在第四种可能的实现方式中, 结合第二方面或前三种可能实现的方式中 的任一种, 所述读写单元, 还用于在读数据时,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的非最高级别 , 则在所述第一緩存位置属性指示的所能进入的緩存级别中 , 将需要读的数据回填到级别高于所命中緩存的级别的緩存中; 或者,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的最高级别, 则不向其他緩存回填数据; 或者,
若所有緩存均未命中, 则将需要读的数据回填到所述第一緩存位置属性 指示的所能进入的緩存中。
在第五种可能的实现方式中, 结合第二方面或前三种可能实现的方式中 的任一种, 所述读写单元, 还用于在写数据时, 若所写的数据为共享数据, 则在所述第一緩存位置属性指示的所能进入的緩存级别中 , 向级别等于和 /或 低于所命中緩存的级别的其他緩存发起共享数据一致性请求。
在第六种可能的实现方式中, 结合第二方面或前五种可能实现的方式中 的任一种, 所述第一緩存位置属性标识第一物理内存数据块所能进入緩存级 别中的最高级别, 或者标识第一物理内存数据块不能进入的緩存级别。
第三方面, 本发明提供了一种计算机系统, 包括: 内存以及上述的所述 装置。
本发明实施例提供的一种基于多级緩存的数据读 /写方法、 装置和计算机 系统, 通过緩存位置属性指示的物理内存数据块所能进入緩存的级别, 并按 照其指示的所能进入的级别查询緩存是否命中, 能够支持越过无需访问的
Cache, 较快地命中緩存, 从而有助于提高 Cache访问效率, 进而有助于增强 Cache命中率, 换言之, 有助于在数据读 /写过程中降低 Cache缺失率; 尤其 对于一些访问频率低的物理内存数据块而言, 可以通过对緩存位置属性的限 定, 避免其进入资源紧缺的高级别緩存, 进而有助于在数据读 /写过程中降低 Cache缺失率。
附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例或现有技 术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图 仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造 性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种基于多级緩存的数据读 /写方法的示意图; 图 2为本发明实施例提供的一种计算机系统结构示意图;
图 3为本发明实施例提供的一种基于多级緩存的数据读操作的方法示意 图;
图 4为本发明实施例提供的另一种基于多级緩存的数据读操作的方法示 意图;
图 5为本发明实施例提供的一种基于多级緩存的数据写操作的方法示意 图;
图 6为本发明实施例提供的另一种基于多级緩存的数据写操作的方法示 意图;
图 7为本发明实施例提供的一种基于多级緩存的数据读 /写操作的装置的 结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例 , 都属于本发明保护的范围。
本发明提供了一种基于多级緩存的数据读 /写方法, 其执行主体可以为包 含多级緩存的 CPU中的 CPU Core, 也可以为包含多级緩存的 CPU中的具有 读 /写功能的硬件设备。 所述方法可以适用于单核计算机系统, 也可以适用于 多核计算机系统, 如图 1所示, 包括:
S101、 获取读 /写数据所针对的第一物理内存数据块的第一查询地址。 其中, 所述物理内存数据块是指在计算机系统中, 将内存分成的若干用 于存储数据的存储单元, 示例的, 可以是内存页、 内存段、 或者是直接来自 I/O的数据信息等; 这些存储单元的大小没有限定, 可以相等或不等。 所述查 询地址可以为物理内存数据块的物理地址( PA , Physical Address ) 的高位比 特, 当然不限于此。
为了清楚描述, 本发明实施例中, 将一次读 /写数据过程中相关的对象前 加 "第一" 。 例如, 第一物理内存数据块是指在一次读 /写数据过程中所针对 的物理内存数据块, 第一查询地址是指第一物理内存数据块的物理地址的高 位比特。
示例的, CPU Core中可以包含 TLB ( Translation Lookaside Buffer, 旁路 转换緩冲或页表緩存); 此步骤可以是, 通过在 TLB中得到一次读 /写数据过 程中的物理地址的高位比特。 但 TLB不限于设置在 CPU Core中。
此步骤具体可以为: 当 CPU Core中的基于多级緩存的数据读 /写的装置 在发出一次数据读 /写请求时, 该装置会给出一个虚拟地址 (VA, Virtual Address ) , 用该 VA的高位若干比特去 TLB中进行查找, TLB负责将虚拟地 址转化为物理内存数据块的物理地址的高位比特, 从而使得该装置得到物理 地址的高位比特。
S102、 获取所述第一物理内存数据块的第一緩存位置属性; 所述第一緩 存位置属性用于标识所述第一物理内存数据块所能进入緩存的级别。
其中, 所述第一緩存位置属性为根据所述第一物理内存数据块的被访问 情况, 为所述第一物理内存数据块所设定的。
一般而言, 访问频率较高的物理内存数据块存在于高级别的緩存中, 访 问频率较低的物理内存数据块存在于低级别的緩存中。 为合理设置緩存位置 属性, 上述緩存位置属性可以为根据物理内存数据块的被访问情况, 为该物 理内存数据块所设定的。 其中, 物理内存数据块的被访问情况可以但不限于 物理内存数据块的访问频率, 还可根据该数据块本身的属性, 例如: 流媒体 数据, 这些数据很大程度上是只需要访问一遍就可以被丟弃的, 所以这些数 据也不需要进入高级别的緩存中。
可选的, 通常内存中存储有所有物理内存数据块的属性信息, 本实施例 可以在内存中的原有的物理内存数据块属性信息中添加若干比特, 用此来标 识各物理内存数据块的緩存位置属性, 此时, 物理内存数据块的属性信息中 包括: 物理内存数据块的查询地址、 物理内存数据块的緩存位置属性的对应 关系; 该緩存位置属性可以根据物理内存数据块的被访问情况, 由操作系统 在划分数据块的时候直接设定。 另外, 内存会将添加了緩存位置属性的属性 信息填入 TLB用于存储属性项的空间中, 可选的, 若 TLB原有空间存在保留 比特(未被占用的比特) 能够填入緩存位置属性, 则直接填入即可, 否则, 可以增加原有空间的宽度用以填入緩存位置属性。
此时, 此步骤可以为: 当 CPU Core中的基于多级緩存的数据读 /写的装 置在发出一次数据读 /写请求时,根据所述 TLB中存储的物理内存数据块的查 询地址和物理内存数据块属性信息的对应关系, 查询所述第一查询地址对应 的第一緩存位置属性。
或者可选的, 本发明实施例还可以为将緩存位置属性设置为 CPU所包含 的系统寄存器, 也就是说, 增设一系统寄存器用于存储緩存位置属性。 通过 一条新增的指令, 或者在原指令集中添加一些比特专门来对緩存位置属性寄 存器进行设置。
此时, 此步骤可以为: 当 CPU Core中的基于多级緩存的数据读 /写的装 置发起一次数据读 /写请求时, 读取当前系统寄存器中存储的緩存位置属性, 并其作为所述第一物理内存数据块的第一緩存位置属性。
进一步的, 所述第一緩存位置属性标识第一物理内存数据块所能进入緩 存级别中的最高级别, 或者标识第一物理内存数据块不能进入的緩存级别。
例如, 假定计算机系统中的共有三级緩存, 为了区分可以分别用 00、 01、 10表示一级緩存 ( LI Cache )、二级緩存 ( L2 Cache )、三级緩存 ( L3 Cache )。 若所述緩存位置属性为 01 , 且表示该内存数据块最高只能进入 L2 Cache, 即 该内存数据块可能进入 L2 Cache或者 L3 Cache, 但是不能进入 LI Cache。 若 所述緩存位置属性为 01 , 且表示该内存数据块不能进入 L2 Cache, 相应的, 该緩存位置属性控制物理内存数据块进入緩存的级别包括 LI Cache 和 L3 Cache。
由于第一物理内存数据块与其第一緩存位置属性是一一对应的关系, 则 对于步骤 S101和步骤 S102, 可以先获取读 /写数据所针对的第一物理内存数 据块的第一緩存位置属性, 然后再获取所述第一物理内存数据块的第一查询 地址; 无论釆取怎样的获取方式, 都必须获取得到第一物理内存数据块的第 一查询地址和第一緩存位置属性。
S103、 根据所述第一查询地址, 按照所述第一緩存位置属性所指示的第 一物理内存数据块所能进入的緩存级别从高到低的顺序依次查询緩存是否命 中, 直至一个緩存命中或所有緩存均未命中为止。
对于具有 N级緩存的计算机系统而言, 一级緩存的级别最高, N级緩存 的级别最低, 一级緩存到 N级緩存之间的緩存级别递减。
根据第一查询地址查询一个 i ( 1 i N )级緩存是否命中的过程可以为: 利用虚拟地址的中间若干比特到该 i级緩存中查找,选出一组 Cache Line的标 签(Tag ) , 该 Tag可以是物理地址 PA的高位比特; 然后将 TLB得到的第一 查询地址和选出的一组 Tag进行比较, 若某条 Cache Line的 Tag能和 PA高 位比特匹配上, 则该 i级緩存命中, 否则, 则该 i级緩存未命中。
示例的, 假定计算机系统中的共有三级緩存, S102中获取的所述緩存位 置属性为 01 , 且表示该内存数据块最高只能进入 L2 Cache。 此时, 此步骤具 体可以为: CPU Core中的基于多级緩存的数据读 /写的装置按照緩存位置属性 忽略 LI Cache, 直接查询 L2 Cache是否命中, 若 L2 Cache命中, 则查询过程 到此为止, 若 L2 Cache未命中, 则查询 L3 Cache是否命中; 若 L3 Cache命 中, 则查询过程到此为止, 若 L3 Cache未命中, 由于 L3 Cache是最后一级緩 存, 则意味着第一緩存位置属性控制进入所有緩存均未命中, 则查询过程也 到此为止。
又示例的, 假定计算机系统中的共有三级緩存, S102中获取的所述緩存 位置属性为 01 , 且表示该内存数据块不能进入 L2 Cache, 相应的, 该緩存位 置属性控制物理内存数据块进入緩存的级别包括 L1 和 L3。 此时, 此步骤具 体可以为 CPU Core中的基于多级緩存的数据读 /写的装置按照緩存位置属性 先查询 LI Cache是否命中, 若 LI Cache命中, 则查询过程到此为止, 若 L1 Cache未命中, 则查询 L3 Cache是否命中, 由于 L3 Cache是最后一级緩存, 故 L3 Cache命中或未命中, 则查询过程均到此为止。
若此步骤中存在一个緩存命中, 则进行步骤 S104; 若此步骤中所有緩存 均未命中, 则进行步骤 S105。
5104、 若一个緩存命中, 则针对所命中緩存中的第一物理内存数据块的 第一查询地址读 /写数据。
优选的,可以预先增设各级别的緩存到 CPU Core中的基于多级緩存的数 据读 /写的装置的直接数据通路, 此时, 此步骤可以为: 通过所述装置与所命 中緩存间的直接数据通路, 针对所命中緩存中的第一物理内存数据块的第一 查询地址读 /写数据。
当然, 釆用现有技术中所建立的数据通路, 针对所命中緩存中的第一物 理内存数据块的第一查询地址读 /写数据也是可以的。
5105、 若所有緩存均未命中, 则针对内存中的第一物理内存数据块的第 一查询地址读 /写数据。
由于内存中必然能找到第一物理内存数据块, 故而当所有緩存均未命中 的情况下, 可以利用此步骤完成数据的读 /写。
本发明实施例提供的一种基于多级緩存的数据读 /写方法, 通过緩存位置 属性指示的物理内存数据块所能进入緩存的级别, 并按照其指示的所能进入 的级别查询緩存是否命中,能够支持越过无需访问的 Cache,较快地命中緩存, 从而有助于提高 Cache访问效率, 进而有助于增强 Cache命中率, 换言之, 有助于在数据读 /写过程中降低 Cache缺失率; 尤其对于一些访问频率低的物 理内存数据块而言, 可以通过对緩存位置属性的限定, 避免其进入资源紧缺 的高级别 Cache, 进而有助于在数据读 /写过程中降低 Cache缺失率。
进一步的, 针对在读数据时, 若所命中緩存的级别是所述第一緩存位置 属性指示的所能进入緩存级别中的非最高级别, 则在 S104针对所命中緩存中 的第一物理内存数据块读数据之后, 所述方法还包括: 在所述第一緩存位置 属性指示的所能进入的緩存级别中, 将需要读的数据回填到级别高于所命中 緩存的级别的緩存中; 或者, 若所命中緩存的级别是所述第一緩存位置属性 指示的所能进入緩存级别中的最高级别, 则不向其他緩存回填数据; 或者, 若所有緩存均未命中, 则所述方法还包括: 将需要读的数据回填到所述第一 緩存位置属性指示的所能进入的緩存中。
示例的, 假定计算机系统中的共有三级緩存, 且 S102中获取的所述緩存 位置属性为 01 , 且表示该内存数据块最高只能进入 L2 Cache, 也就是说, L2 Cache是第一緩存位置属性指示的所能进入的最高级别。
若经过步骤 S103所命中的緩存是 L2 Cache, 由于 L2 Cache是第一緩存 位置属性指示的所能进入的最高级别, 则不向其他緩存(例如: LI Cache )回 填数据。
若经过步骤 S103所命中的緩存是 L3 Cache,则可以在 S104针对 L3 Cache 中的第一物理内存数据块读数据之后或同时, CPU Core中的基于多级緩存的 数据读 /写的装置在第一緩存位置属性指示的所能进入緩存的级别下 , 将需要 读的数据回填到 L2 Cache中。 这样, 使得在再次针对第一物理内存数据块读 / 写数据时, 就可以一次命中 L2 Cache。
若经过步骤 S103所有緩存均未命中, 则可以在 S105针对内存中的第一 物理内存数据块读数据之后或同时, CPU Core 中的基于多级緩存的数据读 / 写的装置将需要读的数据回填到 L3 Cache和 L2 Cache中。这样使得可以在下 一次读取该数据的过程中, 经一次查询就可命中 L2 Cache。
通过对物理内存数据块进行合适的緩存位置级别限定, 对于引起 Cache 缺失率高的应用, 可以防止访问频率低的数据调入缺失率高的 Cache 中, 避 免了无谓的 Cache数据回填。
进一步的, 为维护共享数据的一致性, 针对写数据时, 在 S104针对所命 中緩存中的第一物理内存数据块的第一查询地址写数据之后, 所述方法还包 括: 若所写的数据为共享数据, 则在所述第一緩存位置属性指示的所能进入 的緩存级别中, 向级别等于和 /或低于所命中緩存的级别的其他緩存发起共享 数据一致性请求。
其中,所述共享数据为在多核处理器的緩存结构中,若其中一个 CPU Core 对某一数据进行了修改, 而该数据同时在其他 CPU Core的緩存中, 则该数据 为不同 CPU Core间的共享数据。
示例的,假定计算机系统中有两个 CPU Core( CPU CoreO和 CPU Corel ) , 每个 CPU Core包含有三级緩存, 若 CPU CoreO对其緩存中的 LI Cache的数 据进行了修改, 而该数据同时在 CPU Corel的 LI Cache中, 则该数据为 CPU CoreO和 CPU Corel的共享数据。
示例的, 假定计算机系统中共有三级緩存, 且 S102中获取的所述緩存位 置属性为 01 , 且表示该内存数据块最高只能进入 L2 Cache, 也就是说, 在第 一緩存位置属性指示的所能进入的緩存级别包括: L2、 L3。
若经过步骤 S103所命中的緩存是 L2 Cache, 且经步骤 S104所写入的数 据为共享数据, 则(1 )在计算机系统中除了所命中的 L2 Cache夕卜, 还包含其 他 L2 Cache的情况下, CPU Core中的基于多级緩存的数据读 /写的装置向其 他 L2 Cache以及 L3 Cache发起共享数据一致性请求; ( 2 )在计算机系统中 不包含其他 L2 Cache的情况下,该装置仅向 L3 Cache发起共享数据一致性请 求。
若经过步骤 S103所命中的緩存是 L3 Cache, 且经步骤 S104所写入的数 据为共享数据, 则(1 )在计算机系统中除了所命中的 L3 Cache夕卜, 还包含其 他 L3 Cache的情况下, CPU Core中的基于多级緩存的数据读 /写的装置仅向 其他 L3 Cache发起共享数据一致性请求; (2 )在计算机系统中不包含其他 L3 Cache的情况下, 该装置不发起共享数据一致性请求。
对于维护共享数据一致性的方法, 主要有以下两种:
一种是写回 (write back ) 的方式, 具体的, 在向命中的緩存中写入新的 数据后, 并按照上述描述在所述第一緩存位置属性指示的所能进入的緩存级 别中, 向级别等于和 /或低于所命中緩存的级别的其他緩存发起共享数据一致 性请求后, 存在这些共享数据的其他緩存中的共享数据被置无效。 示例的, 若上述若经过步骤 S103 所命中的緩存是 L2 Cache, 且经步骤 S104所写入的数据为共享数据, CPU Core中的基于多级緩存的数据读 /写的 装置向其他 L2 Cache以及 L3 Cache发起共享数据一致性请求, 此时, 其他 L2 Cache以及 L3 Cache都被置为无效。
另一种是写通过( write through ) 的方式, 具体的, 按照上述描述在所述 第一緩存位置属性指示的所能进入的緩存级别中 , 向级别等于和 /或低于所命 中緩存的级别的其他緩存发起共享数据一致性请求后, 级别等于所命中緩存 级别的其它緩存中的共享数据被置无效, 若所命中緩存级别不是所述第一緩 存位置属性指示的所能进入的緩存级别中的最低级别, 则低级别緩存中的共 享数据被新写入的数据更新。
示例的,若经过上述步骤 S103所命中的緩存是 L2 Cache,且经步骤 S104 所写入的数据为共享数据, CPU Core中的基于多级緩存的数据读 /写的装置向 其他 L2 Cache以及 L3 Cache发起共享数据一致性请求, 此时,其他 L2 Cache 中的共享数据被置无效, L3 Cache中的共享数据更新。
因此, 在多核系统环境中, 通过对物理内存数据块设置緩存位置属性, 能够有针对性的向可能拥有共享数据的 Cache发起一致性请求, 减少了对緩 存的查找和侦测 ( snooping ) 。 本发明实施例提供了一种计算机系统, 包括: 内存以及基于多级緩存的 数据读 /写的装置, 所述装置为包括多级緩存的 CPU, 该装置用于执行上述方 法中的各个步骤。
下面, 本发明还提供了具体实例, 对上述读 /写数据的方法进行详述。 在 各个具体实例中, 以双核计算机系统为例, 并且该双核计算机系统具有三个 级别的緩存。 参见图 2, 该计算机系统包括:
三个级别的緩存: LI Cache,包括 I-Cache( Instruction- Cache,指令緩存 )、 D-Cache ( Date- Cache, 数据緩存) , L2 Cache, L3 Cache; 内存(Memory ) 以及 CPU Core。
进一步的, 该计算机系统还可以包括 TLB: I-TLB ( Instruction-TLB, 指 令旁路转换緩存) 、 D-TLB ( Date-TLB , 数据旁路转换緩存) 。 TLB 负责将 具体的, L1釆用高速小容量的 Cache, L2釆用速度中等容量较大的 Cache, L3釆用低速大容量的 Cache, 并且 L1/L2 Cache为各个 CPU Core私有, L3 Cache为多个 CPU Core共享。 所谓私有緩存是为一个 CPU Core所私有的, 所谓共享緩存是为多个 CPU Core所共享的。 图 2中上半部分虚框线中的 L1、 L2 Cache是 CPU CoreO的私有緩存、图 2中下半部分虚框线中的 LI、L2 Cache 是 CPU Corel的私有緩存, L3 Cache为 CPU CoreO和 CPU Corel的共享緩存。
另外,下面各实施例中以物理内存数据块为内存页( age )为例进行说明, 一个内存页的属性信息存储于页表(page table ) 中, 且内存中存储了所有内 存页的页表。 其中, 内存页的属性信息可以表示该内存页是否为共享、 能否 被进入 Cache等。 实施例一:
下面将根据上述计算机系统, 针对基于多级緩存的数据读方法, 提供一 种具体的实施方案。
本实施例提供的基于多级緩存的数据读方法, 上述的内存页的属性信息 中还包括物理内存页的緩存位置属性信息, 该緩存位置属性信息根据物理内 存页被访问的情况进行设定。
如图 3所示, 基于多级緩存的数据读方法具体包括以下步骤:
步骤①、 设置内存页的緩存位置属性。
在本具体实施例中, 通过物理内存页面的被访问情况, 在页表中添加若 干比特用于标识緩存访问级别(CAL, Cache Access Level)信息, 该 CAL信息 用于标识该内存页所能进入緩存级别中的最高能进入的緩存级另' 其中, CAL 信息可以由操作系统在分配页面的时候直接设定。 在本实施例中, 内存的页 表如图 3所示: 物理地址的高位比特 PA— 1对应的 CAL信息为 "10" , 物理 地址的高位比特 PA— 2对应的 CAL信息为 "00" , 物理地址的高位比特 PA— 3 对应的 CAL信息为 "01" 等。
步骤②、 CPU Core将上述内存中的页表填入 TLB条目 (entry ) 中, 用 TLB entry中的保留比特标识 CAL信息, 如果没有保留比特, 可以增加 TLB entry的宽度。
需要说明的是, 由于在本实施例中以 PA— 3为例进行描述, 故而在图 3的 TLB entry中只示出 PA— 3相应的页表, 其他页表在 TLB entry中也是存在的。
以上两个步骤可以是在系统初始化时, 或者在某一程序运行前进行, 无 需在每次进行数据读 /写时执行。
步骤③、 CPU Core中的基于多级緩存的数据读 /写的装置查询内存页的物 理地址的高位比特以及 C AL信息。
在本具体实施例中, 当 CPU Core中的基于多级緩存的数据读 /写的装置 发起一次读数据的请求 , 给出虚拟地址 VA— 3 , 在 TLB中查询到与此虚拟地 址 VA— 3相对应的物理地址的高位比特 PA— 3、以及 PA— 3对应的 CAL信息为 "01" 。
步骤④、 根据 PA— 3、 PA— 3对应的 CAL信息为 "01" 查询 L2 Cache是 否命中。
在本具体实施例中, 由于 CAL信息 "01" 标识该内存页所能进入的緩存 级别中最高为 L2 Cache , 则忽略 LI Cache , 直接向 L2 Cache发起访问请求, 送出物理地址的高位比特 PA— 3。 将该物理地址的高位比特 PA— 3与 L2 Cache 中 Tag进行比较, 得到 L2 Cache是否命中的结果。
若 L2 Cache命中, 则继续进行步骤⑤。
步骤⑤、将所需的数据通过直接数据通路传送给 CPU Core中的基于多级 緩存的数据读 /写的装置。
本发明实施例提供的一种基于多级緩存的数据读操作方法, 通过緩存位 置属性指示的物理内存数据块所能进入緩存的级别,使得 CPU Core可以按照 其指示的所能进入的级别查询緩存是否命中, 从而有助于增强 Cache命中率, 有助于在数据读操作过程中降低 Cache缺失率。 实施例二:
针对实施例一中经步骤④中 L2 Cache未命中, 又提供一实施例。 在本实 施例中, 前 4个步骤可以参照实施例一中的前 4个步骤, 在此不加赘述。
若实施例一步骤④中 L2 Cache未命中, 如图 4所示, 本实施例还包括: 步骤⑤、 CPU Core中的基于多级緩存的数据读 /写的装置利用物理地址的 高位比特 PA— 3查询下一级 L3 Cache是否命中。
CPU Core 中的基于多级緩存的数据读 /写的装置将该物理地址的高位比 特 PA— 3与 L3 Cache中 Tag进行比较, 得到 L3 Cache是否命中的结果。
若 L3 Cache命中, 则继续进行步骤⑥; 若 L3 Cache未命中, 则继续进行 步骤⑦。
步骤⑥、若 L3 Cache命中,将需要读的数据通过直接数据通路传送给 CPU Core中的基于多级緩存的数据读 /写的装置, 同时将这些数据回填(refill )到 L2 Cache中。
步骤⑦、 若 L3 Cache未命中, 则 CPU Core中的基于多级緩存的数据读 / 写的装置在内存 PA— 3对应的内存页中查找到需要读的数据,将这些数据通过 直接数据通路传送给该装置,同时将这些数据回填到 L2 Cache和 L3 Cache中。
本发明实施例提供的一种基于多级緩存的数据读操作方法, 通过緩存位 置属性指示的物理内存数据块所能进入緩存的级别, 并可以按照其指示的所 能进入的级别查询緩存是否命中, 能够支持越过无需访问的 Cache,较快地命 中緩存, 从而有助于提高 Cache访问效率, 进而有助于增强 Cache命中率, 换言之, 有助于在数据读操作过程中降低 Cache缺失率; 尤其对于一些访问 频率低的物理内存数据块而言, 可以通过对緩存位置属性的限定, 避免其进 入资源紧缺的高级别 Cache,进而有助于在数据读操作过程中降低 Cache缺失 率, 同时避免了无谓的 Cache数据回填。 实施例三:
下面将根据上述计算机系统, 针对基于多级緩存的数据写方法, 提供一 种具体的实施方案。
在本实施例中, 釆用和实施例一中相同的内存页緩存位置属性设置, 即 相同的页表。 因此, 在本实施例中, 当 CPU Core中的基于多级緩存的数据读 /写的装置发起一次数据写请求时, 前 4个步骤可以参考实施例一中的前 4个 步骤, 区别仅在于将读数据的请求改为写数据的请求, 其他在此不加赘述。 若经步骤④ L2 Cache命中, 如图 5所示, 本实施例还包括:
步骤⑤: 将数据写入到 L2 Cache中。
进一步的, 若步骤⑤中所写入的数据为共享数据时, 为了维护共享数据 的一致性还可以进行下面的步骤。
步骤⑥: CPU Core中的基于多级緩存的数据读 /写的装置向其他 L2 Cache 以及 L3 Cache发起共享数据一致性请求。
若 L2 Cache釆用写回的方式, 则 L3 Cache和其他 CPU Core的 L2 Cache 中的共享数据被置为无效; 若 L2 Cache釆用写通过的方式, 则 L3 Cache的共 享数据被新写入的 L2 Cache的数据所更新, 其他 CPU Core的 L2 Cache中的 共享数据被置为无效。
本发明实施例提供的一种基于多级緩存的数据写操作方法, 通过緩存位 置属性指示的物理内存数据块所能进入緩存的级别, 并按照其指示的所能进 入的级别查询緩存是否命中, 能够支持越过无需访问的 Cache,较快地命中緩 存, 从而有助于提高 Cache命中效率, 进而有助于增强 Cache命中率, 换言 之, 有助于在数据写操作过程中降低 Cache缺失率; 尤其对于一些访问频率 低的物理内存数据块而言, 可以通过对緩存位置属性的限定, 避免其进入资 源紧缺的高级别 Cache, 进而有助于在数据写操作过程中降低 Cache缺失率; 对于共享数据而言, 能够有针对性的对可能拥有共享数据的 Cache发起一致 性请求, 减少了 Cache的查找和侦测。 实施例四:
针对实施例一、二、三中的 CAL信息,还可以通过指令的方式进行设置, 为 CAL信息设置一个系统寄存器, 而不将 CAL信息存放在页表和 TLB中, 也就是说, 增设一系统寄存器用于存储緩存位置属性, 从而使得可以通过系 统寄存器存储的緩存位置属性信息进行数据读 /写。
如图 6 所示, 本实施例提供了一种基于多级緩存的数据写操作方法, 具 体的步骤包括:
步骤①、 在系统寄存器堆中申请一 CAL寄存器 (CALR, Cache Access Level Register ) , 可以通过一条新增的指令, 或者在原指令集中添加一些比特 专门来对 CALR进行设置, 并且 CALR保持不变直至重新设置。如图 6所示, 系统寄存器包括 MIDR ( Main ID Register,设备标识寄存器)、 PAR ( Physical Address Register, 物理地址寄存器)、 CALR等。 在本实施例中设置 CALR=1 (即 CALR中的值为 1 , 也就是说, CAL信息为 1 ) , 且表示内存页最高只 能进入 L2 Cache。
步骤②、 CPU Core中的基于多级緩存的数据读 /写的装置在发起一次数据 写请求的过程中, 从系统寄存器中得到 CALR=1的信息。
步骤③、 CPU Core中的基于多级緩存的数据读 /写的装置查询内存页的物 理地址的高位比特。
在本具体实施例中, CPU Core中的基于多级緩存的数据读 /写的装置发起 一次数据写请求, 并给 TLB送出虚拟地址 VA— 1。 TLB负责将该装置发出的 虚拟地址转化为物理地址的高位比特。 如图 6所示, TLB中存储了内存页的 属性信息, 包括: 物理地址的高位比特为 PA— 1 , PA 2, PA 3 , PA— 4等, 但 不包含 CAL信息。该装置利用虚拟地址 VA— 1在 TLB中进行查找,得到虚拟 地址 VA— 1对应的物理地址高位比特 PA— 1。
步骤④、 根据步骤②得到的 CALR=1、 以及步骤③得到的 PA— 1查询 L2 Cache是否命中。 具体的, 将该物理地址的高位比特 PA— 1与 L2 Cache中 Tag进行比较, 得到 L2 Cache是否命中的结果。
若 L2 Cache命中, 则继续进行步骤⑤。
步骤⑤、 将数据直接写入到 L2 Cache。
若步骤⑤中所写入的数据为共享数据, 则可以参考实施例三釆用写回或 写通过的方式, 维持共享数据的一致性, 在此不再赘述。
本发明实施例通过设置系统寄存器 CALR, 在基于多级緩存的数据读 /写 操作方法中, 通过緩存位置属性指示的物理内存数据块所能进入緩存的级别 , 并按照其指示的所能进入的级别查询緩存是否命中, 能够支持越过无需访问 的 Cache, 较快地命中緩存, 从而有助于提高 Cache访问效率, 进而有助于增 强 Cache命中率, 换言之, 有助于在数据写操作过程中降低 Cache缺失率; 尤其对于一些访问频率低的物理内存数据块而言, 可以通过对緩存位置属性 的限定, 避免其进入资源紧缺的高级别 Cache, 进而有助于在数据写操作过程 中降低 Cache缺失率。 本发明实施例还提供了一种基于多级緩存的读 /写装置, 该装置可以是 CPU Core的一个功能模块, 该装置中的各个功能模块与上述方法中的步骤相 对应, 在此不进行详细描述。
如图 7所示, 所述装置 70包括:
第一获取单元 701 , 用于获取读 /写数据所针对的第一物理内存数据块的 第一查询地址;
第二获取单元 702 ,用于获取所述第一物理内存数据块的第一緩存位置属 性; 所述第一緩存位置属性用于指示所述第一物理内存数据块所能进入緩存 的级别;
查询单元 703 ,根据所述第一获取单元 701得到的第一查询地址, 按照所 述第二获取单元 702得到的第一緩存位置属性所指示的第一物理内存数据块 所能进入的緩存级别从高到低的顺序依次查询緩存是否命中, 直至一个緩存 命中或所有緩存均未命中为止;
读写单元 704 , 用于若一个緩存命中, 则针对所述查询单元 703所命中緩 存中的第一物理内存数据块的第一查询地址读 /写数据; 或, 若所述查询单元 703的查询结果为所有緩存均未命中,则针对内存中的第一物理内存数据块的 第一查询地址读 /写数据。
进一步的, 所述第一緩存位置属性为根据第一物理内存数据块的被访问 情况, 在页表緩存 TLB中为所述第一物理内存数据块所设定的;
所述第二获取单元 702, 用于根据 TLB中存储的物理内存数据块的属性 信息, 查询所述第一查询地址对应的第一緩存位置属性; 所述 TLB中存储有 物理内存数据块的属性信息, 其中包括: 物理内存数据块的查询地址、 物理 内存数据块的緩存位置属性的对应关系。
或者, 进一步的, 所述第一緩存位置属性为根据第一物理内存数据块的 被访问情况, 在系统寄存器中为所述第一物理内存数据块所设定的;
所述第二获取单元 702 , 用于读取当前系统寄存器中存储的緩存位置属 性, 并其作为所述第一物理内存数据块的第一緩存位置属性; 所述系统寄存 器用于存储緩存位置属性。
进一步的, 所述读写单元 704, 用于通过所述装置 70与所命中緩存间的 直接数据通路, 针对所命中緩存中的第一物理内存数据块的第一查询地址读 / 写数据; 或者, 用于通过所述装置 70与内存间的直接数据通路, 针对内存中 的第一物理内存数据块的第一查询地址读 /写数据。
进一步的, 所述读写单元 704还用于在读数据时,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的非最高级别 , 则在所述第一緩存位置属性指示的所能进入的緩存级别中 , 将需要读的数据回填到级别高于所命中緩存的级别的緩存中; 或者,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的最高级别, 则不向其他緩存回填数据; 或者,
若所有緩存均未命中, 则将需要读的数据回填到所述第一緩存位置属性 指示的所能进入的緩存中。
进一步的, 所述读写单元 704 , 还用于在写数据时, 若所写的数据为共享 数据, 则在所述第一緩存位置属性指示的所能进入的緩存级别中, 向级别等 于和 /或低于所命中緩存的级别的其他緩存发起共享数据一致性请求。
可选的, 所述第一緩存位置属性标识第一物理内存数据块所能进入緩存 级别中的最高级别, 或者标识第一物理内存数据块不能进入的緩存级别。
本发明实施例提供的装置, 通过緩存位置属性指示的物理内存数据块所 能进入緩存的级别, 使得装置中的查询单元可以按照其指示的所能进入的级 别查询緩存是否命中, 能够支持越过无需访问的 Cache, 较快的命中緩存, 从 而有助于提高 Cache访问频率, 进而有助于增强 Cache命中率, 换言之, 有 助于在数据读 /写过程中降低 Cache缺失率; 尤其对于一些访问频率低的物理 内存数据块而言, 可以通过对緩存位置属性的限定, 避免其进入资源紧缺的 高级别緩存, 进而有助于在数据读 /写过程中降低 Cache缺失率。 本发明还提供了一种计算机系统, 所述系统包括: 处理器以及和所述处 理器相连的存储器;
其中, 所述存储器可以为内存, 且存储器中存储一组程序代码, 且所述 处理器用于调用所述存储器中存储的程序代码, 所述程序代码用于实现上述 提供的任一种基于多级緩存的数据读 /写方法。
所述处理器用于调用所述基于多级緩存的数据读 /写的程序代码, 以获取 读 /写数据所针对的第一物理内存数据块的第一查询地址; 获取所述第一物理 内存数据块的第一緩存位置属性; 所述第一緩存位置属性用于指示所述第一 物理内存数据块所能进入緩存的级别; 根据所述第一查询地址, 按照所述第 一緩存位置属性所指示的第一物理内存数据块所能进入的緩存级别从高到低 的顺序依次查询緩存是否命中, 直至一个緩存命中或所有緩存均未命中为止; 若一个緩存命中, 则针对所命中緩存中的第一物理内存数据块读 /写数据; 或, 若所有緩存均未命中, 则针对内存中的第一物理内存数据块读 /写数据。 可选的, 所述处理器还用于调用所述基于多级緩存的数据读 /写的程序代 码, 根据第一物理内存数据块的被访问情况, 在页表緩存 TLB中为所述第一 物理内存数据块所设定的; 根据页表緩存 TLB中存储的物理内存数据块的属 性信息, 查询所述第一查询地址对应的第一緩存位置属性; 所述 TLB中存储 有物理内存数据块的属性信息, 其中包括: 物理内存数据块的查询地址、 物 理内存数据块的緩存位置属性的对应关系。
可选的, 所述处理器还用于调用所述基于多级緩存的数据读 /写的程序代 码, 根据第一物理内存数据块的被访问情况, 在系统寄存器中为所述第一物 理内存数据块所设定的; 读取当前系统寄存器中存储的緩存位置属性, 并其 作为所述第一物理内存数据块的第一緩存位置属性; 所述系统寄存器用于存 储緩存位置属性。
具体的, 所述处理器还用于调用所述基于多级緩存的数据读 /写的程序代 码, 通过与所命中緩存间的直接数据通路, 针对所命中緩存中的第一物理内 存数据块的第一查询地址读 /写数据; 或者, 通过与内存间的直接数据通路, 针对内存中的第一物理内存数据块的第一查询地址读 /写数据。
进一步的, 所述处理器还用于调用所述基于多级緩存的数据读的程序代 码, 若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别 中的非最高级别, 则所述方法还包括: 在所述第一緩存位置属性指示的所能 进入的緩存级别中, 将需要读的数据回填到级别高于所命中緩存的级别的緩 存; 或者, 若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩 存级别中的最高级别, 则不向其他緩存回填数据; 或者, 若所有緩存均未命 中, 则所述方法还包括: 将需要读的数据回填到所述第一緩存位置属性指示 的所能进入的緩存中。
进一步的, 所述处理器还用于调用所述基于多级緩存的数据写的程序代 码, 若所写的数据为共享数据, 则在所述第一緩存位置属性指示的所能进入 的緩存级别中, 向级别等于和 /或低于所命中緩存的级别的其他緩存发起共享 数据一致性请求。 在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统, 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理包括, 也可以两个或两个以上单元集成在一个单 元中。 上述集成的单元既可以釆用硬件的形式实现, 也可以釆用硬件加软件 功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元, 可以存储在一个计算机 可读取存储介质中。 上述软件功能单元存储在一个存储介质中, 包括若干指 令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 执行本发明各个实施例所述方法的部分步骤。 而前述的存储介质包括: U盘、 移动硬盘、 只读存储器(Read-Only Memory, 简称 ROM ) 、 随机存取存储器 ( Random Access Memory, 简称 RAM )、 磁碟或者光盘等各种可以存储程序 代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权 利 要求 书
1、 一种基于多级緩存的数据读 /写方法, 其特征在于, 包括:
获取读 /写数据所针对的第一物理内存数据块的第一查询地址;
获取所述第一物理内存数据块的第一緩存位置属性; 所述第一緩存位置属 性用于指示第一物理内存数据块所能进入緩存的级别;
根据所述第一查询地址, 按照所述第一緩存位置属性所指示的第一物理内 存数据块所能进入的緩存级别从高到低的顺序依次查询緩存是否命中, 直至一 个緩存命中或所有緩存均未命中为止;
若一个緩存命中, 则针对所命中緩存中的第一物理内存数据块的第一查询 地址读 /写数据; 或, 若所有緩存均未命中, 则针对内存中的第一物理内存数据 块的第一查询地址读 /写数据。
2、 根据权利要求 1所述的方法, 其特征在于,
所述第一緩存位置属性为根据第一物理内存数据块的被访问情况, 在页表 緩存 TLB中为所述第一物理内存数据块所设定的;
所述获取所述第一物理内存数据块的第一緩存位置属性包括:
根据页表緩存 TLB中存储的物理内存数据块的属性信息, 查询所述第一查 询地址对应的第一緩存位置属性; 所述 TLB中存储有物理内存数据块的属性信 息, 其中包括: 物理内存数据块的查询地址、 物理内存数据块的緩存位置属性 的对应关系。
3、 根据权利要求 1所述的方法, 其特征在于,
所述第一緩存位置属性为根据第一物理内存数据块的被访问情况, 在系统 寄存器中为所述第一物理内存数据块所设定的;
所述获取所述第一物理内存数据块的第一緩存位置属性包括:
读取当前系统寄存器中存储的緩存位置属性, 并其作为所述第一物理内存 数据块的第一緩存位置属性; 所述系统寄存器用于存储緩存位置属性。
4、 根据权利要求 1所述的方法, 其特征在于, 所述针对所命中緩存中的第 一物理内存数据块的第一查询地址读 /写数据包括:
通过与所命中緩存间的直接数据通路, 针对所命中緩存中的第一物理内存 数据块的第一查询进行读 /写数据;
或者, 所述针对内存中的第一物理内存数据块的第一查询地址读 /写数据包 括:
通过与内存间的直接数据通路, 针对内存中的第一物理内存数据块的第一 查询地址读 /写数据。
5、 根据权利要求 1-4任一项所述的方法, 其特征在于, 在读数据时, 若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别中 的非最高级别, 则所述方法还包括: 在所述第一緩存位置属性指示的所能进入 的緩存级别中, 将需要读的数据回填到级别高于所命中緩存的级别的緩存; 或 者,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别中 的最高级别, 则不向其他緩存回填数据; 或者,
若所有緩存均未命中, 则所述方法还包括: 将需要读的数据回填到所述第 一緩存位置属性指示的所能进入的緩存中。
6、 根据权利要求 1-4任一项所述的方法, 其特征在于, 在写数据时, 针对 所命中緩存中的第一物理内存数据块写数据之后, 所述方法还包括:
若所写的数据为共享数据, 则在所述第一緩存位置属性指示的所能进入的 緩存级别中, 向级别等于和 /或低于所命中緩存的级别的其他緩存发起共享数据 一致性请求。
7、 根据权利要求 1-6任一项所述的方法, 其特征在于, 所述第一緩存位置 属性标识第一物理内存数据块所能进入緩存级别中的最高级别, 或者标识第一 物理内存数据块不能进入的緩存级别。
8、一种基于多级緩存的数据读 /写装置, 所述装置为包括多级緩存的中央处 理器 CPU, 其特征在于, 包括:
第一获取单元, 用于获取读 /写数据所针对的第一物理内存数据块的第一查 询地址;
第二获取单元, 用于获取所述第一物理内存数据块的第一緩存位置属性; 所述第一緩存位置属性用于指示第一物理内存数据块所能进入緩存的级别; 查询单元, 根据所述第一获取单元得到的所述第一查询地址, 按照第二获 取单元得到的所述第一緩存位置属性所指示的所述第一物理内存数据块所能进 入的緩存级别从高到低的顺序依次查询緩存是否命中, 直至一个緩存命中或所 有緩存均未命中为止;
读写单元, 用于若一个緩存命中, 则针对所述查询单元所命中緩存中的第 一物理内存数据块的第一查询地址读 /写数据; 或, 若所述查询单元的查询结果 为所有緩存均未命中, 则针对内存中的第一物理内存数据块的第一查询地址读 / 写数据。
9、 根据权利要求 8所述的装置, 其特征在于,
所述第一緩存位置属性为根据第一物理内存数据块的被访问情况, 在页表 緩存 TLB中为所述第一物理内存数据块所设定的;
所述第二获取单元, 用于根据 TLB中存储的物理内存数据块的属性信息, 查询所述第一查询地址对应的第一緩存位置属性; 所述 TLB中存储有物理内存 数据块的属性信息, 其中包括: 物理内存数据块的查询地址、 物理内存数据块 的緩存位置属性的对应关系。
10、 根据权利要求 8所述的装置, 其特征在于,
所述第一緩存位置属性为根据第一物理内存数据块的被访问情况, 在系统 寄存器中为所述第一物理内存数据块所设定的;
所述第二获取单元, 用于读取当前系统寄存器中存储的緩存位置属性, 并 其作为所述第一物理内存数据块的第一緩存位置属性; 所述系统寄存器用于存 储緩存位置属性。
11、 根据权利要求 8所述的装置, 其特征在于,
所述读写单元, 用于通过与所命中緩存间的直接数据通路, 针对所命中緩 存中的第一物理内存数据块的第一查询地址进行读 /写数据; 或者, 所述读写单 元, 用于通过与内存间的直接数据通路, 针对内存中的第一物理内存数据块的 第一查询地址进行读 /写数据。
12、 根据权利要求 8-11任一项所述的装置, 其特征在于, 所述读写单元, 还用于在读数据时, 若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别中 的非最高级别, 则在所述第一緩存位置属性指示的所能进入的緩存级别中, 将 需要读的数据回填到级别高于所命中緩存的级别的緩存; 或者,
若所命中緩存的级别是所述第一緩存位置属性指示的所能进入緩存级别中 的最高级别, 则不向其他緩存回填数据; 或者,
若所有緩存均未命中, 则将需要读的数据回填到所述第一緩存位置属性指 示的所能进入的緩存中。
13、 根据权利要求 8-12任一项所述的装置, 其特征在于,
所述读写单元, 还用于在写数据时, 若所写的数据为共享数据, 则在所述 第一緩存位置属性指示的所能进入的緩存级别中 , 向级别等于和 /或低于所命中 緩存的级别的其他緩存发起共享数据一致性请求。
14、 根据权利要求 8-13任一项所述的装置, 其特征在于, 所述第一緩存位 置属性标识第一物理内存数据块所能进入緩存级别中的最高级别, 或者标识第 一物理内存数据块不能进入的緩存级别。
15、 一种计算机系统, 其特征在于, 包括: 内存以及权利要求 8-14任一项 所述的装置。
PCT/CN2014/083467 2013-07-31 2014-07-31 基于多级缓存的数据读/写方法、装置和计算机系统 WO2015014302A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP14832818.0A EP3029575A4 (en) 2013-07-31 2014-07-31 MULTI-STAGE DATA READING / WRITING PROCEDURE AND CACHE BASED DEVICE AND COMPUTER SYSTEM
US15/010,376 US9864696B2 (en) 2013-07-31 2016-01-29 Multilevel cache-based data read/write method and apparatus, and computer system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310331344.6 2013-07-31
CN201310331344.6A CN104346294B (zh) 2013-07-31 2013-07-31 基于多级缓存的数据读/写方法、装置和计算机系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/010,376 Continuation US9864696B2 (en) 2013-07-31 2016-01-29 Multilevel cache-based data read/write method and apparatus, and computer system

Publications (1)

Publication Number Publication Date
WO2015014302A1 true WO2015014302A1 (zh) 2015-02-05

Family

ID=52431018

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/083467 WO2015014302A1 (zh) 2013-07-31 2014-07-31 基于多级缓存的数据读/写方法、装置和计算机系统

Country Status (4)

Country Link
US (1) US9864696B2 (zh)
EP (1) EP3029575A4 (zh)
CN (1) CN104346294B (zh)
WO (1) WO2015014302A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016176551A1 (en) * 2015-04-29 2016-11-03 Google Inc. Data caching
US20220317920A1 (en) * 2021-04-06 2022-10-06 SK Hynix Inc. Controller, memory system including the same, and method performed by the same

Families Citing this family (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6027562B2 (ja) * 2014-02-24 2016-11-16 株式会社東芝 キャッシュメモリシステムおよびプロセッサシステム
CN105988730B (zh) * 2015-03-02 2019-03-08 华为技术有限公司 一种读取缓存数据的方法、旁路装置及缓存系统
CN106354421B (zh) * 2015-07-17 2019-11-12 龙芯中科技术有限公司 筛选方法、筛选器及数据一致性维护系统
CN107229546A (zh) * 2016-03-23 2017-10-03 上海复旦微电子集团股份有限公司 缓存的模拟方法及装置
EP3441884B1 (en) * 2016-05-03 2021-09-01 Huawei Technologies Co., Ltd. Method for managing translation lookaside buffer and multi-core processor
CN106055274A (zh) * 2016-05-23 2016-10-26 联想(北京)有限公司 一种数据存储方法、数据读取方法及电子设备
US10956339B2 (en) * 2016-07-14 2021-03-23 Advanced Micro Devices, Inc. System and method for storing cache location information for cache entry transfer
CN109952565B (zh) * 2016-11-16 2021-10-22 华为技术有限公司 内存访问技术
CN106708749B (zh) * 2016-12-23 2019-08-23 量子云未来(北京)信息科技有限公司 一种数据查找方法
US10628313B2 (en) * 2017-05-26 2020-04-21 International Business Machines Corporation Dual clusters of fully connected integrated circuit multiprocessors with shared high-level cache
CN107291633A (zh) * 2017-07-14 2017-10-24 长沙开雅电子科技有限公司 一种新型集群存储写缓存分级管理方法
CN109753445B (zh) * 2017-11-02 2022-12-27 华为技术有限公司 一种缓存访问方法、多级缓存系统及计算机系统
US10558573B1 (en) 2018-09-11 2020-02-11 Cavium, Llc Methods and systems for distributing memory requests
CN109947367B (zh) * 2019-03-15 2024-01-09 维沃移动通信有限公司 一种文件的处理方法及终端
CN112148665B (zh) 2019-06-28 2024-01-09 深圳市中兴微电子技术有限公司 缓存的分配方法及装置
CN110472004B (zh) * 2019-08-23 2022-07-08 国网山东省电力公司电力科学研究院 一种科技情报数据多级缓存管理的方法及系统
CN110955688A (zh) * 2019-12-23 2020-04-03 北京奇艺世纪科技有限公司 代理服务器、数据查询方法及装置、电子设备和可存储介质
CN113377684B (zh) * 2020-03-09 2024-03-08 瑞昱半导体股份有限公司 数据写入系统与方法
US11947451B2 (en) 2020-04-22 2024-04-02 Micron Technology, Inc. Mapping descriptors for read operations
CN112181295B (zh) * 2020-09-22 2022-02-18 杭州宏杉科技股份有限公司 数据访问方法、装置、存储设备及机器可读存储介质
CN112328632B (zh) * 2020-10-09 2022-06-14 福建亿榕信息技术有限公司 一种分布式两级缓存的方法和系统
CN112433961B (zh) * 2020-12-02 2022-07-08 海光信息技术股份有限公司 复合缓存目录系统及其管理方法
CN113836053A (zh) * 2021-09-07 2021-12-24 上海砹芯科技有限公司 信息获取方法、装置和电子设备
CN117014504B (zh) * 2023-08-11 2024-04-16 北京市合芯数字科技有限公司 数据传输方法、装置、设备、介质及产品
CN117573572A (zh) * 2024-01-12 2024-02-20 北京开源芯片研究院 重填数据的处理方法、装置、设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148372A (en) * 1998-01-21 2000-11-14 Sun Microsystems, Inc. Apparatus and method for detection and recovery from structural stalls in a multi-level non-blocking cache system
CN102103552A (zh) * 2009-12-22 2011-06-22 Nxp股份有限公司 安全高速缓存存储器架构
CN102662861A (zh) * 2012-03-22 2012-09-12 北京北大众志微系统科技有限责任公司 末级高速缓存插入策略软件控制方法
CN102725741A (zh) * 2011-12-31 2012-10-10 华为技术有限公司 高速缓冲存储器控制方法、装置和系统
CN103077131A (zh) * 2012-12-31 2013-05-01 北京北大众志微系统科技有限责任公司 一种高速缓存分区域性能监视方法及监视器
CN103218309A (zh) * 2011-12-06 2013-07-24 辉达公司 多级指令高速缓存预取

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5689679A (en) * 1993-04-28 1997-11-18 Digital Equipment Corporation Memory system and method for selective multi-level caching using a cache level code
US20080101381A1 (en) * 2006-10-25 2008-05-01 Mediatek Inc. Address resolution protocol (arp) cache management methods and devices
US8018961B2 (en) * 2009-06-22 2011-09-13 Citrix Systems, Inc. Systems and methods for receive and transmission queue processing in a multi-core architecture
WO2012149723A1 (zh) 2011-09-02 2012-11-08 华为技术有限公司 虚拟内存区域的查询、遍历方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148372A (en) * 1998-01-21 2000-11-14 Sun Microsystems, Inc. Apparatus and method for detection and recovery from structural stalls in a multi-level non-blocking cache system
CN102103552A (zh) * 2009-12-22 2011-06-22 Nxp股份有限公司 安全高速缓存存储器架构
CN103218309A (zh) * 2011-12-06 2013-07-24 辉达公司 多级指令高速缓存预取
CN102725741A (zh) * 2011-12-31 2012-10-10 华为技术有限公司 高速缓冲存储器控制方法、装置和系统
CN102662861A (zh) * 2012-03-22 2012-09-12 北京北大众志微系统科技有限责任公司 末级高速缓存插入策略软件控制方法
CN103077131A (zh) * 2012-12-31 2013-05-01 北京北大众志微系统科技有限责任公司 一种高速缓存分区域性能监视方法及监视器

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016176551A1 (en) * 2015-04-29 2016-11-03 Google Inc. Data caching
US9600417B2 (en) 2015-04-29 2017-03-21 Google Inc. Data caching
CN107438837A (zh) * 2015-04-29 2017-12-05 谷歌公司 数据高速缓存
US10303604B2 (en) 2015-04-29 2019-05-28 Google Llc Data caching
EP3657338A1 (en) * 2015-04-29 2020-05-27 Google LLC Data caching
EP3657339A1 (en) * 2015-04-29 2020-05-27 Google LLC Data caching
US10884928B2 (en) 2015-04-29 2021-01-05 Google Llc Data caching
CN107438837B (zh) * 2015-04-29 2021-03-12 谷歌有限责任公司 数据高速缓存
US20220317920A1 (en) * 2021-04-06 2022-10-06 SK Hynix Inc. Controller, memory system including the same, and method performed by the same
US11656793B2 (en) * 2021-04-06 2023-05-23 SK Hynix Inc. Controller for managing cache data, memory system including the same, and method performed by the same

Also Published As

Publication number Publication date
EP3029575A4 (en) 2016-06-29
EP3029575A1 (en) 2016-06-08
CN104346294A (zh) 2015-02-11
US20160147666A1 (en) 2016-05-26
US9864696B2 (en) 2018-01-09
CN104346294B (zh) 2017-08-25

Similar Documents

Publication Publication Date Title
WO2015014302A1 (zh) 基于多级缓存的数据读/写方法、装置和计算机系统
CN105740164B (zh) 支持缓存一致性的多核处理器、读写方法、装置及设备
US10860323B2 (en) Method and apparatus for processing instructions using processing-in-memory
US7363462B2 (en) Performing virtual to global address translation in processing subsystem
US7765381B2 (en) Multi-node system in which home memory subsystem stores global to local address translation information for replicating nodes
US8185692B2 (en) Unified cache structure that facilitates accessing translation table entries
US10055349B2 (en) Cache coherence protocol
US20160062905A1 (en) Hierarchical cache structure and handling thereof
EP3441884B1 (en) Method for managing translation lookaside buffer and multi-core processor
US9830262B2 (en) Access tracking mechanism for hybrid memories in a unified virtual system
US10997078B2 (en) Method, apparatus, and non-transitory readable medium for accessing non-volatile memory
US20130227219A1 (en) Processor, information processing apparatus, and arithmetic method
US9984003B2 (en) Mapping processing method for a cache address in a processor to provide a color bit in a huge page technology
WO2015180598A1 (zh) 对存储设备的访问信息处理方法和装置、系统
WO2023055486A1 (en) Re-reference interval prediction (rrip) with pseudo-lru supplemental age information
EP1611513B1 (en) Multi-node system in which global address generated by processing subsystem includes global to local translation information
TWI744111B (zh) 查找表建立暨記憶體位址查詢方法、主機記憶體位址查找表建立方法與主機記憶體位址查詢方法
JP6343722B2 (ja) マルチコアシステムにおいてデータ訪問者ディレクトリにアクセスするための方法及びデバイス
JP2015527684A (ja) スティッキー抜去エンジンを伴うシステムキャッシュ
CN115811509A (zh) 一种总线通信方法及相关设备
US20120110575A1 (en) Secure partitioning with shared input/output
CN110362509B (zh) 统一地址转换方法与统一地址空间
US20120110297A1 (en) Secure partitioning with shared input/output
WO2023217255A1 (zh) 数据处理方法、装置、处理器及计算机系统
WO2023241655A1 (zh) 数据处理方法、装置、电子设备以及计算机可读存储介质

Legal Events

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

Ref document number: 14832818

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2014832818

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014832818

Country of ref document: EP