CN108664417B - Directory updating method and device - Google Patents

Directory updating method and device Download PDF

Info

Publication number
CN108664417B
CN108664417B CN201710208859.5A CN201710208859A CN108664417B CN 108664417 B CN108664417 B CN 108664417B CN 201710208859 A CN201710208859 A CN 201710208859A CN 108664417 B CN108664417 B CN 108664417B
Authority
CN
China
Prior art keywords
directory
cas
preset
updating
field
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
CN201710208859.5A
Other languages
Chinese (zh)
Other versions
CN108664417A (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
Original Assignee
Huawei Technologies Co Ltd
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 filed Critical Huawei Technologies Co Ltd
Priority to CN201710208859.5A priority Critical patent/CN108664417B/en
Priority to PCT/CN2018/079822 priority patent/WO2018177176A1/en
Publication of CN108664417A publication Critical patent/CN108664417A/en
Application granted granted Critical
Publication of CN108664417B publication Critical patent/CN108664417B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • G06F12/0817Cache consistency protocols using directory methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0895Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0897Caches characterised by their organisation or structure with two or more cache hierarchy levels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1012Design facilitation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a directory updating method and a directory updating device. The method comprises the following steps: determining a directory updating strategy applicable to the current system; acquiring the number of CAs accessing a target data address and the positions of the CAs; and updating the first preset directory into a second directory according to the directory updating strategy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure. According to the embodiment of the invention, the first preset directory is updated according to different directory updating strategies, so that the flexibility of the directory structure is improved.

Description

Directory updating method and device
Technical Field
The invention relates to the technical field of communication, in particular to a directory updating method and device.
Background
With the rapid development of communication technology, the requirement of a computer on a processor is higher and higher, and therefore, the number of chip cores of the processor is continuously increased, which results in that the number of modules (Cache agents, CAs) including a Cache memory, which need to be recorded by a module (Home Agent, HA) for maintaining data consistency in the processor, is also higher and higher, and therefore, how to design a directory structure of the HA becomes a difficult problem.
At present, an HA usually records CAs in a vector manner, the width of the vector is equal to the number of the CAs, when the number of the CAs is large to a certain extent, the overhead of the vector is very large, and in order to solve the problem, a part of Error Correcting Code (Error Correcting Code) space can be used for storing an HA directory, but due to the influence of an ECC space, the overhead of each directory entry cannot be too large, which may cause the recorded directory to be fuzzy, and there are many redundant snoops when recovering the read authority of the CA on data, which negatively affects the performance of the system.
Disclosure of Invention
The embodiment of the invention provides a directory updating method and device, which improve the flexibility of a directory structure.
In a first aspect, an embodiment of the present invention provides a directory update method, where the method includes:
determining a directory updating strategy applicable to the current system;
acquiring the number of modules CA including a cache processor accessing a target data address and the position of the CA;
and updating the first preset directory into a second directory according to the directory updating strategy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure.
From the above, the computer device firstly determines the directory update policy applicable to the current system, secondly obtains the number of CAs accessing the target data address and the location of the CA, and finally updates the first preset directory to be the second directory according to the directory update policy, the number of CAs and the location of the CA, wherein the second directory includes at least one directory structure. Therefore, the computer equipment can update the first preset directory into the second directory with different directory structures according to the directory update strategy, the number of the CAs and the positions of the CAs, and the flexibility of the directory structures is improved.
In one possible design, the updating the directory policy is a first directory updating policy, and the updating the first preset directory to be a second directory according to the directory updating policy, the number of the CAs, and the location of the CA includes:
when the number of the CA is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the position of the CA, and updating a second field of the first preset directory according to the number of the CA;
and when the number of the CAs is larger than the preset threshold value, updating the first field of the first preset directory according to the number of the CAs, and updating the second field of the first preset directory to be a first preset value.
It can be seen from the above that, the directory update method disclosed in this possible design, in addition to improving the flexibility of the directory structure, accurately records the number and the position when the number of CAs is small, and records only the number when the number of CAs is large, thereby reducing the hardware overhead and maintaining the accuracy of the directory to the maximum extent.
In this possible design, the updating the first field of the first preset directory according to the number of CAs when the number of CAs is greater than the preset threshold, and the updating the second field of the first preset directory to be the first preset value includes:
when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs;
and updating the first field of the first preset directory according to the number of the CAs of the at least one preset partition, and updating the second field of the first preset directory to be the first preset value.
As can be seen from the above, in the directory updating method disclosed in this possible design, in addition to improving the flexibility of the directory structure, when the number of CAs is greater than the preset threshold value and only the number of CAs is recorded, the number of CAs is recorded in a partitioned manner, which can reduce the redundant interception existing when the read permission of the target data address by the CA needs to be recovered, and further improve the accuracy of the directory.
In one possible design, the updating the directory update policy is a second directory update policy, and the updating the first preset directory as the second directory according to the directory update policy, the number of the CAs, and the location of the CA includes:
determining the CA belonging to at least one target area in the CA according to the position of the CA;
updating a first part of a first field of the first preset directory according to the position of the CA of the at least one target area, updating a second part of the first field of the first preset directory according to the number of the CAs except the CA of the at least one target area in the CA, and updating a second field of the first preset directory to be a second preset value according to the at least one target area.
As can be seen from the above, in the directory update method disclosed in this possible design, in addition to improving the flexibility of the directory structure, the CA in the at least one target area does not record only the number of the CAs at the position where the CA records the CA through the second directory update policy, which reduces the hardware overhead, reduces the redundant interception, and maximally maintains the accuracy of the directory.
In one possible design, the number of CAs accessing the target data address includes: the number of CAs reading the target data address and the number of CAs writing back the target data address.
In a second aspect, an embodiment of the present invention discloses a directory update apparatus, where the directory update apparatus has a function of implementing a behavior of the directory update apparatus in the above method design. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
The directory updating device comprises a processing unit, a processing unit and a processing unit, wherein the processing unit is used for determining a directory updating strategy applicable to a current system; and the number of modules CA containing cache processors and the location of the CA for obtaining the address of the access target data; and updating the first preset directory to be a second directory according to the directory update policy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure.
In a possible design, the directory update policy is a first directory update policy, and in the aspect of updating a first preset directory to be a second directory according to the directory update policy, the number of the CAs and the location of the CA, the processing unit is specifically configured to: when the number of the CAs is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the positions of the CAs, and updating a second field of the first preset directory according to the number of the CAs; and updating the first field of the first preset directory according to the number of the CAs and updating the second field of the first preset directory to be a first preset value when the number of the CAs is greater than the preset threshold value.
In a possible design, in the aspect that when the number of CAs is greater than the preset threshold, the first field of the first preset directory is updated according to the number of CAs, and the second field of the first preset directory is updated to be the first preset value, the processing unit is specifically configured to: when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs; and the second field is used for updating the first field of the first preset directory according to the number of the CA of the at least one partition, and the second field of the first preset directory is updated to be the first preset value.
In a possible design, the directory update policy is a second directory update policy, and in the aspect of updating the first preset directory to be the second directory according to the directory update policy, the number of the CAs and the location of the CA, the processing unit is specifically configured to: determining the CA belonging to at least one target area in the CA according to the position of the CA; and the second part of the first field of the first preset directory is updated according to the number of the CA except the CA of the at least one target area, and the second field of the first preset directory is updated to be a second preset value according to the at least one target area.
In one possible design, the number of CAs accessing the target data address includes: the number of CAs reading the target data address and the number of CAs writing back the target data address.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a processor, a memory, a transceiver, and a bus;
the processor is communicated with the memory and the transceiver through the bus;
the memory stores executable program code and the processor is configured to call the executable program code in the memory to perform some or all of the steps described in any of the methods according to the first aspect of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention discloses a computer-readable storage medium, where the computer-readable storage medium stores program code for execution by a computer device, where the program code specifically includes execution instructions for executing some or all of the steps described in any one of the methods in the first aspect of the embodiment of the present invention.
From the above, the computer device firstly determines the directory update policy applicable to the current system, secondly obtains the number of CAs accessing the target data address and the location of the CA, and finally updates the first preset directory to be the second directory according to the directory update policy, the number of CAs and the location of the CA, wherein the second directory includes at least one directory structure. Therefore, the computer equipment can update the first preset directory into the second directory with different directory structures according to the directory update strategy, the number of the CAs and the positions of the CAs, and the flexibility of the directory structures is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present invention, the drawings required to be used in the embodiments or the background art of the present invention will be described below.
FIG. 1 is a schematic diagram of a hierarchical structure of HA and CA in a processor according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a computer device according to an embodiment of the present invention;
fig. 3A is a flowchart illustrating a directory update method according to an embodiment of the present invention;
fig. 3B is a schematic diagram of a directory structure of a CA information for recording an access target data address by an HA according to an embodiment of the present invention;
fig. 3C is a schematic diagram of a directory structure of CA information for recording an access target data address by an HA according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a directory update method according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating a directory update method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a directory update apparatus according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiment of the present invention is described below with reference to the drawings in the embodiment of the present invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a hierarchical structure of a module (Home Agent, HA) for maintaining data consistency in a processor and a module (Cache Agent, CA) including a Cache of a Cache processor, as shown in the figure, L1 is a first-level CA, L2 is a second-level CA, and L3 is a third-level CA, where the data consistency is maintained when the HA uses a directory to record a data address in the processor, where the data consistency is held by the Cache in the CA, and includes a position of the CA holding the data address and a state of the held data address, and the data consistency is maintained in a hierarchical manner, which is not limited herein, for example, the L2 maintains data consistency with a plurality of corresponding L1, the L3 maintains data consistency with a plurality of corresponding L2, and the HA is responsible for maintaining data consistency with a plurality of corresponding L3.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where as shown, the computer device includes a processor, a memory, a communication interface, and a communication bus, the processor, the memory, and the communication interface are connected via the communication bus and complete communication therebetween, the memory stores executable program codes, the communication interface is used for wireless communication, the processor is used for calling the executable program codes in the memory and executing a directory update method according to an embodiment described below, and the processor includes the HA and the CA.
Referring to fig. 3A, fig. 3A is a schematic flowchart of a directory updating method according to an embodiment of the present invention, and as shown in the figure, the directory updating method includes:
s301, the computer equipment determines a directory update strategy applicable to the current system;
wherein the directory update policy comprises a first directory update policy and a second directory update policy.
Wherein the directory update policy is an update policy applicable to the HA directory, and the HA directory is a directory in the computer device processor that records the access condition of the data address by the CA.
The specific implementation manner of determining the directory update policy applicable to the current system by the computer device may be by querying system settings or receiving setting information of a user.
For example, the system sets an identification bit, when the computer device queries that the identification bit set by the current system is 1, the directory update policy applicable to the current system is represented as a first directory update policy, and when the computer device queries that the identification bit set by the current system is 0, the directory update policy applicable to the current system is represented as a second directory update policy.
S302, the computer equipment acquires the number of modules (CA) containing a cache processor accessing a target data address and the position of the CA;
wherein the number of CAs accessing the target data address comprises: the number of CAs reading the target data address and the number of CAs writing back the target data address.
The specific implementation manner of obtaining the number of CAs accessing the target data address may be:
acquiring the number of CAs reading the target data address and the number of CAs writing back the target data address;
and determining the number of the CAs accessing the target data address according to the number of the CAs reading the target data address and the number of the CAs writing back the target data address.
For example, when the number of CAs reading the target data address is 5 and the number of CAs writing back the target data address is 3, then the number of CAs accessing the target data address is 2.
In one possible example, the computer device obtaining a number of CAs accessing the target data address, comprising:
when the data state of the target data address which is requested to be read by the ith CA accessing the target data address is an Exclusive state (an Exclusive state, an E state), the read permission of the CA accessing the target data address except the ith CA is recycled according to a preset broadcast interception strategy, and then the number of the CA accessing the target data address is 1, i is a positive integer.
Wherein the data state of the target data address comprises an E state and a Shared state (S state).
The CA positions are located in a plurality of partitions of the system, the number of CAs of each partition is different, and a saturation value exists in the number of CAs of each partition.
In one possible example, the computer device obtains a number of CAs accessing the target data address, including:
after the number of CAs accessing the target data address by the kth partition is saturated, when detecting that the jth CA accesses the target data address, the computer equipment recovers the read permission of the CA accessing the target data address of the kth partition except the jth CA through a preset broadcast interception strategy, and obtains the number of CAs accessing the target data address, wherein k and j are positive integers respectively; or the like, or, alternatively,
after the number of the CAs accessing the target data address in the kth partition is saturated, when the computer device detects that the jth CA accesses the target data address, recovering the read permission of all the CAs accessing the target data address except the jth CA through a preset broadcast interception strategy, and obtaining the number of the CAs accessing the target data address.
For example, when the saturated number of CAs accessing the target data address of the kth partition is 6, when a seventh CA performs a read operation on the target data address, the read authority of the first six CAs of the kth partition on the target data address is recovered, the read access of the seventh CA on the target data address is allowed, at this time, the number of CAs accessing the target data address is the sum of the number of 1 CA of the kth partition and the number of multiple CAs of other partitions, or according to a system protocol requirement, when a seventh CA performs a read operation on the target data address, the read authority of all CAs accessing each partition of the target data address except the seventh CA is recovered, at this time, the number of CAs accessing the target data address is 1, that is, the seventh CA.
S303, the computer equipment updates a first preset directory into a second directory according to the directory updating strategy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure;
the first preset directory is the HA directory, and the first preset directory is a Sparse spare structure and is stored in a Static Random Access Memory (SRAM).
In one possible example, the updating the directory update policy is a first directory update policy, and the updating the first preset directory into a second directory according to the directory update policy, the number of the CAs, and the location of the CA includes:
when the number of the CAs is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the positions of the CAs, and updating a second field of the first preset directory according to the number of the CAs;
and when the number of the CAs is larger than the preset threshold value, updating the first field of the first preset directory according to the number of the CAs, and updating the second field of the first preset directory to be a first preset value.
In this possible example, the updating the first field of the first preset directory according to the number of CAs when the number of CAs is greater than the preset threshold, and the updating the second field of the first preset directory to a first preset value includes:
when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs;
and updating the first field of the first preset directory according to the number of the CAs of the at least one preset partition, and updating the second field of the first preset directory to be the first preset value.
Wherein, when the number of CAs is 0, the directory is an invalid directory.
For example, the preset threshold is 2, the directory structure of the CA information of the access target data address recorded by the HA is shown in fig. 3B, the first preset directory is an 11-bit directory structure, the first field is 0-8 bits, the first part of the first field is 0-2 bits, the second part of the first field is 3-8 bits, the second field is 9-10 bits, when the number of the CAs is 0, the second field is updated to be the second preset value, that is, both the 9-bit and the 10-bit are 0, and the entry is recorded as an invalid directory; when the number of the CAs is 1 and is smaller than the preset threshold value, updating a second field of the first preset directory to be 9-bit 1 and 10-bit 0 to represent that the number of the CAs is 1, updating 3-8-bit bits of a second part of the first field to be the positions of the 1 CA, and updating a first part of the first field to be the state of a target data address; when the number of the CAs is 2 and is equal to the first preset threshold, updating a second field 9bit of the first preset directory to be 0 and a second field 10bit of the first preset directory to be 1 to indicate that the number of the CAs is 2, updating 6-8 bits of the first field to be the position of a first CA of the 2 CAs, and updating 0-5 bits to be the position of a second CA; when the number of the CAs is more than 2, the second field is updated to the first preset value, namely, 1,0-8 bits are both on the 9 bits and the 10 bits to represent the number of the CAs, and the 0-8 bits can be divided into four parts, namely, 0bit and 1bit, 2bit and 3bit, 4bit and 5bit, and 6-8bit, and the four parts can respectively record the number of the CAs accessing the target data address in four different preset partitions.
In yet another possible example, the updating the directory update policy is a second directory update policy, and the updating the first preset directory to be the second directory according to the directory update policy, the number of CAs and the location of the CA includes:
determining the CA belonging to at least one target area in the CA according to the position of the CA;
updating a first part of a first field of the first preset directory according to the position of the CA of the at least one target area, updating a second part of the first field of the first preset directory according to the number of the CAs except the CA of the at least one target area in the CA, and updating a second field of the first preset directory to be a second preset value according to the at least one target area.
For example, the at least one target area may be, for example, a local area, and the number of the at least one target area may be one or more.
For example, as shown in fig. 3C, the directory structure of the CA information of the address where the HA records and accesses the target data is a directory structure with 11 bits, the first field is 0-8 bits, the first part of the first field is 5-8 bits, the second part of the first field is 0-4 bits, the second field is 9-10 bits, and the number of the at least one target area is 2, which are the first target area and the second target area respectively;
when the number of the CAs belonging to a first target area in the CAs accessing the target data address is 1 and the number of the CAs belonging to a second target area is 0, updating a second field to be a second preset value, namely, the 9-bit is 1 and the 10-bit is 0, to indicate the first target area, updating the positions of 1 CA located in the first target area for a first part of 5-8bit of the first field, and updating the number of the CA not located in the first target area for accessing the target data address for a second part of 0-4bit of the first field;
when the number of the CAs belonging to a second target area in the CAs accessing the target data address is 1 and the number of the CAs belonging to a first target area is 0, updating a second field to be a second preset value, namely, the 9-bit is 0 and the 10-bit is 1 to represent the second target area, updating the positions of 1 CA located in the second target area for a first part of 5-8-bit bits of the first field, and updating the number of the CA not located in the second target area for accessing the target data address for a second part of 0-4-bit bits of the first field;
when the number of the CAs which access the target data address and belong to the first target area is 1 and the number of the CAs which access the second target area is 2, updating the second field to be a second preset value, namely the 9-bit to 1 and the 10-bit to 1, to represent the first target area and the second target area, updating the first part 7-8-bit of the first field to be 1 CA position of the first target area for accessing the target data address, updating the first part 5-6-bit of the first field to be 2 CA positions of the second target area for accessing the target data address, and updating the second part 0-4-bit of the first field to be the number of the CAs which do not access the target data address and are not located in the first target area and the second target area.
From the above, the computer device firstly determines the directory update policy applicable to the current system, secondly obtains the number of CAs accessing the target data address and the location of the CA, and finally updates the first preset directory to be the second directory according to the directory update policy, the number of CAs and the location of the CA, wherein the second directory includes at least one directory structure. Therefore, the computer equipment can update the first preset directory into the second directory with different directory structures according to the directory update strategy, the number of the CAs and the positions of the CAs, and the flexibility of the directory structures is improved.
Referring to fig. 4, fig. 4 is a schematic flow chart of another directory updating method according to an embodiment of the present invention, which is consistent with the directory updating method shown in fig. 3A, and as shown in the figure, the directory updating method includes:
s401, the computer equipment determines that the directory updating strategy applicable to the current system is a first directory updating strategy;
s402, the computer equipment acquires the number of modules CA containing cache processors and the positions of the CA accessing target data addresses;
s403, when the number of the CAs is smaller than or equal to a preset threshold, the computer equipment updates a first field of a first preset directory according to the positions of the CAs, and updates a second field of the first preset directory according to the number of the CAs;
s404, when the number of the CAs is larger than the preset threshold value, the computer equipment determines the number of the CAs in at least one preset partition according to the positions of the CAs;
s405, the computer device updates the first field of the first preset directory according to the number of the CAs of the at least one preset partition, and updates the second field of the first preset directory to be the first preset value.
As can be seen from the above, in the directory update method disclosed in the embodiment of the present invention, a computer device first determines a directory update policy applicable to a current system as a first directory update policy, then obtains the number of CAs accessing a target data address and the location of the CA, and finally, when the number of the CAs is less than or equal to a preset threshold, the HA updates a first field of a first preset directory according to the location of the CA, updates a second field of the first preset directory according to the number of the CAs, and when the number of the CAs is greater than the preset threshold, determines the number of at least one preset partition in the location of the CA, and updates the first field of the first preset directory according to the number of the at least one preset partition, and updates the second field of the first preset directory to be the first preset value. Therefore, according to the first directory updating strategy, the computer device accurately records the number and the positions when the access times are less, only records the number when the access times are more, and records the number of CAs according to different preset partitions when the access times are more, so that the flexibility of the directory is improved, the hardware overhead is reduced, the accuracy of the directory is maintained to the maximum extent, and the number of partition records is favorable for reducing redundant interception existing when the reading permission of the CA on the target data address needs to be recovered.
Referring to fig. 5, fig. 5 is a schematic flow chart of another directory updating method according to an embodiment of the present invention, where the directory updating method shown in fig. 3A is consistent with the directory updating method shown in fig. 3A, and as shown in the diagram, the directory updating method includes:
s501, the computer equipment determines the directory update strategy applicable to the current system as a second directory update strategy;
s502, the computer equipment acquires the number of modules (CA) containing a cache processor accessing a target data address and the positions of the CA;
s503, the computer device determines, according to the position of the CA, a CA belonging to at least one target area in the CA, updates a first part of a first field of the first preset directory according to the position of the CA of the at least one target area, updates a second part of the first field of the first preset directory according to the number of the CAs, except the CA of the at least one target area, in the CA, and updates a second field of the first preset directory to be a second preset value according to the at least one target area.
As can be seen from the above, in the directory update method disclosed in the embodiment of the present invention, a computer device first determines a directory update policy applicable to a current system as a second directory update policy, then obtains the number M of CAs accessing a target data address and the location of the CA, and finally, the computer device determines a CA in the CA that belongs to at least one target area, updates a first part of a first field of a first preset directory according to the location of the CA in the at least one target area, updates a second part of the first field of the first preset directory according to the number of CAs in the CA except for the CA in the at least one target area, and updates a second field of the first preset directory to a second preset value according to the at least one target area. Therefore, the computer device records the position of the CA in at least one target area through a second directory update strategy, and only records the number of the CAs in the CA not in the at least one target area, so that the directory structure flexibility is improved, the hardware overhead is reduced, redundant interception existing when the read permission of the CA on the target data address needs to be recovered is reduced, and the directory accuracy is maintained to the maximum extent.
The above description has introduced the solution of the embodiment of the present invention mainly from the perspective of the method-side implementation process. It is understood that the directory update apparatus includes hardware structures and/or software modules corresponding to the respective functions in order to implement the above-described functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the present invention may perform the division of the functional units for the directory update apparatus according to the method example described above, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 6 shows a schematic diagram of a possible structure of the directory updating apparatus in the above embodiment, in the case of using an integrated unit. The directory updating apparatus 600 includes: a processing unit 602 and a communication unit 603. The processing unit 602 is configured to control and manage actions of the directory update apparatus, for example, the processing unit 602 is configured to support the directory update apparatus to perform steps S301 to 303 in fig. 3A, steps S401 to 405 in fig. 4, and steps S501 to 503 in fig. 5, and/or other processes for the technology described herein. The communication unit 603 is used to support communication between the directory updating apparatus and other devices. The directory updating apparatus may further include a storage unit 601 for storing program codes and data of the directory updating apparatus.
The Processing Unit 602 may be a Processor or a controller, such as a Central Processing Unit (CPU), a general-purpose Processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others. The communication unit 603 may be a communication interface, a transceiver, a transceiving circuit, etc., wherein the communication interface is a generic term and may comprise one or more interfaces. The storage unit 601 may be a memory.
Wherein the processing unit 601 is configured to determine a directory update policy applicable to the current system; and the number of modules CA containing cache processors and the location of the CA for obtaining the address of the access target data; and updating the first preset directory to be a second directory according to the directory update policy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure.
In one possible example, the directory update policy is a first directory update policy, and in the aspect that the first preset directory is updated to be a second directory according to the directory update policy, the number of CAs and the location of the CA, the processing unit is specifically configured to: when the number of the CAs is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the positions of the CAs, and updating a second field of the first preset directory according to the number of the CAs; and updating the first field of the first preset directory according to the number of the CAs and updating the second field of the first preset directory to be a first preset value when the number of the CAs is greater than the preset threshold value.
In a possible example, in the aspect that when the number of CAs is greater than the preset threshold, the first field of the first preset directory is updated according to the number of CAs, and the second field of the first preset directory is updated to be a first preset value, the processing unit is specifically configured to: when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs; and the second field is used for updating the first field of the first preset directory according to the number of the CA of the at least one partition, and the second field of the first preset directory is updated to be the first preset value.
In a possible example, the directory update policy is a second directory update policy, and in the aspect of updating the first preset directory into the second directory according to the directory update policy, the number of the CAs and the location of the CA, the processing unit is specifically configured to: determining the CA belonging to at least one target area in the CA according to the position of the CA; and the second part of the first field of the first preset directory is updated according to the number of the CA except the CA of the at least one target area in the CA, and the second field of the first preset directory is updated to be a second preset value according to the at least one target area.
In one possible example, the number of CAs accessing the target data address includes: the number of CAs reading the target data address and the number of CAs writing back the target data address.
When the processing unit 602 is a processor, the communication unit 603 is a communication interface, and the storage unit 601 is a memory, the directory update apparatus according to the embodiment of the present invention can be a computer device shown in fig. 2.
Referring to fig. 2, the computer device 210 includes: processor 212, communication interface 213, memory 211, LED liquid crystal display 214. Optionally, computer device 210 may also include a bus 215. Wherein, the communication interface 213, the processor 212, the memory 211, and the LED lcd 214 may be connected to each other through a bus 215; the bus 215 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 215 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 2, but that does not indicate only one bus or one type of bus.
The above-mentioned directory updating apparatus shown in fig. 6 or the computer device shown in fig. 2 can also be understood as an apparatus for a computer device, and the embodiments of the present invention are not limited thereto.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The foregoing detailed description of the embodiments of the present invention has been presented for the purpose of illustrating the principles and implementations of the present invention, and the above description of the embodiments is only provided to help understand the methods and their core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A directory update method, comprising:
determining a directory updating strategy applicable to the current system;
acquiring the number of modules CA containing a cache processor and the position of the CA accessing a target data address;
updating a first preset directory into a second directory according to the directory updating strategy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure;
the updating the directory policy as a first directory updating policy, and updating the first preset directory as a second directory according to the directory updating policy, the number of the CAs and the location of the CAs includes:
when the number of the CAs is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the positions of the CAs, and updating a second field of the first preset directory according to the number of the CAs;
and when the number of the CAs is larger than the preset threshold value, updating the first field of the first preset directory according to the number of the CAs, and updating the second field of the first preset directory to be a first preset value.
2. The method of claim 1, wherein the updating the first field of the first pre-determined directory according to the number of CAs when the number of CAs is greater than the preset threshold value, and the updating the second field of the first pre-determined directory to a first preset value comprises:
when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs;
updating the first field of the first preset directory according to the number of the CAs of the at least one preset partition, and updating the second field of the first preset directory to be the first preset value.
3. The method of claim 1, wherein the directory update policy is a second directory update policy, and wherein updating the first predetermined directory to be the second directory according to the directory update policy, the number of CAs and the location of the CA comprises:
determining the CA belonging to at least one target area in the CA according to the position of the CA;
updating a first part of a first field of the first preset directory according to the position of the CA of the at least one target area, updating a second part of the first field of the first preset directory according to the number of the CAs except the CA of the at least one target area in the CA, and updating a second field of the first preset directory to be a second preset value according to the at least one target area.
4. The method of any of claims 1 to 3, wherein the number of CAs accessing the target data address comprises: the number of CAs reading the target data address and the number of CAs writing back the target data address.
5. A catalog updating apparatus, comprising a processing unit,
the processing unit is used for determining a directory update strategy applicable to the current system; and the number of modules CA containing cache processors and the location of the CA for obtaining the address of the access target data; the system comprises a directory updating strategy, a number of CAs and positions of the CAs, and is used for updating a first preset directory into a second directory according to the directory updating strategy, the number of the CAs and the positions of the CAs, wherein the second directory comprises at least one directory structure;
the directory update policy is a first directory update policy, and in the aspect of updating a first preset directory into a second directory according to the directory update policy, the number of the CAs and the location of the CA, the processing unit is specifically configured to: when the number of the CAs is smaller than or equal to a preset threshold value, updating a first field of a first preset directory according to the positions of the CAs, and updating a second field of the first preset directory according to the number of the CAs; and updating the first field of the first preset directory according to the number of the CAs and updating the second field of the first preset directory to be a first preset value when the number of the CAs is greater than the preset threshold value.
6. The apparatus according to claim 5, wherein in the aspect that when the number of CAs is greater than the preset threshold, the first field of the first preset directory is updated according to the number of CAs, and the second field of the first preset directory is updated to a first preset value, the processing unit is specifically configured to: when the number of the CAs is larger than the preset threshold value, determining the number of the CAs in at least one preset partition according to the positions of the CAs; and the second field is used for updating the first field of the first preset directory according to the number of the CA of the at least one partition, and the second field of the first preset directory is updated to be the first preset value.
7. The apparatus of claim 5, wherein the directory update policy is a second directory update policy, and in the aspect of updating the first preset directory into the second directory according to the directory update policy, the number of CAs and the location of the CA, the processing unit is specifically configured to: determining the CA belonging to at least one target area in the CA according to the position of the CA; and the second part of the first field of the first preset directory is updated according to the number of the CA except the CA of the at least one target area in the CA, and the second field of the first preset directory is updated to be a second preset value according to the at least one target area.
8. The apparatus of any of claims 5 to 7, wherein the number of CAs accessing the target data address comprises: the number of CAs reading the target data address and the number of CAs writing back the target data address.
9. A computer device, comprising:
the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are connected through the communication bus and complete mutual communication;
the memory stores executable program code, the communication interface is for wireless communication;
the processor is configured to call the executable program code in the memory to perform the method as described in any of claims 1-4.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1-4.
CN201710208859.5A 2017-03-31 2017-03-31 Directory updating method and device Active CN108664417B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710208859.5A CN108664417B (en) 2017-03-31 2017-03-31 Directory updating method and device
PCT/CN2018/079822 WO2018177176A1 (en) 2017-03-31 2018-03-21 Catalogue update method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710208859.5A CN108664417B (en) 2017-03-31 2017-03-31 Directory updating method and device

Publications (2)

Publication Number Publication Date
CN108664417A CN108664417A (en) 2018-10-16
CN108664417B true CN108664417B (en) 2022-10-25

Family

ID=63675171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710208859.5A Active CN108664417B (en) 2017-03-31 2017-03-31 Directory updating method and device

Country Status (2)

Country Link
CN (1) CN108664417B (en)
WO (1) WO2018177176A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115587051B (en) * 2022-10-28 2023-06-16 海光信息技术股份有限公司 Cache directory updating method, data processing method, related device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1230721A (en) * 1998-02-17 1999-10-06 国际商业机器公司 Cache coherency protocol having hovering (H) state for instructions and data
CN104106061A (en) * 2012-02-08 2014-10-15 国际商业机器公司 Forward progress mechanism for stores in the presence of load contention in a system favoring loads

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080307169A1 (en) * 2007-06-06 2008-12-11 Duane Arlyn Averill Method, Apparatus, System and Program Product Supporting Improved Access Latency for a Sectored Directory
US8392665B2 (en) * 2010-09-25 2013-03-05 Intel Corporation Allocation and write policy for a glueless area-efficient directory cache for hotly contested cache lines
CN102346714B (en) * 2011-10-09 2014-07-02 西安交通大学 Consistency maintenance device for multi-kernel processor and consistency interaction method
CN103970678B (en) * 2014-04-21 2017-01-25 华为技术有限公司 Catalogue designing method and device
US9639276B2 (en) * 2015-03-27 2017-05-02 Intel Corporation Implied directory state updates
CN106406745B (en) * 2015-07-27 2020-06-09 华为技术有限公司 Method and device for maintaining Cache data consistency according to directory information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1230721A (en) * 1998-02-17 1999-10-06 国际商业机器公司 Cache coherency protocol having hovering (H) state for instructions and data
CN104106061A (en) * 2012-02-08 2014-10-15 国际商业机器公司 Forward progress mechanism for stores in the presence of load contention in a system favoring loads

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Demand-Based FTL Scheme Using Dualistic Approach on Data Blocks and Translation Blocks;Sehwan Lee;《 2011 IEEE 17th International Conference on Embedded and Real-Time Computing Systems and Applications》;IEEE;20110929;第167-175页 *
多核实时操作系统关键技术研究;张轶;《中国博士学位论文全文数据库(电子期刊)》;20160315(第3期);第I138-48页 *

Also Published As

Publication number Publication date
CN108664417A (en) 2018-10-16
WO2018177176A1 (en) 2018-10-04

Similar Documents

Publication Publication Date Title
CN105677580A (en) Method and device for accessing cache
US8762651B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
US8423736B2 (en) Maintaining cache coherence in a multi-node, symmetric multiprocessing computer
US20150189039A1 (en) Memory Data Access Method and Apparatus, and System
US10691601B2 (en) Cache coherence management method and node controller
EP2919120B1 (en) Memory monitoring method and related device
US10949289B1 (en) System and method for maintaining data integrity of data on a storage device
KR20170130388A (en) Asymmetric set combined cache
US20110320720A1 (en) Cache Line Replacement In A Symmetric Multiprocessing Computer
US20230289295A1 (en) Virtual Memory Management Method and Apparatus Supporting Physical Addresses Larger Than Virtual Addresses
TW201729214A (en) Systems, methods, and computer programs for resolving DRAM defects
CN107368435B (en) Simplified directory and method for realizing Cache consistency monitoring by utilizing same
JP6339697B2 (en) Cache memory error detection circuit for detecting a bit flip in a valid indicator in a cache memory after an invalidation operation, and related method and processor-based system
EP3296880B1 (en) Access system and method for data storage
US20220107752A1 (en) Data access method and apparatus
WO2016131175A1 (en) Method and device for accessing data visitor directory in multi-core system
CN105653539A (en) Index distributed storage implement method and device
US20140297957A1 (en) Operation processing apparatus, information processing apparatus and method of controlling information processing apparatus
WO2019140885A1 (en) Directory processing method and device, and storage system
KR102457671B1 (en) Provides space efficient storage for dynamic random access memory (DRAM) cache tags
CN108664417B (en) Directory updating method and device
CN107003932B (en) Cache directory processing method and directory controller of multi-core processor system
CN116107771B (en) Cache state recording method, data access method, related device and equipment
US8447934B2 (en) Reducing cache probe traffic resulting from false data sharing
US11886728B2 (en) Undo capability for memory devices

Legal Events

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