CN104346404B - A kind of method, equipment and system for accessing data - Google Patents

A kind of method, equipment and system for accessing data Download PDF

Info

Publication number
CN104346404B
CN104346404B CN201310344166.0A CN201310344166A CN104346404B CN 104346404 B CN104346404 B CN 104346404B CN 201310344166 A CN201310344166 A CN 201310344166A CN 104346404 B CN104346404 B CN 104346404B
Authority
CN
China
Prior art keywords
data
field
label
group
visited
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201310344166.0A
Other languages
Chinese (zh)
Other versions
CN104346404A (en
Inventor
黄永兵
陈明宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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 Huawei Technologies Co Ltd, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201310344166.0A priority Critical patent/CN104346404B/en
Publication of CN104346404A publication Critical patent/CN104346404A/en
Application granted granted Critical
Publication of CN104346404B publication Critical patent/CN104346404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • 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/0804Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with main memory updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/20Employing a main memory using a specific memory technology
    • G06F2212/202Non-volatile memory
    • G06F2212/2022Flash memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of method, equipment and systems for accessing data.The present invention relates to the communications fields, the attribute of label field in cache memory is expanded, so that label field can both correspond to the data field of this group, other groups of data field can also be corresponded to, and then improves the data field utilization rate in cache memory.Method provided in an embodiment of the present invention includes:The solicited message for the access data to be visited that processor is sent is received, wherein, the solicited message includes the physical address information of the data to be visited;Label field corresponding with the physical address information of the data to be visited is obtained according to the physical address information of the data to be visited;Group identification information, group internal data field offset information in the corresponding label domain information of the physical address information obtain the corresponding data field of the label field.

Description

A kind of method, equipment and system for accessing data
Technical field
The present invention relates to the communications field more particularly to a kind of method, equipment and systems for accessing data.
Background technology
Cache memory (cache) is a critical component for improving performance of memory system in processor.It is slow at a high speed Rush memory institutional framework be generally divided into directly be connected, group is connected and three kinds of complete association.In the speed buffering of existing processor In reservoir designs, implementation method that group is generally taken to be connected is deposited as shown in Figure 1, organizing associative cache for N roads (wav) The structure diagram of reservoir, set associative cache include multiple groups (set), and each group the inside includes multiple high speeds Cache lines, each cache memory include a label field and a data field corresponding with the label field, one A data field includes two attributes in label position and significance bit, and each corresponding physical address of request of data that accesses can uniquely determine one A set, and in the set, which can map to any one cache line therein.
In the prior art, label field and data field are fixed one-to-one relations and are stored separately, and processor is visited When asking cache memory, if cache line and the processing in no one of cache memory group The access request of device corresponds to, which is mapped to different groups not gone the same way simultaneously, is deposited according to different groups of high speed bufferings The utilization rate of reservoir row is distributed to select the item being actually replaced away, then by the access request to the low speed buffering of utilization rate In memory lines.For example, such as Fig. 2, in the cache memory on 3 tunnels, request Y by 3 different hash algorithm H0, H1, H2 are respectively mapped to the M of the A on road 0, the D on road 1 and road 2, and A, D, M represent that a high speed in cache memory is delayed The label position rushed in memory lines and A, D, M in corresponding label field is equal, and when replacing, Y can select A, D, M In any one replacement, meanwhile, A, D, M may map to according to same mode in other groups, such as A can be mapped to road The 1 V and X on road 2, if be replaced items of the A as Y, then the utilization rate of A and the utilization rate of V and X can be compared, if A Utilization rate is high, and the utilization rate of V is minimum, then A can be stored in the position of V, and using V as being replaced item.So under Xun Huan It goes, the minimum cache line of group utilization rate can be found from entire cache memory and is replaced away.
Inventor has found to have at least the following problems in the prior art:Due to label field and data in cache memory Domain is fixed one-to-one relation and is stored separately, and causes the data field utilization rate in cache memory low.
The content of the invention
The embodiment of the present invention provides a kind of method, equipment and system for accessing data, by the mark in cache memory The attribute in label domain is expanded, so that label field can both correspond to the data field of this group, can also correspond to other groups of number According to domain, and then improve the data field utilization rate in cache memory.
In order to achieve the above objectives, the embodiment of the present invention the technical solution adopted is that,
In a first aspect, a kind of method for accessing data is provided, including:
The solicited message for the access data to be visited that processor is sent is received, wherein, the solicited message includes described treat Access the physical address information of data;
Physical address information pair with the data to be visited is obtained according to the physical address information of the data to be visited The label field answered;
Group identification information, group internal data field offset in the corresponding label domain information of the physical address information The corresponding data field of label field described in acquisition of information, wherein, each described group includes N number of label field and M data field, described Label field is corresponded with the data field and the one-to-one label field and the data field are in identical group or not Same group, the N is the natural number more than or equal to 1, and the M is the natural number more than or equal to 1 and the N is more than the M, often A label field information includes the group identification information of the data field corresponding with the label field, group internal data field offset letter Breath, described group of identification information are used to indicate the group where the data field corresponding with the label field, and data are inclined in described group It moves information and is used to indicate the data field in the offset where the data field in group.
In the first possible implementation, according in a first aspect, each label domain information also includes label position Information, data field whether effective information, " isptr " information,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, The data field whether effective information be used to indicate the corresponding data field of the label field by the processor access still It is not accessed by the processor, " isptr " information is used to indicate in the corresponding data field of the label field and stores Data source be also derived from other groups except corresponding group of the data to be visited in corresponding group of the data to be visited,
Correspondingly,
Described obtained according to the physical address information of the data to be visited is believed with the physical address of the data to be visited Corresponding label field is ceased, including:
The physical address information that the data to be visited are obtained according to the physical address information of the data to be visited corresponds to First group and label position information;
If it is determined according to the physical address information of the data to be visited first described in storage system for corresponding first group If the effective label field in existence position and believed in group according to the corresponding label position of the physical address informations of the data to be visited Breath determines in the effective label field of mode bit to exist in described first group corresponding with the physical address information of the data to be visited The equal label field of label position information, obtain label position information in the storage system in the effective label field of mode bit with The first equal label field of the corresponding label position information of physical address information of the data to be visited, wherein, it is described that there are shapes The effective label field in state position includes instruction data field and is accessed and indicated in the corresponding data field of the label field by the processor The data source of storage is in corresponding group of the data to be visited.
In second of possible realization method, with reference to first aspect, each label domain information also includes label position Information, data field whether effective information, " isptr " information,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, The data field whether effective information be used to indicate the corresponding data field of the label field by the processor access still It is not accessed by the processor, " isptr " information is used to indicate in the corresponding data field of the label field and stores Data source be also derived from other groups except corresponding group of the data to be visited in corresponding group of the data to be visited,
Correspondingly,
Described obtained according to the physical address information of the data to be visited is believed with the physical address of the data to be visited Corresponding label field is ceased, including:
The physical address information that the data to be visited are obtained according to the physical address information of the data to be visited corresponds to First group and label position information;
If it is determined according to the physical address information of the data to be visited first described in storage system for corresponding first group There is no the effective label field of mode bit in group, if alternatively, according to the physical address information of the data to be visited corresponding the If one group determines described in storage system in first group the effective label field in existence position and according to the data to be visited The corresponding label position information of physical address information determine in described first group to be not present in the effective label field of mode bit with it is described The equal label field of the corresponding label position information of physical address information of data to be visited, obtains and distributes the data to be visited Group and group internal data field offset information simultaneously distribute to the data to be visited, wherein, it is described that the effective label of mode bit is not present Domain, which includes, indicates that the corresponding data field of the label field is not accessed by the processor and indicates the corresponding institute of the label field The data source stored in data field is stated in corresponding group of the data to be visited, alternatively, indicating the corresponding institute of the label field State data field by the processor access and indicate the data source stored in the corresponding data field of the label field in except Other groups of corresponding group of the data to be visited, alternatively, indicating that the corresponding data field of the label field is not described The data source that processor accesses and indicates to store in the corresponding data field of the label field is in except the data to be visited Other groups of corresponding group.
In the third possible realization method, with reference to second of possible realization method, described obtain is treated described in distribution It accesses the group of data and organizes internal data field offset information and distribute to the data to be visited, including:
If each group of corresponding utilization rate in the storage system determines first group of corresponding utilization Rate is less than the first utilization threshold, and the utilization rate of the corresponding data field of each label field in described first group selects The minimum data field of utilization rate in the corresponding data field of each label field in described first group;
By described first group and it is first group described in the corresponding data field of each label field in utilization rate it is minimum Data field distributes to the data to be visited.
In the 4th kind of possible realization method, with reference to second of possible realization method, described obtain is treated described in distribution It accesses the group of data and organizes internal data field offset information and distribute to the data to be visited, including:
If each group of corresponding utilization rate in the storage system determines first group of corresponding utilization Rate is greater than or equal to first utilization threshold, selects to utilize in all groups in the storage system in addition to described first group Minimum second group of rate;
According in described second group of the utilization rate selection of the corresponding data field of each label field in described second group The minimum data field of utilization rate in the corresponding data field of each label field;
By described second group and it is second group described in the corresponding data field of each label field in utilization rate it is minimum Data field distributes to the data to be visited.
It is with reference to first aspect or the first possible realization method, each described in the 5th kind of possible realization method Label field also includes start address information, the end address information of the data field corresponding with the label field,
The start address information is used to indicate the starting bit address of the corresponding data field of the label field, the knot Beam address information is used to indicate the end bit address of the corresponding data field of the label field,
The solicited message also includes the granular information of the data to be visited,
Correspondingly,
Group identification information, group internal data field offset in the corresponding label domain information of the physical address information The corresponding data field of label field described in acquisition of information, including:
Read the starting bit address and knot of the corresponding data field of instruction first label field in first label field Beam bit address;
If according to determining the granular information of the physical address information of the data to be visited and the data to be visited The corresponding all data of data to be visited are stored in the corresponding data field of first label field, according to the described first mark It signs the group identification information in domain and organizes the position that internal data field offset information obtains the corresponding data field of first label field It puts;
According to the corresponding data of the first label field described in the position acquisition of the corresponding data field of first label field Domain.
It is with reference to first aspect or the first possible realization method, each described in the 6th kind of possible realization method Label field also includes start address information, the end address information of the data field corresponding with the label field,
The start address information is used to indicate the starting bit address of the corresponding data field of the label field, the knot Beam address information is used to indicate the end bit address of the corresponding data field of the label field,
The solicited message also includes the granular information of the data to be visited,
Correspondingly,
Group identification information, group internal data field offset in the corresponding label domain information of the physical address information The corresponding data field of label field described in acquisition of information, including:
If according to determining the granular information of the physical address information of the data to be visited and the data to be visited The corresponding all data of data to be visited are not stored in the corresponding data field of first label field, are obtained described in distribution Data to be visited are replaced data field and distribute to the data to be visited, wherein, the data field that is replaced is comprising described Granularity is more than and closest to the request to be visited in the corresponding varigrained data field of each label field in first group The data field of granular information.
In the 7th kind of possible realization method, with reference to the 6th kind of possible realization method,
Described obtain distributes being replaced data field and distributing to the data to be visited for the data to be visited, including:
If the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in described first group be greater than or equal to the second utilization threshold and it is first group described in Except it is described be replaced data field in addition in all varigrained data fields the utilization rate of multiple second data fields be both less than described Two access thresholds, by the multiple second data field merge into it is described be replaced data field and distribute to the data to be visited, Wherein, second data field include in described first group except it is described be replaced data field in addition in all varigrained data fields Granularity is less than the data field for being replaced data field granularity;
Alternatively,
If the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in described first group is greater than or equal to second utilization threshold and described first In group except it is described be replaced data field in addition in all varigrained data fields the utilization rate of the 3rd data field be less than described second 3rd data field is split as being replaced data field described in one or more and distributes to the number to be visited by access thresholds According to, wherein, the 3rd data field include described first group in except it is described be replaced data field in addition to all varigrained data Granularity is more than the data field for being replaced data field granularity in corresponding data field in domain;
Alternatively,
If the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in described first group is less than second utilization threshold, and data are replaced by described Distribute to the data to be visited in domain.
In the 8th kind of possible realization method, with reference to first aspect or the first possible realization method or second can The realization method or the third possible realization method of energy or the 4th kind of possible realization method or the 5th kind of possible realization side Formula or the 6th kind of possible realization method or the 7th kind of possible realization method,
The method further includes:
The corresponding label field of data field of the data to be visited is distributed to described in update.
Second aspect provides a kind of cache memory, including:
Receiving unit, for receiving the solicited message of the access data to be visited of processor transmission, wherein, the request letter Breath includes the physical address information of the data to be visited;
Acquiring unit, for obtaining the object with the data to be visited according to the physical address information of the data to be visited Manage the corresponding label field of address information;Group mark letter in the corresponding label domain information of the physical address information Breath, group internal data field offset information obtain the corresponding data field of the label field, wherein, each described group includes N number of label Domain and M data field, the label field and data field one-to-one corresponding and the one-to-one label field and the data Domain is in identical group or different groups, and the N is the natural number more than or equal to 1, and the M is the natural number more than or equal to 1 And the N is more than the M, each label field information includes the group mark letter of the data field corresponding with the label field Breath, group internal data field offset information, described group of identification information are used to indicate where the data field corresponding with the label field Group, data offset information is used to indicate the data field in the offset where the data field in group in described group
In the first possible implementation, with reference to second aspect, each label domain information also includes label position Information, data field whether effective information, " isptr " information,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, The data field whether effective information be used to indicate the corresponding data field of the label field by the processor access still It is not accessed by the processor, " isptr " information is used to indicate in the corresponding data field of the label field and stores Data source be also derived from other groups except corresponding group of the data to be visited in corresponding group of the data to be visited,
Correspondingly,
The acquiring unit is additionally operable to:The data to be visited are obtained according to the physical address information of the data to be visited Physical address information corresponding first group and label position information;
If it is determined according to the physical address information of the data to be visited first described in storage system for corresponding first group If the effective label field in existence position and believed in group according to the corresponding label position of the physical address informations of the data to be visited Breath determines in the effective label field of mode bit to exist in described first group corresponding with the physical address information of the data to be visited The equal label field of label position information, obtain label position information in the storage system in the effective label field of mode bit with The first equal label field of the corresponding label position information of physical address information of the data to be visited, wherein, it is described that there are shapes The effective label field in state position includes instruction data field and is accessed and indicated in the corresponding data field of the label field by the processor The data source of storage is in corresponding group of the data to be visited.
In second of possible realization method, with reference to second aspect, each label domain information also includes label position Information, data field whether effective information, " isptr " information,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, The data field whether effective information be used to indicate the corresponding data field of the label field by the processor access still It is not accessed by the processor, " isptr " information is used to indicate in the corresponding data field of the label field and stores Data source be also derived from other groups except corresponding group of the data to be visited in corresponding group of the data to be visited,
Correspondingly,
The acquiring unit is additionally operable to:The data to be visited are obtained according to the physical address information of the data to be visited Physical address information corresponding first group and label position information;
If it is determined according to the physical address information of the data to be visited first described in storage system for corresponding first group There is no the effective label field of mode bit in group, if alternatively, according to the physical address information of the data to be visited corresponding the If one group determines described in storage system in first group the effective label field in existence position and according to the data to be visited The corresponding label position information of physical address information determine in described first group to be not present in the effective label field of mode bit with it is described The equal label field of the corresponding label position information of physical address information of data to be visited, obtains and distributes the data to be visited Group and group internal data field offset information simultaneously distribute to the data to be visited, wherein, it is described that the effective label of mode bit is not present Domain, which includes, indicates that the corresponding data field of the label field is not accessed by the processor and indicates the corresponding institute of the label field The data source stored in data field is stated in corresponding group of the data to be visited, alternatively, indicating the corresponding institute of the label field State data field by the processor access and indicate the data source stored in the corresponding data field of the label field in except Other groups of corresponding group of the data to be visited, alternatively, indicating that the corresponding data field of the label field is not described The data source that processor accesses and indicates to store in the corresponding data field of the label field is in except the data to be visited Other groups of corresponding group.
In the third possible realization method, with reference to second of possible realization method,
The acquiring unit further includes:
Selecting module, if each group of corresponding utilization rate in the storage system determines described first group pair The utilization rate answered is less than the first utilization threshold, for the corresponding data field of each label field in described first group The utilization rate selection corresponding data field of each label field in first group in the minimum data field of utilization rate;
Distribution module, for by described first group and it is first group described in the corresponding data field of each label field in The minimum data field of utilization rate distributes to the data to be visited.
In the 4th kind of possible realization method, with reference to second of possible realization method,
The selecting module is additionally operable to:If each group of corresponding utilization rate in the storage system determines institute First group of corresponding utilization rate is stated more than or equal to first utilization threshold, selects to remove described first in the storage system Utilization rate is minimum in all groups outside group second group;According to the corresponding data field of each label field in described second group The minimum data field of utilization rate in the corresponding data field of each label field in described second group of utilization rate selection;
The distribution module is additionally operable to:By described second group and it is second group described in the corresponding number of each label field The data to be visited are distributed to according to the minimum data field of utilization rate in domain.
In the 5th kind of possible realization method, with reference to second aspect or the first possible realization method,
Each label field also the start address information comprising the data field corresponding with the label field, end ground Location information,
The start address information is used to indicate the starting bit address of the corresponding data field of the label field, the knot Beam address information is used to indicate the end bit address of the corresponding data field of the label field,
The solicited message also includes the granular information of the data to be visited,
Correspondingly,
The acquiring unit further includes:
Read through model, for reading the starting of the corresponding data field of instruction first label field in first label field Bit address and end bit address;
The acquiring unit is additionally operable to:If according to the physical address information of the data to be visited and the data to be visited Granular information determine that the corresponding all data of the data to be visited are stored in the corresponding data of first label field In domain, group identification information and group internal data field offset information in first label field obtain first label field pair The position for the data field answered;According to the first label described in the position acquisition of the corresponding data field of first label field The corresponding data field in domain.
It is each described with reference to second aspect or the first possible realization method in the 6th kind of possible realization method Label field also includes start address information, the end address information of the data field corresponding with the label field,
The start address information is used to indicate the starting bit address of the corresponding data field of the label field, the knot Beam address information is used to indicate the end bit address of the corresponding data field of the label field,
The solicited message also includes the granular information of the data to be visited,
Correspondingly,
The read through model is additionally operable to:Read the corresponding data field of instruction first label field in first label field Starting bit address and terminate bit address;
The acquiring unit is additionally operable to:If according to the physical address information of the data to be visited and the data to be visited Granular information determine that the corresponding all data of the data to be visited are not stored in the corresponding number of first label field According in domain, obtain and distribute being replaced data field and distributing to the data to be visited for the data to be visited, wherein, the quilt Replacement data domain includes granularity in the corresponding varigrained data field of each label field in described first group and is more than and most connects The data field of the granular information of the nearly request to be visited.
In the 7th kind of possible realization method, with reference to the 6th kind of possible realization method, the acquiring unit further includes:
Merging module, if the profit of the corresponding varigrained data field of each label field in described first group The utilization rate that data field is replaced described in rate is determined in described first group is greater than or equal to the second utilization threshold and described In first group except it is described be replaced data field in addition in all varigrained data fields multiple second data fields utilization rate it is all small In second access thresholds, described it be replaced data field for the multiple second data field to be merged into and distribute to described Data to be visited, wherein, second data field include in described first group except it is described be replaced data field in addition to all different grains Granularity is less than the data field for being replaced data field granularity in the data field of degree;
Alternatively,
The acquiring unit further includes:
Module is split, if the profit of the corresponding varigrained data field of each label field in described first group Be replaced described in rate is determined in described first group data field utilization rate be greater than or equal to second utilization threshold and In described first group except it is described be replaced data field in addition in all varigrained data fields the utilization rate of the 3rd data field be less than Second access thresholds, for the 3rd data field to be split as being replaced data field described in one or more and distribute to The data to be visited, wherein, the 3rd data field include described first group in except it is described be replaced data field in addition to it is all not Granularity is more than the data field for being replaced data field granularity in corresponding data field in the data field of one-size;
Alternatively,
The distribution module is additionally operable to:If each label field in described first group is corresponding varigrained The utilization rate of data field determines that the utilization rate for being replaced data field in described first group is less than the second utilization rate threshold Value, for the data field that is replaced to be distributed to the data to be visited.
In the 8th kind of possible realization method, with reference to first aspect or the first possible realization method or second can The realization method or the third possible realization method of energy or the 4th kind of possible realization method or the 5th kind of possible realization side Formula or the 6th kind of possible realization method or the 7th kind of possible realization method,
The cache memory further includes:
Updating block, for updating the corresponding label field of data field for distributing to the data to be visited.
A kind of method, equipment and system for accessing data provided in an embodiment of the present invention, will be in cache memory The attribute of label field is expanded, so that label field can both correspond to the data field of this group, can also correspond to other groups Data field, and then the data field utilization rate in cache memory is improved, it solves in the prior art due to speed buffering Label field and data field are fixed one-to-one relations and are stored separately in memory, are caused in cache memory The problem of data field utilization rate is low.
Description of the drawings
It in order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of structure diagram of N-way set associative cache memory provided in an embodiment of the present invention;
Schematic diagram when Fig. 2 is a kind of cache miss provided in an embodiment of the present invention;
Fig. 3 is a kind of method flow schematic diagram for accessing data provided in an embodiment of the present invention;
Fig. 4 is another method flow schematic diagram for accessing data provided in an embodiment of the present invention;
Fig. 5 is a kind of cache memory inner tissue structure diagram provided in an embodiment of the present invention;
Fig. 6 is another method flow schematic diagram for accessing data provided in an embodiment of the present invention;
Fig. 7 A are a kind of schematic diagram of cache miss processing module provided in an embodiment of the present invention;
Fig. 7 B are the schematic diagram of another cache miss processing module provided in an embodiment of the present invention;
Fig. 8 is another method flow schematic diagram for accessing data provided in an embodiment of the present invention;
Fig. 9 is a kind of schematic diagram for becoming granularity cache memory provided in an embodiment of the present invention;
Figure 10 is a kind of schematic device of cache memory provided in an embodiment of the present invention;
Figure 11 is the schematic device of another cache memory provided in an embodiment of the present invention;
Figure 12 is a kind of schematic device of cache memory provided in an embodiment of the present invention;
Figure 13 is the schematic device of another cache memory provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other without making creative work Embodiment belongs to the scope of protection of the invention.
On the one hand, the embodiment of the present invention provides a kind of method for accessing data, and referring to Fig. 3, this method can include following Step:
301:The solicited message for the access data to be visited that processor is sent is received, wherein, solicited message includes to be visited The physical address information of data;
Illustratively, the main body for receiving the solicited message for the access data to be visited that processor is sent can be speed buffering Memory, or memory, or other storage systems, it is not limited by the embodiments of the present invention.It is real below Example is applied to be specifically described by taking cache memory as an example.
302:It is obtained according to the physical address information of data to be visited corresponding with the physical address information of data to be visited Label field;
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Label corresponding with the physical address information of data to be visited is obtained according to the physical address information of data to be visited Domain, including:
The physical address information that data to be visited are obtained according to the physical address information of data to be visited is first group corresponding And label position information;
If determine exist in storage system in first group for corresponding first group according to the physical address information of data to be visited If the effective label field of mode bit and determining first group according to the corresponding label position information of physical address information of data to be visited In the presence of the mark that label position information corresponding with the physical address information of data to be visited is equal in the middle effective label field of mode bit Domain is signed, obtains the physical address information of the label position information and data to be visited in storage system in the effective label field of mode bit The first equal label field of corresponding label position information, wherein, the effective label field in existence position includes instruction data field quilt Processor access and in the corresponding data field in indicating label domain the data source that stores in corresponding group of data to be visited.
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Label corresponding with the physical address information of data to be visited is obtained according to the physical address information of data to be visited Domain, including:
The physical address information that data to be visited are obtained according to the physical address information of data to be visited is first group corresponding And label position information;
If it determines not deposit in first group in storage system for corresponding first group according to the physical address information of data to be visited In the effective label field of mode bit, if alternatively, determining to store according to corresponding first group of the physical address information of data to be visited If the effective label field in existence position and according to the corresponding mark of physical address information of data to be visited in first group in system Label position information determines that there is no corresponding with the physical address information of data to be visited in the effective label field of mode bit in first group The equal label field of label position information, obtain the group for distributing data to be visited and group internal data field offset information and distribute to and treat Data are accessed, wherein, there is no the effective label fields of mode bit to include the corresponding data field in indicating label domain not by processor The data source for accessing and being stored in the corresponding data field in indicating label domain is in corresponding group of data to be visited, alternatively, indicateing arm The data source that the corresponding data field in label domain is accessed by a processor and is stored in the corresponding data field in indicating label domain is in except waiting to visit Ask corresponding group of data other groups, alternatively, the corresponding data field in indicating label domain is not accessed by a processor and indicating label The data source stored in the corresponding data field in domain is in except other groups of corresponding group of data to be visited.
Illustratively, the group for distributing data to be visited and group internal data field offset information are obtained and distributes to number to be visited According to, including:
If each group of corresponding utilization rate in storage system determines that first group of corresponding utilization rate is less than the One utilization threshold, according to the utilization rate of the corresponding data field of each label field in first group select in first group The minimum data field of utilization rate in the corresponding data field of each label field;
By the minimum data field point of utilization rate in the corresponding data field of each label field in first group and first group Dispensing data to be visited.
Illustratively, the group for distributing data to be visited and group internal data field offset information are obtained and distributes to number to be visited According to, including:
If each group of corresponding utilization rate in storage system determine first group of corresponding utilization rate be more than or Equal to the first utilization threshold, select that utilization rate is minimum in all groups in storage system in addition to first group second group;
Each label in second group is selected according to the utilization rate of the corresponding data field of each label field in second group The minimum data field of utilization rate in the corresponding data field in domain;
By the minimum data field point of utilization rate in the corresponding data field of each label field in second group and second group Dispensing data to be visited.
303:Group identification information, group internal data field offset information in the corresponding label domain information of physical address information The corresponding data field of label field is obtained, wherein, each group includes N number of label field and M data field, label field and data field one One corresponds to and one-to-one label field and data field are in identical group or different groups, and N is the natural number more than or equal to 1, M Natural number and the N to be greater than or equal to 1 are more than the M, and each label field information includes data field corresponding with label field Group identification information, group internal data field offset information, group identification information be used to indicate where data field corresponding with label field Group, data offset information is used to indicate data field in the offset where data field in group in group.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly,
Group identification information, group internal data field offset information in the corresponding label domain information of physical address information obtain The corresponding data field of label field, including:
It reads the starting bit address of the corresponding data field of the first label field of instruction in the first label field and terminates bit address;
If data pair to be visited are determined according to the granular information of the physical address information of data to be visited and data to be visited All data answered are stored in the corresponding data field of the first label field, in the group identification information and group in the first label field Data field offset information obtains the position of the corresponding data field of the first label field;
According to the corresponding data field of the first label field of position acquisition of the corresponding data field of the first label field.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly,
Group identification information, group internal data field offset information in the corresponding label domain information of physical address information obtain The corresponding data field of label field, including:
It reads the starting bit address of the corresponding data field of the first label field of instruction in the first label field and terminates bit address;
If data pair to be visited are determined according to the granular information of the physical address information of data to be visited and data to be visited All data answered are not stored in the corresponding data field of the first label field, and obtain distribution data to be visited is replaced data field And data to be visited are distributed to, wherein, it is corresponding varigrained to be replaced each label field that data field is included in first group In data field granularity be more than and closest to request to be visited granular information data field.
Illustratively, obtain and distribute being replaced data field and distributing to data to be visited for data to be visited, including:
If the utilization rate of the corresponding varigrained data field of each label field in first group determines first The utilization rate for being replaced data field in group is greater than or equal in the second utilization threshold and first group in addition to data field is replaced The utilization rate of multiple second data fields is both less than the second access thresholds in all varigrained data fields, by multiple second data Domain, which is merged into, to be replaced data field and distributes to data to be visited, wherein, the second data field, which includes to remove in first group, is replaced number It is less than the data field for being replaced data field granularity according to granularity in overseas all varigrained data fields;
Alternatively,
If the utilization rate of the corresponding varigrained data field of each label field in first group determines first The utilization rate for being replaced data field in group is greater than or equal in the second utilization threshold and first group in addition to data field is replaced The utilization rate of the 3rd data field is less than the second access thresholds in all varigrained data fields, and the 3rd data field is split as one It is a or it is multiple be replaced data field and distribute to data to be visited, wherein, the 3rd data field include first group in remove by for Change outside data field in all varigrained data fields that granularity is more than the data for being replaced data field granularity in corresponding data field Domain;
Alternatively,
If the utilization rate of the corresponding varigrained data field of each label field in first group determines first The utilization rate for being replaced data field in group is less than second utilization threshold, will be replaced data field and distributes to number to be visited According to.
Illustratively, this method can also include:
More it is newly assigned to the corresponding label field of data field of data to be visited.
A kind of method for accessing data provided in an embodiment of the present invention, by the attribute of the label field in cache memory Expanded, so that label field can both correspond to the data field of this group, other groups of data field, Jin Erti can also be corresponded to Data field utilization rate in high cache memory, solves in the prior art due to label field in cache memory It is fixed one-to-one relation with data field and is stored separately, causes the data field utilization rate in cache memory low The problem of.
Above method embodiment is illustrated below by specific embodiment.
Illustratively, the application scenarios of the embodiment of the present invention include a host, which includes at least one processor, The processor includes the set associative cache of many levels.
Embodiment one
Referring to Fig. 4, for another flow diagram for accessing data provided in an embodiment of the present invention, as shown in the figure, can be with Comprise the following steps:
401:Cache memory receives the solicited message for the access data to be visited that processor is sent, wherein, request Information includes the physical address information of data to be visited and the granular information of data to be visited:
Illustratively, the physical address information of data to be visited is according to the alignment of cache line size Address.
402:Cache memory obtains data to be visited physically according to the physical address information of data to be visited Location information corresponding first group and label position information, wherein, label position information is used to indicate the corresponding data field of label field and corresponds to Physical address;
Illustratively, the physical address information of data to be visited can map this by hash algorithm of the prior art and treat Physical address information corresponding first group and the label position information of data are accessed, can also be waited to visit to obtain this by other methods Ask physical address information corresponding first group and the label position information of data, it is not limited by the embodiments of the present invention.
403:Corresponding first group according to the physical address information of data to be visited of cache memory judges slow at a high speed It rushes with the presence or absence of the effective label field of mode bit in first in memory group, wherein, each group includes N number of label field and M A data field, label field is corresponded with data field and one-to-one label field and data field are in identical group or difference Group, N are natural number more than or equal to 1, and M is the natural number more than or equal to 1 and N is more than M, each label field information include with Whether group identification information, group internal data field offset information, label position information, the data field of the corresponding data field of label field are effectively believed Breath, " isptr " information, data field whether be updated information, data field size information, " PtrS " information, start address information and End address information, group identification information are used to indicate group where data field corresponding with label field, data offset information in group Data field is used to indicate in the offset where data field in group, data field whether effective information to be used to indicate label field corresponding Data field is accessed by a processor again without being accessed by a processor, and " isptr " information is used to indicate the corresponding data field of label field The data source of middle storage is in corresponding group of other groups be also derived from except corresponding group of data to be visited of data to be visited, number Information whether is updated according to domain being used to indicate the corresponding data of label field and be updated or be not updated, data field size information is used In the size of the corresponding data field in indicating label domain, stored if " isptr " information is used to indicate in the corresponding data field of label field Data source in corresponding group of data to be visited, " PtrS " information is sky, if " isptr " information is used to indicate label field correspondence Data field in the data source that stores in except other groups of corresponding group of data to be visited, " PtrS " information is used to indicate the number According to the data source stored in domain in corresponding data field, start address information on other groups except corresponding group of data to be visited The starting bit address of the corresponding data field of label field is used to indicate, end address information is used to indicate the corresponding data field of label field End bit address;
Illustratively, in embodiments of the present invention, the data field corresponding with label field that each label field information includes Group identification information, group internal data field offset information, data field whether effective information, " isPtr " information, label position information, data Whether domain is updated information, " PtrS " information, data field initial address message (IAM), data field end address information and data field size Information can use " set ", " off ", " valid ", " isPtr ", " tag ", " dirty ", " PtrS ", " start ", " end " respectively And " size " is identified, and can also be identified respectively with other identifiers, it is not limited by the embodiments of the present invention.
It is a kind of cache memory inner tissue structure diagram provided in an embodiment of the present invention, as schemed institute referring to Fig. 5 Show, in the institutional framework of cache memory, label field and data field are not fixed one-to-one relation, label Domain can be directed toward with any one data field in same group of label field, may point to other groups of different from label field groups Data field, therefore, in the cache, the quantity N of label field is greater than or equal to the quantity of data field;In speed buffering In the physics realization of memory, expanded the attribute of label field, for example, " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ".
Illustratively, in the prior art, label field includes " tag ", " valid " and " dirty " three attributes, label position The physical address information of data bit corresponding with label position is one-to-one, and " valid " is used to refer to the corresponding number of label field Whether effective according to domain, " dirty " is used to refer to whether the corresponding data field of label field is updated.
Illustratively, in embodiments of the present invention, " tag " in label field, " valid " and " dirty " and the prior art The content indicated by " tag ", " valid " and " dirty " in the design of high speed buffer storage is identical, in the prior art Cache memory label field attribute physics realization, expanded the attribute information of label field, can in label field To increase " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ", it can also be increased in label field He some and the relevant attribute of cache replacement policy, for example, " accessCount " information can be increased, it is used for It indicates to count the frequency that the corresponding data field of each label field is accessed, it is not limited by the embodiments of the present invention.
Illustratively, " set " in label field is used to indicate the position of the group of the corresponding data field storage of the label field, should Position can be this group or other groups;" off " in label domain information is used to specify data field group where data field Interior offset, for example, the road in cache design.Illustratively, caches in the prior art Device design in, the position of data field in the cache be the data field being currently located according to the data field where group It is addressed with way, but in embodiments of the present invention, due to the institutional framework of cache memory and physics realization and now There is the difference of technology, therefore the position of data field in the cache is needed according to label field corresponding with data field The value of " set " and " off " determine the group and way where data field, so as to be obtained according to the group where data field and way Position where data field, and if the value of " set " is not the group that data field is currently located, " set " and " off " can conducts The label field of other groups is directed toward, what the corresponding data field of the label field was stored is the data of this label field corresponding address.
" start " and " end " in label field is used for identifying corresponding to the data in the corresponding data field of the label field Initial address and end address, " start " and " end " are the offsets in relatively high speed cache lines maximum particle size.For example, If cache line maximum particle size is 64 bytes, and the data length in data field only has 8 bytes and 8 byte is firm It is preceding 8 bytes in 64 bytes well, then the initial address of the data is 0, and end address is then 7.
Illustratively, be the effective label field in existence position include data field whether effective information effectively and " isPtr " Information is effective, if whether effective information is represented the data field in label field with " valid ", " isPtr " information with " isPtr " come It represents, then " valid " is accessed by a processor effective for instruction data field, can represent " valid " effectively with " is ", " valid " invalid data field that is used to indicate is not accessed by a processor, and can represent that " valid " is invalid with " no ";“isPtr” Data source effective for being stored in the corresponding data field in indicating label domain can use " no " in corresponding group of data to be visited Represent " isPtr " effectively, " isPtr " invalid to be used to indicate the data source that stores in the corresponding data field of label field in except treating Other groups of corresponding group of data are accessed, can represent that " isPtr " is invalid with " is ".It is effectively marked accordingly, there exist mode bit Label domain can be " is " comprising " valid " and " isPtr " position is " no ".
The no effective label field in existence position is " no " comprising " valid " and " isPtr " position is " no ", alternatively, " valid " is " is " and " isPtr " position is " is ", alternatively, " valid " is " no " and " isPtr " position is " is ".
404:If it is determined that in cache memory first group be the effective label field in existence position, caches Device judges that mode bit is effective in cache memory according to the corresponding label position information of physical address information of data to be visited Label field in the presence or absence of the equal label field in label position corresponding with the physical address information of data to be visited;
405:If it is determined that it is the object existed with data to be visited in the effective label field of mode bit in cache memory The first equal label field of the corresponding label position information of address information is managed, cache memory reads the finger in the first label field Show the starting bit address of the corresponding data field of first label field and terminate bit address;
406:Cache memory according to the physical address information of data to be visited and the granular information of data to be visited, Judge whether the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field;
Illustratively, judge data to be visited can will be waited to visit when whether being stored in the corresponding data field of the first data field It asks that the physical address of data aligns with the initial address position in the first data field, then is judged by the granular information of data to be visited Whether data to be visited are stored in the corresponding data field of the first data field, for example, the initial address position in the first data field is 0 It is the data of 8 totally 9 byte-sizeds with termination address position, and the initial address of the physical address information of data to be visited is 3, grain It is 10 to spend information, then by the starting of the initial address 3 of the physical address of data to be visited data field corresponding with the first data field Address bit 0 aligns, and is checked one by one, when the corresponding data field of the first data field reaches end address 8, number to be visited According to physical address reach 11, only 9 bytes, and the granularity of information to be visited be 10 bytes, therefore, it is possible to determine that be visited Data can not be stored in the corresponding data field of the first data field.
407:If it is determined that the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field, Group identification information and group internal data field offset information of the cache memory in the first label field obtain the first label field The position of corresponding data field;
408:Cache memory is corresponded to according to the first label field of position acquisition of the corresponding data field of the first data field Data field;
409:If it is determined according to the physical address information of data to be visited in cache memory for corresponding first group The no effective label field in existence position in one group, if alternatively, according to the physical address information of data to be visited corresponding first If in the definite storage system of group in first group it is the effective label field in existence position and according to the physical address of data to be visited The corresponding label position information of information determines in first group no in the effective label field of mode bit to exist and the physics of data to be visited The equal label field of the corresponding label position information of address information obtains the group for distributing data to be visited and group internal data field offset letter It ceases and distributes to data to be visited, wherein, the no effective label field in existence position includes the corresponding data field in indicating label domain The data source for not being accessed by a processor and being stored in the corresponding data field in indicating label domain in corresponding group of data to be visited, Alternatively, the data that the corresponding data field in indicating label domain is accessed by a processor and is stored in the corresponding data field in indicating label domain are come Other groups except corresponding group of data to be visited are come from, alternatively, the corresponding data field in indicating label domain is not accessed by a processor And the data source stored in the corresponding data field in indicating label domain is in except other groups of corresponding group of data to be visited;
Illustratively, cache memory can be according to the corresponding data field of each label field in first group Utilization rate obtains the group for distributing data to be visited and group internal data field offset information and distributes to data to be visited, can also take Other methods obtain the group for distributing data to be visited and group internal data field offset information and distribute to data to be visited, the present invention Embodiment is not limited this.
410:If number to be visited is determined according to the granular information of the physical address information of data to be visited and data to be visited It is stored according to corresponding all data are no in the corresponding data field of the first label field, obtain distribution data to be visited is replaced number According to domain and data to be visited are distributed to, wherein, it is replaced data field and includes the corresponding different grains of each label field in first group In the data field of degree granularity be more than and closest to request to be visited granular information data field.
Illustratively, cache memory can be according to each mark in the granular information of data to be visited and first group The utilization rate of the corresponding data field in label domain, which obtains, distributes being replaced data field and distributing to number to be visited for data to be visited According to, other methods can also be taken to obtain being replaced data field and distributing to data to be visited for distribution data to be visited, It is not limited by the embodiments of the present invention.
411:More it is newly assigned to the corresponding label field of data field of data to be visited.
Illustratively, in step 409, if each label field of the cache memory in first group corresponds to respectively The utilization rate of data field obtain the group for distributing data to be visited and group internal data field offset information and distribute to data to be visited, The group of the distribution data to be visited then obtained is first group, and therefore, it is necessary to will distribute to the data field of data to be visited to correspond to Label field in " tag " each attribute information for being changed in the corresponding label position information of data to be visited be updated to wait to visit with this Ask data corresponding attribute information.
In step 410, if cache memory can be according in the granular information of data to be visited and first group The utilization rate of the corresponding data field of each label field, which obtains, distributes being replaced data field and distribute to and treating for data to be visited Data are accessed, then need " tag " in the corresponding label field of the data field for distributing to data to be visited being changed to number to be visited Attribute information corresponding with the data to be visited is updated to according to each attribute information in the information of corresponding label position.
A kind of method for accessing data provided in an embodiment of the present invention, by the attribute of the label field in cache memory Expanded, so that label field can both correspond to the data field of this group, other groups of data field, Jin Erti can also be corresponded to Data field utilization rate in high cache memory, solves in the prior art due to label field in cache memory It is fixed one-to-one relation with data field and is stored separately, causes the data field utilization rate in cache memory low The problem of.
Embodiment two
Referring to Fig. 6, for another flow diagram for accessing data provided in an embodiment of the present invention, as shown in the figure, can be with Comprise the following steps:
601:Cache memory receives the solicited message for the access data to be visited that processor is sent, wherein, request Information includes the physical address information of data to be visited and the granular information of data to be visited;
Illustratively, the physical address information of data to be visited is according to the alignment of cache line size Address.
602:Cache memory obtains data to be visited physically according to the physical address information of data to be visited Location information corresponding first group and label position information, wherein, label position information is used to indicate the corresponding data field of label field and corresponds to Physical address;
Illustratively, the physical address information of data to be visited can map this by hash algorithm of the prior art and treat Physical address information corresponding first group and the label position information of data are accessed, can also be waited to visit to obtain this by other methods Ask physical address information corresponding first group and the label position information of data, it is not limited by the embodiments of the present invention.
603:Corresponding first group according to the physical address information of data to be visited of cache memory judges slow at a high speed It rushes with the presence or absence of the effective label field of mode bit in first in memory group, wherein, each group includes N number of label field and M A data field, label field is corresponded with data field and one-to-one label field and data field are in identical group or difference Group, N are natural number more than or equal to 1, and M is the natural number more than or equal to 1 and N is more than M, each label field information include with Whether group identification information, group internal data field offset information, label position information, the data field of the corresponding data field of label field are effectively believed Breath, " isptr " information, data field whether be updated information, data field size information, " PtrS " information, start address information and End address information, group identification information are used to indicate group where data field corresponding with label field, data offset information in group Data field is used to indicate in the offset where data field in group, data field whether effective information to be used to indicate label field corresponding Data field is accessed by a processor again without being accessed by a processor, and " isptr " information is used to indicate the corresponding data field of label field The data source of middle storage is in corresponding group of other groups be also derived from except corresponding group of data to be visited of data to be visited, number Information whether is updated according to domain being used to indicate the corresponding data of label field and be updated or be not updated, data field size information is used In the size of the corresponding data field in indicating label domain, stored if " isptr " information is used to indicate in the corresponding data field of label field Data source in corresponding group of data to be visited, " PtrS " information is sky, if " isptr " information is used to indicate label field correspondence Data field in the data source that stores in except other groups of corresponding group of data to be visited, " PtrS " information is used to indicate the number According to the data source stored in domain in corresponding data field, start address information on other groups except corresponding group of data to be visited The starting bit address of the corresponding data field of label field is used to indicate, end address information is used to indicate the corresponding data field of label field End bit address;
Illustratively, in embodiments of the present invention, the data field corresponding with label field that each label field information includes Group identification information, group internal data field offset information, data field whether effective information, " isPtr " information, label position information, data Whether domain is updated information, " PtrS " information, data field initial address message (IAM), data field end address information and data field size Information can use " set ", " off ", " valid ", " isPtr ", " tag ", " dirty ", " PtrS ", " start ", " end " respectively And " size " is identified, and can also be identified respectively with other identifiers, it is not limited by the embodiments of the present invention.
It is a kind of cache memory inner tissue structure diagram provided in an embodiment of the present invention, as schemed institute referring to Fig. 5 Show, in the institutional framework of cache memory, label field and data field are not fixed one-to-one relation, label Domain can be directed toward with any one data field in same group of label field, may point to other groups of different from label field groups Data field, therefore, in the cache, the quantity N of label field is greater than or equal to the quantity of data field;In speed buffering In the physics realization of memory, expanded the attribute of label field, for example, " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ".
Illustratively, in the prior art, label field includes " tag ", " valid " and " dirty " three attributes, label position The physical address information of data bit corresponding with label position is one-to-one, and " valid " is used to refer to the corresponding number of label field Whether effective according to domain, " dirty " is used to refer to whether the corresponding data field of label field is updated.
Illustratively, in embodiments of the present invention, " tag " in label field, " valid " and " dirty " and the prior art The content indicated by " tag ", " valid " and " dirty " in the design of high speed buffer storage is identical, in the prior art Cache memory label field attribute physics realization, expanded the attribute information of label field, can in label field To increase " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ", it can also be increased in label field He some and the relevant attribute of cache replacement policy, for example, " accessCount " information can be increased, it is used for It indicates to count the frequency that the corresponding data field of each label field is accessed, it is not limited by the embodiments of the present invention.
Illustratively, " set " in label field is used to indicate the position of the group of the corresponding data field storage of the label field, should Position can be this group or other groups;" off " in label domain information is used to specify data field group where data field Interior offset, for example, the road in cache design.Illustratively, caches in the prior art Device design in, the position of data field in the cache be the data field being currently located according to the data field where group It is addressed with way, but in embodiments of the present invention, due to the institutional framework of cache memory and physics realization and now There is the difference of technology, therefore the position of data field in the cache is needed according to label field corresponding with data field The value of " set " and " off " determine the group and way where data field, so as to be obtained according to the group where data field and way Position where data field, and if the value of " set " is not the group that data field is currently located, " set " and " off " can conducts The label field of other groups is directed toward, what the corresponding data field of the label field was stored is the data of this label field corresponding address.
" start " and " end " in label field is used for identifying corresponding to the data in the corresponding data field of the label field Initial address and end address, " start " and " end " are the offsets in relatively high speed cache lines maximum particle size.For example, If cache line maximum particle size is 64 bytes, and the data length in data field only has 8 bytes and 8 byte is firm It is preceding 8 bytes in 64 bytes well, then the initial address of the data is 0, and end address is then 7.
Illustratively, be the effective label field in existence position include data field whether effective information effectively and " isPtr " Information is effective, if whether effective information is represented the data field in label field with " valid ", " isPtr " information with " isPtr " come It represents, then " valid " is accessed by a processor effective for instruction data field, can represent " valid " effectively with " is ", " valid " invalid data field that is used to indicate is not accessed by a processor, and can represent that " valid " is invalid with " no ";“isPtr” Data source effective for being stored in the corresponding data field in indicating label domain can use " no " in corresponding group of data to be visited Represent " isPtr " effectively, " isPtr " invalid to be used to indicate the data source that stores in the corresponding data field of label field in except treating Other groups of corresponding group of data are accessed, can represent that " isPtr " is invalid with " is ".It is effectively marked accordingly, there exist mode bit Label domain can be " is " comprising " valid " and " isPtr " position is " no ".
The no effective label field in existence position is " no " comprising " valid " and " isPtr " position is " no ", alternatively, " valid " is " is " and " isPtr " position is " is ", alternatively, " valid " is " no " and " isPtr " position is " is ".
604:If it is determined that in cache memory first group be the effective label field in existence position, caches Device judges that mode bit is effective in cache memory according to the corresponding label position information of physical address information of data to be visited Label field in the presence or absence of the equal label field in label position corresponding with the physical address information of data to be visited;
605:If it is determined that it is the object existed with data to be visited in the effective label field of mode bit in cache memory The first equal label field of the corresponding label position information of address information is managed, cache memory reads the finger in the first label field Show the starting bit address of the corresponding data field of first label field and terminate bit address;
606:Cache memory according to the physical address information of data to be visited and the granular information of data to be visited, Judge whether the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field;
Illustratively, judge data to be visited can will be waited to visit when whether being stored in the corresponding data field of the first data field It asks that the physical address of data aligns with the initial address position in the first data field, then is judged by the granular information of data to be visited Whether data to be visited are stored in the corresponding data field of the first data field, for example, the initial address position in the first data field is 0 It is the data of 8 totally 9 byte-sizeds with termination address position, and the initial address of the physical address information of data to be visited is 3, grain It is 10 to spend information, then by the starting of the initial address 3 of the physical address of data to be visited data field corresponding with the first data field Address bit 0 aligns, and is checked one by one, when the corresponding data field of the first data field reaches end address 8, number to be visited According to physical address reach 11, only 9 bytes, and the granularity of information to be visited be 10 bytes, therefore, it is possible to determine that be visited Data can not be stored in the corresponding data field of the first data field.
607:If it is determined that the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field, Group identification information and group internal data field offset information of the cache memory in the first label field obtain the first label field The position of corresponding data field;
608:Cache memory is corresponded to according to the first label field of position acquisition of the corresponding data field of the first data field Data field;
609:If it is determined according to the physical address information of data to be visited in cache memory for corresponding first group The no effective label field in existence position in one group, if alternatively, according to the physical address information of data to be visited corresponding first If in the definite storage system of group in first group it is the effective label field in existence position and according to the physical address of data to be visited The corresponding label position information of information determines in first group no in the effective label field of mode bit to exist and the physics of data to be visited The equal label field of the corresponding label position information of address information, each group of corresponding profit in cache memory Judge whether first group of corresponding utilization rate is greater than or equal to the first utilization threshold with rate;
Illustratively, the first utilization threshold can be uneven according to occurring utilization rate between each group in cache memory The utilization rate of weighing apparatus and the utilization rate of each group obtain, and can also obtain otherwise, the embodiment of the present invention to this not into Row limitation.
Illustratively, utilization rate can be obtained by counting the request access times of each set, can also pass through other sides Formula obtains, and it is not limited by the embodiments of the present invention.
Illustratively, in the prior art, only have speed buffering in set in cache miss processing module to deposit Reservoir replacement module, referring to Fig. 7 A, cache miss processing module utilizes cache memory replacement plan in group The replacement item of data to be visited slightly is selected, for example, least recently used (Least Recently Used, abbreviation LRU) is calculated Method according to the utilization rate in each label field corresponding data domain in corresponding group of data to be visited, selects a suitable data field work To be replaced item.Due to only considering the corresponding data field of each label field in corresponding group of data to be visited in the prior art Utilization rate, if it is very high not account for group utilization rate itself, the profit of the corresponding data field of each label field in the group It is also very high with rate, if other groups of utilization rate is very low in cache memory, cache miss processing The Physical realization of module is present with each group in cache memory and asks utilization rate unbalanced phenomenon.
The problem of bringing for the above-mentioned prior art, the embodiment of the present invention are taken in cache miss processing Each group utilization rate statistical module is added in module, referring to Fig. 7 B, is lacked for cache memory provided in an embodiment of the present invention Processing module schematic diagram is lost, including cache memory replacement module in each group utilization rate statistical module and group.Each group utilizes The major function of rate statistical module is the utilization rates of different groups in statistics of high speed buffer storage, and judge according to this each group ask whether There are the unbalanced phenomenon of utilization rate, if for example, highest group of utilization rate and utilization rate are minimum in cache memory The difference of utilization rate between group has been more than some threshold value, then may determine that between group the unbalanced phenomenon of utilization rate occur.Cause This, overcomes in the cache memory occurred in the prior art the unbalanced phenomenon of utilization rate between group.
610:If it is determined that first group of utilization rate is no to be greater than or equal to the first utilization threshold, cache memory according to The utilization rate of the corresponding data field of each label field selects the minimum data field of the utilization rate in first group in first group;
611:Cache memory will be sharp in the corresponding data field of each label field in first group and first group Data to be visited are distributed to the minimum data field of rate;
612:If it is determined that first group of utilization rate is greater than or equal to the first utilization threshold, cache memory selection Utilization rate is minimum in all groups in cache memory in addition to first group second group;
613:Cache memory is selected according to the utilization rate of the corresponding data field of each label field in second group The minimum data field of utilization rate in the corresponding data field of each label field in second group;
614:Cache memory will be sharp in the corresponding data field of each label field in second group and second group Data to be visited are distributed to the minimum data field of rate;
615:If number to be visited is determined according to the granular information of the physical address information of data to be visited and data to be visited It is stored according to corresponding all data are no in the corresponding data field of the first label field, it is to be visited that cache memory obtains distribution Data are replaced data field and distribute to data to be visited, wherein, it is replaced data field and includes each label in first group In the corresponding varigrained data field in domain granularity be more than and closest to request to be visited granular information data field.
Illustratively, cache memory can be according to each mark in the granular information of data to be visited and first group The utilization rate of the corresponding data field in label domain, which obtains, distributes being replaced data field and distributing to number to be visited for data to be visited According to, other methods can also be taken to obtain being replaced data field and distributing to data to be visited for distribution data to be visited, It is not limited by the embodiments of the present invention.
616:Cache memory is more newly assigned to the corresponding label field of data field of data to be visited.
Illustratively, if the data field group for distributing to data to be visited of selection is the group where data field, need " tag " in the corresponding label field of the data field for distributing to data to be visited is changed to the corresponding label position letter of data to be visited Each attribute information in breath is updated to attribute information corresponding with the data to be visited.According to the category of " dirtv " in the label field Property judges whether to need to write back to the data in current data field in next stage cache memory or memory.It will divide again " tag " in the corresponding label field of data field of dispensing data to be visited is changed in the corresponding label position information of data to be visited Each attribute information be updated to attribute information corresponding with the data to be visited.
If the group of selection is not that request to be visited is first group corresponding, need the label field in first group and selection Label field in group is updated all in accordance with the attribute of data to be visited.
A kind of method for accessing data provided in an embodiment of the present invention, by the attribute of the label field in cache memory Expanded, so that label field can both correspond to the data field of this group, other groups of data field, Jin Erti can also be corresponded to Data field utilization rate in high cache memory, solves in the prior art due to label field in cache memory It is fixed one-to-one relation with data field and is stored separately, causes the data field utilization rate in cache memory low The problem of.
Embodiment three
Referring to Fig. 8, for another flow diagram for accessing data provided in an embodiment of the present invention, as shown in the figure, can be with Comprise the following steps:
801:Cache memory receives the solicited message for the access data to be visited that processor is sent, wherein, request Information includes the physical address information of data to be visited and the granular information of data to be visited;
Illustratively, the physical address information of data to be visited is according to the alignment of cache line size Address.
802:Cache memory obtains data to be visited physically according to the physical address information of data to be visited Location information corresponding first group and label position information, wherein, label position information is used to indicate the corresponding data field of label field and corresponds to Physical address;
Illustratively, the physical address information of data to be visited can map this by hash algorithm of the prior art and treat Physical address information corresponding first group and the label position information of data are accessed, can also be waited to visit to obtain this by other methods Ask physical address information corresponding first group and the label position information of data, it is not limited by the embodiments of the present invention.
803:Corresponding first group according to the physical address information of data to be visited of cache memory judges slow at a high speed It rushes with the presence or absence of the effective label field of mode bit in first in memory group, wherein, each group includes N number of label field and M A data field, label field is corresponded with data field and one-to-one label field and data field are in identical group or difference Group, N are natural number more than or equal to 1, and M is the natural number more than or equal to 1 and N is more than M, each label field information include with Whether group identification information, group internal data field offset information, label position information, the data field of the corresponding data field of label field are effectively believed Breath, " isptr " information, data field whether be updated information, data field size information, " PtrS " information, start address information and End address information, group identification information are used to indicate group where data field corresponding with label field, data offset information in group Data field is used to indicate in the offset where data field in group, data field whether effective information to be used to indicate label field corresponding Data field is accessed by a processor again without being accessed by a processor, and " isptr " information is used to indicate the corresponding data field of label field The data source of middle storage is in corresponding group of other groups be also derived from except corresponding group of data to be visited of data to be visited, number Information whether is updated according to domain being used to indicate the corresponding data of label field and be updated or be not updated, data field size information is used In the size of the corresponding data field in indicating label domain, stored if " isptr " information is used to indicate in the corresponding data field of label field Data source in corresponding group of data to be visited, " PtrS " information is sky, if " isptr " information is used to indicate label field correspondence Data field in the data source that stores in except other groups of corresponding group of data to be visited, " PtrS " information is used to indicate the number According to the data source stored in domain in corresponding data field, start address information on other groups except corresponding group of data to be visited The starting bit address of the corresponding data field of label field is used to indicate, end address information is used to indicate the corresponding data field of label field End bit address;
Illustratively, in embodiments of the present invention, the data field corresponding with label field that each label field information includes Group identification information, group internal data field offset information, data field whether effective information, " isPtr " information, label position information, data Whether domain is updated information, " PtrS " information, data field initial address message (IAM), data field end address information and data field size Information can use " set ", " off ", " valid ", " isPtr ", " tag ", " dirty ", " PtrS ", " start ", " end " respectively And " size " is identified, and can also be identified respectively with other identifiers, it is not limited by the embodiments of the present invention.
It is a kind of cache memory inner tissue structure diagram provided in an embodiment of the present invention, as schemed institute referring to Fig. 5 Show, in the institutional framework of cache memory, label field and data field are not fixed one-to-one relation, label Domain can be directed toward with any one data field in same group of label field, may point to other groups of different from label field groups Data field, therefore, in the cache, the quantity N of label field is greater than or equal to the quantity of data field;In speed buffering In the physics realization of memory, expanded the attribute of label field, for example, " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ".
Illustratively, in the prior art, label field includes " tag ", " valid " and " dirty " three attributes, label position The physical address information of data bit corresponding with label position is one-to-one, and " valid " is used to refer to the corresponding number of label field Whether effective according to domain, " dirty " is used to refer to whether the corresponding data field of label field is updated.
Illustratively, in embodiments of the present invention, " tag " in label field, " valid " and " dirty " and the prior art The content indicated by " tag ", " valid " and " dirty " in the design of high speed buffer storage is identical, in the prior art Cache memory label field attribute physics realization, expanded the attribute information of label field, can in label field To increase " set ", " off ", " isPtr ", " PtrS ", " start ", " end " and " size ", it can also be increased in label field He some and the relevant attribute of cache replacement policy, for example, " accessCount " information can be increased, it is used for It indicates to count the frequency that the corresponding data field of each label field is accessed, it is not limited by the embodiments of the present invention.
Illustratively, " set " in label field is used to indicate the position of the group of the corresponding data field storage of the label field, should Position can be this group or other groups;" off " in label domain information is used to specify data field group where data field Interior offset, for example, the road in cache design.Illustratively, caches in the prior art Device design in, the position of data field in the cache be the data field being currently located according to the data field where group It is addressed with way, but in embodiments of the present invention, due to the institutional framework of cache memory and physics realization and now There is the difference of technology, therefore the position of data field in the cache is needed according to label field corresponding with data field The value of " set " and " off " determine the group and way where data field, so as to be obtained according to the group where data field and way Position where data field, and if the value of " set " is not the group that data field is currently located, " set " and " off " can conducts The label field of other groups is directed toward, what the corresponding data field of the label field was stored is the data of this label field corresponding address.
" start " and " end " in label field is used for identifying corresponding to the data in the corresponding data field of the label field Initial address and end address, " start " and " end " are the offsets in relatively high speed cache lines maximum particle size.For example, If cache line maximum particle size is 64 bytes, and the data length in data field only has 8 bytes and 8 byte is firm It is preceding 8 bytes in 64 bytes well, then the initial address of the data is 0, and end address is then 7.
Illustratively, be the effective label field in existence position include data field whether effective information effectively and " isPtr " Information is effective, if whether effective information is represented the data field in label field with " valid ", " isPtr " information with " isPtr " come It represents, then " valid " is accessed by a processor effective for instruction data field, can represent " valid " effectively with " is ", " valid " invalid data field that is used to indicate is not accessed by a processor, and can represent that " valid " is invalid with " no ";“isPtr” Data source effective for being stored in the corresponding data field in indicating label domain can use " no " in corresponding group of data to be visited Represent " isPtr " effectively, " isPtr " invalid to be used to indicate the data source that stores in the corresponding data field of label field in except treating Other groups of corresponding group of data are accessed, can represent that " isPtr " is invalid with " is ".It is effectively marked accordingly, there exist mode bit Label domain can be " is " comprising " valid " and " isPtr " position is " no ".
The no effective label field in existence position is " no " comprising " valid " and " isPtr " position is " no ", alternatively, " valid " is " is " and " isPtr " position is " is ", alternatively, " valid " is " no " and " isPtr " position is " is ".
804:If it is determined that in cache memory first group be the effective label field in existence position, caches Device judges that mode bit is effective in cache memory according to the corresponding label position information of physical address information of data to be visited Label field in the presence or absence of the equal label field in label position corresponding with the physical address information of data to be visited;
805:If it is determined that it is the object existed with data to be visited in the effective label field of mode bit in cache memory The first equal label field of the corresponding label position information of address information is managed, cache memory reads the finger in the first label field Show the starting bit address of the corresponding data field of first label field and terminate bit address;
806:Cache memory according to the physical address information of data to be visited and the granular information of data to be visited, Judge whether the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field;
Illustratively, judge data to be visited can will be waited to visit when whether being stored in the corresponding data field of the first data field It asks that the physical address of data aligns with the initial address position in the first data field, then is judged by the granular information of data to be visited Whether data to be visited are stored in the corresponding data field of the first data field, for example, the initial address position in the first data field is 0 It is the data of 8 totally 9 byte-sizeds with termination address position, and the initial address of the physical address information of data to be visited is 3, grain It is 10 to spend information, then by the starting of the initial address 3 of the physical address of data to be visited data field corresponding with the first data field Address bit 0 aligns, and is checked one by one, when the corresponding data field of the first data field reaches end address 8, number to be visited According to physical address reach 11, only 9 bytes, and the granularity of information to be visited be 10 bytes, therefore, it is possible to determine that be visited Data can not be stored in the corresponding data field of the first data field.
807:If it is determined that the corresponding all data of data to be visited are all stored in the corresponding data field of the first data field, Group identification information and group internal data field offset information of the cache memory in the first label field obtain the first label field The position of corresponding data field;
808:Cache memory is corresponded to according to the first label field of position acquisition of the corresponding data field of the first data field Data field;
809:If it is determined according to the physical address information of data to be visited in cache memory for corresponding first group The no effective label field in existence position in one group, if alternatively, according to the physical address information of data to be visited corresponding first If in the definite storage system of group in first group it is the effective label field in existence position and according to the physical address of data to be visited The corresponding label position information of information determines in first group no in the effective label field of mode bit to exist and the physics of data to be visited The equal label field of the corresponding label position information of address information, cache memory obtain the group and group for distributing data to be visited Internal data field offset information simultaneously distributes to data to be visited, wherein, the no effective label field in existence position includes indicating label The data source that the corresponding data field in domain is not accessed by a processor and is stored in the corresponding data field in indicating label domain is in waiting to visit Corresponding group of data are asked, alternatively, the corresponding data field in indicating label domain is accessed by a processor and the corresponding data in indicating label domain The data source stored in domain is in except other groups of corresponding group of data to be visited, alternatively, the corresponding data field in indicating label domain The data source for not being accessed by a processor and being stored in the corresponding data field in indicating label domain is in except data to be visited are corresponding Other groups of group;
Illustratively, cache memory can be according to the corresponding data field of each label field in first group Utilization rate obtains the group for distributing data to be visited and group internal data field offset information and distributes to data to be visited, can also take Other methods obtain the group for distributing data to be visited and group internal data field offset information and distribute to data to be visited, the present invention Embodiment is not limited this.
810:If it is determined according to the granular information of the physical address information of the data to be visited and the data to be visited The corresponding all data of the data to be visited are not stored in the corresponding data field of first label field, judge first Whether the utilization rate for being replaced data field in group is greater than or equal to the second utilization threshold, wherein, it is replaced data field and includes In the corresponding varigrained data field of each label field in first group granularity be more than and closest to request to be visited granularity The data field of information;
Illustratively, the second utilization threshold can be according to each label field pair in cache memory each group The utilization rate for occurring the unbalanced utilization rate of utilization rate and the corresponding data field of each label field between the data field answered is come It obtains, can also obtain otherwise, it is not limited by the embodiments of the present invention.
Illustratively, utilization rate can be obtained by the request access times in statistics domain, can also be by other Mode obtains, and it is not limited by the embodiments of the present invention.
811:If the utilization rate of the corresponding varigrained data field of each label field in first group determines The utilization rate for being replaced data field in first group, which is greater than or equal to remove in the second utilization threshold and first group, is replaced number The second access thresholds, speed buffering are both less than according to the utilization rate of multiple second data fields in overseas all varigrained data fields Memory, which merges into multiple second data fields, to be replaced data field and distributes to data to be visited, wherein, the second data field bag Containing granularity is less than and is replaced the number of data field granularity in all varigrained data fields in addition to data field is replaced in first group According to domain;
Illustratively, in the prior art, the size of the data field in cache line is sent out according to processor It send and accesses the granular information of data to be visited to distribute the data field of needs, data field is big in each cache line Small is exactly the size for the data to be visited that processor is sent.Therefore, the size of data field is directly related with data to be visited And it is arbitrary.In order to improve efficiency, the data that address is continuous but is in different cache lines are merged into one A big cache line.Become granularity cache line to realize, cache line is got the bid Label domain is continuously stored in together with being stored with data field in same cache memory, each in cache memory Storage unit can both store label field, it is also possible to store data field.The size of each cache line is according to waiting to visit The granular information of data is asked to determine, each label field adds additional attribute respectively, for example, starting byte number, terminate Byte number.This method can ensure that the content in cache line is all really effectively accessed, and there is no skies Not busy not accessed data, but since each storage unit may be label field, and the access that each processor is sent is treated Cache memory is required for comparing " tag " the position mark corresponding with data to be visited in label field when accessing the request of data It whether equal signs position, thus one comparator of increase is required in the adjacent storage unit of each two, cause entire speed buffering The structure needs of memory make very big modification, and can substantially increase delay and power consumption.
Problem present in for the above-mentioned prior art, the embodiment of the present invention propose a kind of change granularity caches The realization method of device is a kind of schematic diagram for becoming granularity cache memory provided in an embodiment of the present invention, such as referring to Fig. 9 Shown in figure, the length of data field and data field that cache memory includes a variety of granularities is variable.In speed buffering Request grain size statistics module is added in memory and data field merges and splits module and becomes granularity data domain to realize, asks grain Degree statistical module is mainly used for counting the utilization rate of different grain size request;And data field merges and splits module be mainly used for will be big The data field of granularity is split as the data field of multiple small grain sizes and the data field of multiple small grain sizes is merged into the number of big granularity According to domain.When data field merges and are merged into the data block of one big granularity by the data block of adjacent small grain size for fractionation module, Need to be respectively modified " start ", " end " and " size " in a label field wherein corresponding with each small grain size data block simultaneously Attribute, and extra data field is set to it is invalid;The data field of big granularity is split as when data field merges and split module , it is necessary to " start " and " end " in the corresponding label position of the data field for changing big granularity simultaneously during the data field of multiple small grain sizes Position and " size ", it is the data field of a small grain size of the label position with wherein splitting is corresponding, it is also necessary to distribute additional label Domain corresponds to other data fields after splitting.
812:If the utilization rate of the corresponding varigrained data field of each label field in first group determines The utilization rate for being replaced data field in first group, which is greater than or equal to remove in the second utilization threshold and first group, is replaced number It is less than the second access thresholds, cache memory according to the utilization rate of the 3rd data field in overseas all varigrained data fields 3rd data field is split as one or more to be replaced data field and distribute to data to be visited, wherein, the 3rd data field bag Containing in first group in addition to data field is replaced in all varigrained data fields in corresponding data field granularity be more than be replaced The data field of data field granularity;
813:If the utilization rate of the corresponding varigrained data field of each label field in first group determines The utilization rate for being replaced data field in first group is no to be greater than or equal to the second utilization threshold, cache memory will by for It changes data field and distributes to data to be visited.
814:Cache memory is more newly assigned to the corresponding label field of data field of data to be visited.
Illustratively, cache memory is more newly assigned to the attribute of the corresponding label field of data field of data to be visited Information is specifically described in step 811.
A kind of method for accessing data provided in an embodiment of the present invention, by the attribute of the label field in cache memory Expanded, so that label field can both correspond to the data field of this group, other groups of data field, Jin Erti can also be corresponded to Data field utilization rate in high cache memory, solves in the prior art due to label field in cache memory It is fixed one-to-one relation with data field and is stored separately, causes the data field utilization rate in cache memory low The problem of.
Illustratively, the application scenarios of the embodiment of the present invention include a host, which includes at least one processor, The processor includes the set associative cache of many levels.
On the other hand, the embodiment of the present invention provides a kind of cache memory 10, as shown in either of figures 10 or 11, can wrap It includes:
Receiving unit 1001, for receiving the solicited message of the access data to be visited of processor transmission, wherein, request letter Breath includes the physical address information of the data to be visited;
Acquiring unit 1002, for being obtained according to the physical address information of data to be visited with data to be visited physically The corresponding label field of location information;Group identification information, group internal data field in the corresponding label domain information of physical address information Offset information obtains the corresponding data field of label field, wherein, each group comprising N number of label field and M data field, label field and The data field corresponds and one-to-one label field and data field are in identical group or different groups, and N is to be more than or wait In 1 natural number, M is the natural number more than or equal to 1 and N is more than M, and each label field information includes number corresponding with label field According to the group identification information in domain, group internal data field offset information, group identification information is used to indicate data field institute corresponding with label field Group, data offset information is used to indicate data field in the offset where data field in group in group.
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Acquiring unit 1002 is additionally operable to:Data to be visited are obtained physically according to the physical address information of data to be visited Location information corresponding first group and label position information;
If determine exist in storage system in first group for corresponding first group according to the physical address information of data to be visited If the effective label field of mode bit and determining first group according to the corresponding label position information of physical address information of data to be visited In the presence of the mark that label position information corresponding with the physical address information of data to be visited is equal in the middle effective label field of mode bit Domain is signed, obtains the physical address information of the label position information and data to be visited in storage system in the effective label field of mode bit The first equal label field of corresponding label position information, wherein, the effective label field in existence position includes instruction data field quilt Processor access and in the corresponding data field in indicating label domain the data source that stores in corresponding group of data to be visited.
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Acquiring unit 1002 is additionally operable to:Data to be visited are obtained physically according to the physical address information of data to be visited Location information corresponding first group and label position information;
If it determines not deposit in first group in storage system for corresponding first group according to the physical address information of data to be visited In the effective label field of mode bit, if alternatively, determining to store according to corresponding first group of the physical address information of data to be visited If the effective label field in existence position and according to the corresponding mark of physical address information of data to be visited in first group in system Label position information determines that there is no corresponding with the physical address information of data to be visited in the effective label field of mode bit in first group The equal label field of label position information, obtain the group for distributing data to be visited and group internal data field offset information and distribute to and treat Data are accessed, wherein, there is no the effective label fields of mode bit to include the corresponding data field in indicating label domain not by processor The data source for accessing and being stored in the corresponding data field in indicating label domain is in corresponding group of data to be visited, alternatively, indicateing arm The data source that the corresponding data field in label domain is accessed by a processor and is stored in the corresponding data field in indicating label domain is in except waiting to visit Ask corresponding group of data other groups, alternatively, the corresponding data field in indicating label domain is not accessed by a processor and indicating label The data source stored in the corresponding data field in domain is in except other groups of corresponding group of data to be visited.
Illustratively, acquiring unit 1002 further includes:
Selecting module 10001, if each group of corresponding utilization rate in storage system determines first group of correspondence Utilization rate be less than the first utilization threshold, for the utilization of the corresponding data field of each label field in first group Rate selects the data field that utilization rate is minimum in the corresponding data field of each label field in first group;
Distribution module 10002, for will in the corresponding data field of each label field in first group and first group it is sharp Data to be visited are distributed to the minimum data field of rate.
Illustratively, selecting module 10001 is additionally operable to:If each group of corresponding utilization rate in storage system It determines that first group of corresponding utilization rate is greater than or equal to the first utilization threshold, selects all in addition to first group in storage system Utilization rate is minimum in group second group;According to the utilization rate selection second of the corresponding data field of each label field in second group The minimum data field of utilization rate in the corresponding data field of each label field in group;
Distribution module 10002 is additionally operable to:It will be in the corresponding data field of each label field in second group and second group The minimum data field of utilization rate distributes to data to be visited.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly,
Acquiring unit 1002 further includes:
Read through model 10003, for reading the start bit of the corresponding data field of the first label field of instruction in the first label field Address and end bit address;
Acquiring unit 1002 is additionally operable to:If believed according to the granularity of the physical address information of data to be visited and data to be visited Breath determines that the corresponding all data of data to be visited are stored in the corresponding data field of the first label field, according in the first label field Group identification information and organize the position that internal data field offset information obtains the corresponding data field of the first label field;According to the first label The corresponding data field of the first label field of position acquisition of the corresponding data field in domain.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly,
Read through model 10003 is additionally operable to:Read the starting of the corresponding data field of the first label field of instruction in the first label field Bit address and end bit address;
Acquiring unit 1002 is additionally operable to:If believed according to the granularity of the physical address information of data to be visited and data to be visited Breath determines that the corresponding all data of data to be visited are not stored in the corresponding data field of the first label field, and it is to be visited to obtain distribution Data are replaced data field and distribute to data to be visited, wherein, it is replaced data field and includes each label in first group In the corresponding varigrained data field in domain granularity be more than and closest to request to be visited granular information data field.
Illustratively, acquiring unit 1002 further includes:
Merging module 10004, if the corresponding varigrained data field of each label field in first group Utilization rate determines that the utilization rate for being replaced data field in first group is greater than or equal in the second utilization threshold and first group and removes The utilization rate for being replaced multiple second data fields in all varigrained data fields outside data field is both less than the second access thresholds, Merging module 10004 is replaced data field and distributes to data to be visited for multiple second data fields to be merged into, wherein, the Two data fields include first group in addition to data field is replaced in all varigrained data fields granularity be less than be replaced data The data field of domain granularity;
Alternatively,
Acquiring unit 1002 further includes:
Module 10005 is split, if the corresponding varigrained data of each label field in described first group The utilization rate in domain determines that the utilization rate for being replaced data field in described first group is greater than or equal to second utilization rate Threshold value and it is first group described in except it is described be replaced data field in addition to three classes data field the 3rd in all varigrained data fields The utilization rate of data field is less than second access thresholds, splits module 10005 and is used for the 3rd data field of three classes data field One or more is split as to be replaced data field and distribute to data to be visited, wherein, the 3rd data field bag of three classes data field Containing in first group in addition to data field is replaced in all varigrained data fields in corresponding data field granularity be more than be replaced The data field of data field granularity;
Alternatively,
Distribution module 10002 is additionally operable to:If the corresponding varigrained number of each label field in first group According to the utilization rate in domain determine in first group described in be replaced the utilization rate of data field and be less than the second utilization threshold, for will be by Distribute to data to be visited in replacement data domain.
Cache memory 10 can also include:
Updating block 1003, for being more newly assigned to the corresponding label field of the data field of data to be visited.
A kind of cache memory 10 provided in an embodiment of the present invention, by the label field in cache memory 10 Attribute is expanded, so that label field can both correspond to the data field of this group, can also correspond to other groups of data field, into And the data field utilization rate in cache memory 10 is improved, it solves in the prior art due to cache memory 10 Middle label field and data field are fixed one-to-one relations and are stored separately, and cause the data in cache memory 10 The problem of domain utilization rate is low.
In another aspect, the embodiment of the present invention provides a kind of cache memory 10, receiver 1201, storage can be included Device 1202, for carrying out at least one communication bus 1203 of the connection between the 10 each equipment in inside of cache memory, It the connection that is used to implement between these devices and is in communication with each other.
Wherein, communication bus 1203 can be industry standard architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus Or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) is total Line etc..The bus 1203 can be divided into address bus, data/address bus, controlling bus etc..For ease of representing, only used in Figure 12 or 13 One thick line represents, it is not intended that an only bus or a type of bus.
Memory 1202 can include read-only memory and random access memory, and to processor 1002 provide instruction and Data.
As shown in Figure 12 or 13, cache memory 10 can include:
Receiver 1201, for receiving the solicited message of the access data to be visited of processor transmission, wherein, solicited message Include the physical address information of the data to be visited;
Cache memory 10 can be also used for:It is obtained and number to be visited according to the physical address information of data to be visited According to the corresponding label field of physical address information;Group identification information in the corresponding label domain information of physical address information, Group internal data field offset information obtains the corresponding data field of label field, wherein, each group includes N number of label field and M data Domain, label field is corresponded from the data field and one-to-one label field and data field are in identical group or different groups, N To be greater than or equal to 1 natural number, M is the natural number more than or equal to 1 and N is more than M, and each label field information includes and label Group identification information, the group internal data field offset information of the corresponding data field in domain, group identification information is used to indicate corresponding with label field Data field where group, data offset information is used to indicate data field in the offset where data field in group in group.
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Cache memory 10 can be also used for:Data to be visited are obtained according to the physical address information of data to be visited Physical address information corresponding first group and label position information;
If determine exist in storage system in first group for corresponding first group according to the physical address information of data to be visited If the effective label field of mode bit and determining first group according to the corresponding label position information of physical address information of data to be visited In the presence of the mark that label position information corresponding with the physical address information of data to be visited is equal in the middle effective label field of mode bit Domain is signed, obtains the physical address information of the label position information and data to be visited in storage system in the effective label field of mode bit The first equal label field of corresponding label position information, wherein, the effective label field in existence position includes instruction data field quilt Processor access and in the corresponding data field in indicating label domain the data source that stores in corresponding group of data to be visited.
Illustratively, each label domain information is also comprising label position information, data field whether effective information, " isptr " letter Breath,
Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of label field, and whether data field has Effect information is used to indicate the corresponding data field of label field and is accessed by a processor again without being accessed by a processor, " isptr " information The data source stored in the corresponding data field of label field is used to indicate also to be derived from removing treating for corresponding group in data to be visited Other groups of corresponding group of data are accessed,
Correspondingly,
Cache memory 10 can be also used for:Data to be visited are obtained according to the physical address information of data to be visited Physical address information corresponding first group and label position information;
If it determines not deposit in first group in storage system for corresponding first group according to the physical address information of data to be visited In the effective label field of mode bit, if alternatively, determining to store according to corresponding first group of the physical address information of data to be visited If the effective label field in existence position and according to the corresponding mark of physical address information of data to be visited in first group in system Label position information determines that there is no corresponding with the physical address information of data to be visited in the effective label field of mode bit in first group The equal label field of label position information, obtain the group for distributing data to be visited and group internal data field offset information and distribute to and treat Data are accessed, wherein, there is no the effective label fields of mode bit to include the corresponding data field in indicating label domain not by processor The data source for accessing and being stored in the corresponding data field in indicating label domain is in corresponding group of data to be visited, alternatively, indicateing arm The data source that the corresponding data field in label domain is accessed by a processor and is stored in the corresponding data field in indicating label domain is in except waiting to visit Ask corresponding group of data other groups, alternatively, the corresponding data field in indicating label domain is not accessed by a processor and indicating label The data source stored in the corresponding data field in domain is in except other groups of corresponding group of data to be visited.
Illustratively, cache memory 10 can also include:Cache miss module 1204, for Processor accesses processing module during missing, and cache miss module 1204 can also include:Speed buffering in group Memory replacement module 12001 and each group utilization rate statistical module 12002 are respectively used to every inside statistics of high speed buffer storage In one group the utilization rate of the corresponding data field of each label field with for each group of corresponding profit inside statistics of high speed buffer storage With rate.
Illustratively, cache memory 10 can be also used for:If each group profit in cache memory 10 Determine that first group of corresponding utilization rate is less than the first utilization threshold with rate statistical module 12002, cache memory 10 is used Cache memory replacement module 12001 selects the corresponding data field of each label field in first group according to group The minimum data field of middle utilization rate;By utilization rate in the corresponding data field of each label field in first group and first group most Low data field distributes to data to be visited.
Illustratively, cache memory 10 can be also used for:If each group profit in cache memory 10 It determines that first group of corresponding utilization rate is greater than or equal to the first utilization threshold with rate statistical module 12002, selects speed buffering Utilization rate is minimum in all groups in memory 10 in addition to first group second group;According to cache memory replacement mould in group Block 12001 selects the data field that utilization rate is minimum in the corresponding data field of each label field in second group;By second group And the minimum data field of utilization rate distributes to data to be visited in the corresponding data field of each label field in second group.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly, cache memory 10 can be also used for:Read the first label field pair of instruction in the first label field The starting bit address for the data field answered and end bit address;If according to the physical address information of data to be visited and data to be visited Granular information determine that the corresponding all data of data to be visited are stored in the corresponding data field of the first label field, according to first Group identification information and group internal data field offset information in label field obtain the position of the corresponding data field of the first label field;According to The corresponding data field of the first label field of position acquisition of the corresponding data field of first label field.
Illustratively, each label field also the start address information comprising data field corresponding with label field, end address Information,
Start address information is used to indicate the starting bit address of the corresponding data field of label field, and end address information is used to refer to Show the end bit address of the corresponding data field of label field,
Solicited message also includes the granular information of data to be visited,
Correspondingly,
Cache memory 10 can be also used for:Read the corresponding data of the first label field of instruction in the first label field The starting bit address in domain and end bit address;If believed according to the granularity of the physical address information of data to be visited and data to be visited Breath determines that the corresponding all data of data to be visited are not stored in the corresponding data field of the first label field, and it is to be visited to obtain distribution Data are replaced data field and distribute to data to be visited, wherein, it is replaced data field and includes each label in first group In the corresponding varigrained data field in domain granularity be more than and closest to request to be visited granular information data field.
Illustratively, cache memory 10 can also include data field and merge and split module 1205 and request granularity Statistical module 1206, data field merge and split module 1205 for merging or splitting the different grains in cache memory 10 The data field of degree, request grain size statistics module 1206 are used to count the utilization rate of different grain size data field.
Illustratively, data field merges and splits module 1205 and can be also used for:If according to request grain size statistics module 1206 determine that the utilization rate for being replaced data field in first group is greater than or equal in the second utilization threshold and first group except quilt The utilization rate of multiple second data fields is both less than the second access thresholds in the overseas all varigrained data fields of replacement data, number Merge according to domain and split module 1205 and be used to merge into multiple second data fields and be replaced data field and distribute to number to be visited According to, wherein, the second data field is comprising granularity is less than in all varigrained data fields in addition to data field is replaced in first group It is replaced the data field of data field granularity;
Alternatively,
Data field merges and splits module 1205 and can be also used for:If according to determining request grain size statistics module 1206 The utilization rate for being replaced data field in first group be greater than or equal to second utilization threshold and it is first group described in Except it is described be replaced data field in addition in all varigrained data fields the utilization rate of the 3rd data field be less than described second and access Threshold value, data field merge and split module 1205 be used for by the 3rd data field be split as one or more be replaced data field and point Dispensing data to be visited, wherein, the 3rd data field include first group in addition to data field is replaced all varigrained data Granularity is more than the data field for being replaced data field granularity in corresponding data field in domain;
Alternatively,
Data field merges and splits module 1205 and can be also used for:If determine first according to request grain size statistics module 1206 The utilization rate for being replaced data field in group is less than the second utilization threshold, and data field merges and splits module 1205 and is used for Data field will be replaced and distribute to data to be visited.
A kind of cache memory 10 provided in an embodiment of the present invention, by the label field in cache memory 10 Attribute is expanded, so that label field can both correspond to the data field of this group, can also correspond to other groups of data field, into And the data field utilization rate in cache memory 10 is improved, it solves in the prior art due to cache memory 10 Middle label field and data field are fixed one-to-one relations and are stored separately, and cause the data in cache memory 10 The problem of domain utilization rate is low.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit may be referred to the corresponding process in preceding method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit Division is only a kind of division of logic function, can there is other dividing mode, such as multiple units or component in actual implementation It may be combined or can be integrated into another system or some features can be ignored or does not perform.It is another, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some interfaces, device or unit It closes or communicates to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That the independent physics of unit includes, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be employed in member is realized, can also be realized in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit realized in the form of SFU software functional unit, can be stored in one and computer-readable deposit In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, is used including some instructions so that a computer Equipment (can be personal computer, server or the network equipment etc.) performs the portion of each embodiment the method for the present invention Step by step.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic disc or CD etc. are various to store The medium of program code.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that:It still may be used To modify to the technical solution recorded in foregoing embodiments or carry out equivalent substitution to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical solution spirit and Scope.

Claims (18)

  1. A kind of 1. method for accessing data, which is characterized in that including:
    The solicited message for the access data to be visited that processor is sent is received, wherein, the solicited message includes described to be visited The physical address information of data;
    It is obtained according to the physical address information of the data to be visited corresponding with the physical address information of the data to be visited Label field;
    Group identification information, group internal data field offset letter in the corresponding label domain information of the physical address information Breath, data origin information obtain the corresponding data field of the label field, wherein, each described group comprising N number of label field and M Data field, the label field is corresponded with the data field and the one-to-one label field and the data field are in phase With group or different groups, the N is the natural number more than or equal to 1, and the M is the natural number more than or equal to 1 and the N is big In the M, each group identification information of the label field information comprising the data field corresponding with the label field, number in group According to domain offset information, data origin information, described group of identification information is used to indicate the data field corresponding with the label field The group at place, data offset information is used to indicate the data field in the offset where the data field in group in described group, The data origin information is used to indicate the data source stored in the corresponding data field of the label field and waits to visit in described Ask that corresponding group of data are also derived from other groups except corresponding group of the data to be visited.
  2. 2. according to the method described in claim 1, it is characterized in that, each label domain information also comprising label position information, Data field whether effective information,
    Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, described Data field whether effective information be used to indicate the corresponding data field of the label field by the processor access again without It is accessed by the processor,
    Correspondingly,
    The physical address information pair obtained according to the physical address information of the data to be visited with the data to be visited The label field answered, including:
    The physical address information corresponding the of the data to be visited is obtained according to the physical address information of the data to be visited One group and label position information;
    If it is determined according to the physical address information of the data to be visited described in storage system in first group for corresponding first group If the effective label field in existence position and true according to the corresponding label position information of physical address information of the data to be visited There is mark corresponding with the physical address information of the data to be visited in described first group fixed in the effective label field of mode bit Sign the equal label field of position information, obtain label position information in the storage system in the effective label field of mode bit with it is described The first equal label field of the corresponding label position information of physical address information of data to be visited, wherein, the existence position Effective label field includes instruction data field and is accessed by the processor and indicate to store in the corresponding data field of the label field Data source in corresponding group of the data to be visited.
  3. 3. according to the method described in claim 1, it is characterized in that, each label domain information also comprising label position information, Data field whether effective information,
    Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, described Data field whether effective information be used to indicate the corresponding data field of the label field by the processor access again without It is accessed by the processor,
    Correspondingly,
    The physical address information pair obtained according to the physical address information of the data to be visited with the data to be visited The label field answered, including:
    The physical address information corresponding the of the data to be visited is obtained according to the physical address information of the data to be visited One group and label position information;
    If it is determined according to the physical address information of the data to be visited described in storage system in first group for corresponding first group There is no the effective label field of mode bit, if alternatively, corresponding first group according to the physical address information of the data to be visited If determining described in storage system in first group the effective label field in existence position and according to the physics of the data to be visited The corresponding label position information of address information determines that there is no wait to visit with described in the effective label field of mode bit in described first group Ask the corresponding label position information of physical address information of data equal label field, obtain the group of distributing the data to be visited and Group internal data field offset information simultaneously distributes to the data to be visited, wherein, it is described that the effective label field bag of mode bit is not present The corresponding data field of the label field containing instruction is not accessed by the processor and indicates the corresponding number of the label field According to the data source stored in domain in corresponding group of the data to be visited, alternatively, indicating the corresponding number of the label field According to domain by the processor accesses and indicates to store in the corresponding data field of the label field data source in except described Other groups of corresponding group of data to be visited, alternatively, indicating the corresponding data field of the label field not by the processing Device accesses and indicates the data source stored in the corresponding data field of the label field in except the data to be visited correspond to Other groups of group.
  4. 4. according to the method described in claim 3, it is characterized in that,
    It is described to obtain the group for distributing the data to be visited and group internal data field offset information and distribute to the data to be visited, Including:
    If each group of corresponding utilization rate in the storage system determines that first group of corresponding utilization rate is small In the first utilization threshold, described in the utilization rate selection of the corresponding data field of each label field in described first group The minimum data field of utilization rate in the corresponding data field of each label field in first group;
    By described first group and it is first group described in the corresponding data field of each label field in the minimum data of utilization rate Distribute to the data to be visited in domain.
  5. 5. according to the method described in claim 4, it is characterized in that,
    It is described to obtain the group for distributing the data to be visited and group internal data field offset information and distribute to the data to be visited, Including:
    If each group of corresponding utilization rate in the storage system determines that first group of corresponding utilization rate is big In or equal to first utilization threshold, utilization rate is selected in all groups in the storage system in addition to described first group most Low second group;
    It is each in described second group of the utilization rate selection of the corresponding data field of each label field in described second group The minimum data field of utilization rate in the corresponding data field of label field;
    By described second group and it is second group described in the corresponding data field of each label field in the minimum data of utilization rate Distribute to the data to be visited in domain.
  6. 6. according to the method described in claim 2, it is characterized in that,
    Each label field also the start address information comprising the data field corresponding with the label field, end address letter Breath,
    The start address information is used to indicate the starting bit address of the corresponding data field of the label field, described to terminate ground Location information is used to indicate the end bit address of the corresponding data field of the label field,
    The solicited message also includes the granular information of the data to be visited,
    Correspondingly,
    Group identification information, group internal data field offset letter in the corresponding label domain information of the physical address information Breath, data origin information obtain the corresponding data field of the label field, including:
    Read the starting bit address and stop bits of the corresponding data field of instruction first label field in first label field Address;
    If it waits to visit according to determining the granular information of the physical address information of the data to be visited and the data to be visited Ask that the corresponding all data of data are stored in the corresponding data field of first label field, according to first label field In group identification information and organize the position that internal data field offset information obtains the corresponding data field of first label field;
    According to the corresponding data field of the first label field described in the position acquisition of the corresponding data field of first label field.
  7. 7. according to the method described in claim 2, it is characterized in that,
    Each label field also the start address information comprising the data field corresponding with the label field, end address letter Breath,
    The start address information is used to indicate the starting bit address of the corresponding data field of the label field, described to terminate ground Location information is used to indicate the end bit address of the corresponding data field of the label field,
    The solicited message also includes the granular information of the data to be visited,
    Correspondingly,
    Group identification information, group internal data field offset letter in the corresponding label domain information of the physical address information Breath, data origin information obtain the corresponding data field of the label field, including:
    Read the starting bit address and stop bits of the corresponding data field of instruction first label field in first label field Address;
    If it waits to visit according to determining the granular information of the physical address information of the data to be visited and the data to be visited It asks that the corresponding all data of data are not stored in the corresponding data field of first label field, obtains and wait to visit described in distribution Ask being replaced data field and distributing to the data to be visited for data, wherein, the data field that is replaced includes described first In the corresponding varigrained data field of each label field in group granularity be more than and closest to the request to be visited granularity The data field of information.
  8. 8. the method according to the description of claim 7 is characterized in that
    Described obtain distributes being replaced data field and distributing to the data to be visited for the data to be visited, including:
    If described in the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in first group be greater than or equal to the second utilization threshold and it is first group described in except institute It states and is replaced the utilization rates of multiple second data fields in all varigrained data fields outside data field and is both less than the second access threshold Value, by the multiple second data field merge into it is described be replaced data field and distribute to the data to be visited, wherein, it is described Second data field include in described first group except it is described be replaced data field in addition in all varigrained data fields granularity be less than The data field for being replaced data field granularity;
    Alternatively,
    If described in the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in first group be greater than or equal to second utilization threshold and it is first group described in Except it is described be replaced data field in addition in all varigrained data fields the utilization rate of the 3rd data field be less than the second access thresholds, 3rd data field is split as being replaced data field described in one or more and distributes to the data to be visited, wherein, 3rd data field include in described first group except it is described be replaced data field in addition in all varigrained data fields it is corresponding Data field in granularity be more than the data field for being replaced data field granularity;
    Alternatively,
    If described in the utilization rate of the corresponding varigrained data field of each label field in described first group determines The utilization rate for being replaced data field in first group is less than second utilization threshold, and data field point is replaced by described Data to be visited described in dispensing.
  9. 9. according to claim 3-5,7-8 any one of them method, which is characterized in that the method further includes:
    More it is newly assigned to the corresponding label field of data field of the data to be visited.
  10. 10. a kind of cache memory, which is characterized in that including:
    Receiving unit, for receiving the solicited message of the access data to be visited of processor transmission, wherein, the request packet Physical address information containing the data to be visited;
    Acquiring unit, for being obtained according to the physical address information of the data to be visited with the data to be visited physically The corresponding label field of location information;Group identification information, group in the corresponding label domain information of the physical address information Internal data field offset information, data origin information obtain the corresponding data field of the label field, wherein, each described group includes N number of label field and M data field, the label field and data field one-to-one corresponding and the one-to-one label field and institute It states data field and is in identical group or different groups, the N is the natural number more than or equal to 1, and the M is more than or equal to 1 Natural number and the N are more than the M, and each label field information includes the group of the data field corresponding with the label field Identification information, group internal data field offset information, data origin information, described group of identification information are used to indicate and the label field pair Group where the data field answered, data offset information is used to indicate the data field where the data field in described group Offset in group, the data origin information, which is used to indicate the data stored in the corresponding data field of the label field, to be come Come from other groups that corresponding group of the data to be visited are also derived from removing corresponding group of the data to be visited.
  11. 11. cache memory according to claim 10, which is characterized in that each label domain information also includes Label position information, data field whether effective information,
    Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, described Data field whether effective information be used to indicate the corresponding data field of the label field by the processor access again without It is accessed by the processor,
    Correspondingly,
    The acquiring unit is additionally operable to:The object of the data to be visited is obtained according to the physical address information of the data to be visited Manage address information corresponding first group and label position information;
    If it is determined according to the physical address information of the data to be visited described in storage system in first group for corresponding first group If the effective label field in existence position and true according to the corresponding label position information of physical address information of the data to be visited There is mark corresponding with the physical address information of the data to be visited in described first group fixed in the effective label field of mode bit Sign the equal label field of position information, obtain label position information in the storage system in the effective label field of mode bit with it is described The first equal label field of the corresponding label position information of physical address information of data to be visited, wherein, the existence position Effective label field includes instruction data field and is accessed by the processor and indicate to store in the corresponding data field of the label field Data source in corresponding group of the data to be visited.
  12. 12. cache memory according to claim 10, which is characterized in that each label domain information also includes Label position information, data field whether effective information,
    Wherein, label position information is used to indicate the corresponding physical address of the corresponding data field of the label field, described Data field whether effective information be used to indicate the corresponding data field of the label field by the processor access again without It is accessed by the processor,
    Correspondingly,
    The acquiring unit is additionally operable to:The object of the data to be visited is obtained according to the physical address information of the data to be visited Manage address information corresponding first group and label position information;
    If it is determined according to the physical address information of the data to be visited described in storage system in first group for corresponding first group There is no the effective label field of mode bit, if alternatively, corresponding first group according to the physical address information of the data to be visited If determining described in storage system in first group the effective label field in existence position and according to the physics of the data to be visited The corresponding label position information of address information determines that there is no wait to visit with described in the effective label field of mode bit in described first group Ask the corresponding label position information of physical address information of data equal label field, obtain the group of distributing the data to be visited and Group internal data field offset information simultaneously distributes to the data to be visited, wherein, it is described that the effective label field bag of mode bit is not present The corresponding data field of the label field containing instruction is not accessed by the processor and indicates the corresponding number of the label field According to the data source stored in domain in corresponding group of the data to be visited, alternatively, indicating the corresponding number of the label field According to domain by the processor accesses and indicates to store in the corresponding data field of the label field data source in except described Other groups of corresponding group of data to be visited, alternatively, indicating the corresponding data field of the label field not by the processing Device accesses and indicates the data source stored in the corresponding data field of the label field in except the data to be visited correspond to Other groups of group.
  13. 13. cache memory according to claim 12, which is characterized in that
    The acquiring unit further includes:
    Selecting module, if each group of corresponding utilization rate in the storage system determine described first group it is corresponding Utilization rate is less than the first utilization threshold, for the profit of the corresponding data field of each label field in described first group The data field that utilization rate is minimum in the corresponding data field of each label field in described first group is selected with rate;
    Distribution module, for by described first group and it is first group described in the corresponding data field of each label field in utilize The minimum data field of rate distributes to the data to be visited.
  14. 14. cache memory according to claim 13, which is characterized in that
    The selecting module is additionally operable to:If each group of corresponding utilization rate in the storage system determines described One group of corresponding utilization rate is greater than or equal to first utilization threshold, selects in the storage system in addition to described first group All groups in minimum second group of utilization rate;According to the utilization of the corresponding data field of each label field in described second group The minimum data field of utilization rate in the corresponding data field of each label field in described second group of rate selection;
    The distribution module is additionally operable to:By described second group and it is second group described in the corresponding data field of each label field The minimum data field of middle utilization rate distributes to the data to be visited.
  15. 15. cache memory according to claim 11, which is characterized in that
    Each label field also the start address information comprising the data field corresponding with the label field, end address letter Breath,
    The start address information is used to indicate the starting bit address of the corresponding data field of the label field, described to terminate ground Location information is used to indicate the end bit address of the corresponding data field of the label field,
    The solicited message also includes the granular information of the data to be visited,
    Correspondingly,
    The acquiring unit further includes:
    Read through model, for reading the start bit of the corresponding data field of instruction first label field in first label field Location and end bit address;
    The acquiring unit is additionally operable to:If according to the physical address information of the data to be visited and the grain of the data to be visited Degree information determines that the corresponding all data of the data to be visited are stored in the corresponding data field of first label field, It is corresponding that group identification information and group internal data field offset information in first label field obtain first label field The position of the data field;According to the first label field pair described in the position acquisition of the corresponding data field of first label field The data field answered.
  16. 16. cache memory according to claim 11, which is characterized in that
    Each label field also the start address information comprising the data field corresponding with the label field, end address letter Breath,
    The start address information is used to indicate the starting bit address of the corresponding data field of the label field, described to terminate ground Location information is used to indicate the end bit address of the corresponding data field of the label field,
    The solicited message also includes the granular information of the data to be visited,
    Correspondingly,
    The acquiring unit further includes:
    Read through model is used for:With reading the start bit of the corresponding data field of instruction first label field in first label field Location and end bit address;
    The acquiring unit is additionally operable to:If according to the physical address information of the data to be visited and the grain of the data to be visited Degree information determines that the corresponding all data of the data to be visited are not stored in the corresponding data field of first label field In, it obtains and distributes being replaced data field and distributing to the data to be visited for the data to be visited, wherein, it is described to be replaced Data field includes granularity in the corresponding varigrained data field of each label field in described first group and is more than and closest to institute State the data field of the granular information of request to be visited.
  17. 17. cache memory according to claim 16, which is characterized in that
    The acquiring unit further includes:
    Merging module, if the utilization rate of the corresponding varigrained data field of each label field in described first group Determine that the utilization rate for being replaced data field in described first group is greater than or equal to the second utilization threshold and described first In group except it is described be replaced data field in addition in all varigrained data fields the utilization rate of multiple second data fields be both less than Two access thresholds described be replaced data field and distribute to the number to be visited for the multiple second data field to be merged into According to, wherein, second data field include described first group in except it is described be replaced data field in addition to all varigrained data Granularity is less than the data field for being replaced data field granularity in domain;
    Alternatively,
    The acquiring unit further includes:
    Module is split, if the utilization rate of the corresponding varigrained data field of each label field in described first group Determine that the utilization rate for being replaced data field in described first group is greater than or equal to second utilization threshold and described In first group except it is described be replaced data field in addition in all varigrained data fields the utilization rate of the 3rd data field be less than second Access thresholds described are waited to visit for the 3rd data field to be split as being replaced data field described in one or more and distribute to Ask data, wherein, the 3rd data field include described first group in except it is described be replaced data field in addition to it is all varigrained Granularity is more than the data field for being replaced data field granularity in corresponding data field in data field;
    Alternatively,
    The acquiring unit further includes:
    Distribution module, if the utilization rate of the corresponding varigrained data field of each label field in described first group Determine that the utilization rate for being replaced data field in described first group is less than second utilization threshold, for by the quilt Distribute to the data to be visited in replacement data domain.
  18. 18. according to claim 12-14,16-17 any one of them cache memory, which is characterized in that
    The cache memory further includes:
    Updating block, for being more newly assigned to the corresponding label field of data field of the data to be visited.
CN201310344166.0A 2013-08-08 2013-08-08 A kind of method, equipment and system for accessing data Active CN104346404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310344166.0A CN104346404B (en) 2013-08-08 2013-08-08 A kind of method, equipment and system for accessing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310344166.0A CN104346404B (en) 2013-08-08 2013-08-08 A kind of method, equipment and system for accessing data

Publications (2)

Publication Number Publication Date
CN104346404A CN104346404A (en) 2015-02-11
CN104346404B true CN104346404B (en) 2018-05-18

Family

ID=52502017

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310344166.0A Active CN104346404B (en) 2013-08-08 2013-08-08 A kind of method, equipment and system for accessing data

Country Status (1)

Country Link
CN (1) CN104346404B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106990944B (en) * 2016-01-21 2020-09-04 阿里巴巴集团控股有限公司 Code resource management method, device and system
CN107180001B (en) * 2016-03-10 2020-02-21 华为技术有限公司 Method and bus for accessing Dynamic Random Access Memory (DRAM)
CN109194453B (en) * 2017-11-17 2019-11-15 华为技术有限公司 The sending method and device of Phase Tracking reference signal
US10419099B2 (en) 2017-11-17 2019-09-17 Huawei Technologies Co., Ltd. Phase tracking reference signal sending method and apparatus
CN111602377B (en) * 2017-12-27 2021-12-24 华为技术有限公司 Resource adjusting method in cache, data access method and device
CN111124951B (en) * 2018-10-31 2023-09-15 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing data access

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6338118B2 (en) * 1999-06-21 2002-01-08 Philips Electronics No. America Corp. Set-associative cache-management method with parallel and single-set sequential reads
CN1165000C (en) * 2001-12-20 2004-09-01 中国科学院计算技术研究所 Microprocessor high speed buffer storage method of dynamic index
CN101470671A (en) * 2008-01-16 2009-07-01 威盛电子股份有限公司 Memory system, memory access method and graphic processing system
CN1770734B (en) * 2004-11-05 2010-09-08 株式会社日立制作所 Traffic control method for network equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69711965T2 (en) * 1996-02-29 2003-01-23 Pfizer Use of sorbitol dehydrogenase inhibitors to reduce ischemia-associated tissue damage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6338118B2 (en) * 1999-06-21 2002-01-08 Philips Electronics No. America Corp. Set-associative cache-management method with parallel and single-set sequential reads
CN1165000C (en) * 2001-12-20 2004-09-01 中国科学院计算技术研究所 Microprocessor high speed buffer storage method of dynamic index
CN1770734B (en) * 2004-11-05 2010-09-08 株式会社日立制作所 Traffic control method for network equipment
CN101470671A (en) * 2008-01-16 2009-07-01 威盛电子股份有限公司 Memory system, memory access method and graphic processing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《对缓存的思考——提高命中率》;Geek_Ling;《博客园》;20120212;第1-7页 *

Also Published As

Publication number Publication date
CN104346404A (en) 2015-02-11

Similar Documents

Publication Publication Date Title
CN104346404B (en) A kind of method, equipment and system for accessing data
CN105245912B (en) A kind of method and device of buffered video data and reading video data
US9058112B2 (en) Retrieving data in a storage system using thin provisioning
US8972690B2 (en) Methods and apparatuses for usage based allocation block size tuning
US20160132541A1 (en) Efficient implementations for mapreduce systems
CN104272278B (en) Method for updating shared caches and multi-threaded processing system
US20030220951A1 (en) Dynamic disk space management by multiple database server instances in a cluster configuration
CN105677580A (en) Method and device for accessing cache
CN108572792A (en) Date storage method, device, electronic equipment and computer readable storage medium
CN104346285A (en) Memory access processing method, device and system
CN105518631B (en) EMS memory management process, device and system and network-on-chip
CN108496161A (en) Data buffer storage device and control method, data processing chip, data processing system
CN106713250B (en) Data access method and device based on distributed system
CN104809076A (en) Management method and device of cache
CN108984130A (en) A kind of the caching read method and its device of distributed storage
CN107111557A (en) Shared cache memory distribution control is provided in shared high-speed buffer storage system
CN110147331A (en) Caching data processing method, system and readable storage medium storing program for executing
CN107122130A (en) A kind of data delete method and device again
CN110399096A (en) Metadata of distributed type file system caches the method, apparatus and equipment deleted again
CN106294211B (en) A kind of detection method and device of multichannel sequential flow
CN106802955A (en) A kind of image data caching method
CN110297787A (en) The method, device and equipment of I/O equipment access memory
CN107291630B (en) Cache memory processing method and device
CN103885890B (en) Replacement processing method and device for cache blocks in caches
CN104714898B (en) A kind of distribution method and device of Cache

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant