[go: up one dir, main page]

CN105045729B - A kind of buffer consistency processing method and system of the remote agent with catalogue - Google Patents

A kind of buffer consistency processing method and system of the remote agent with catalogue Download PDF

Info

Publication number
CN105045729B
CN105045729B CN201510567913.6A CN201510567913A CN105045729B CN 105045729 B CN105045729 B CN 105045729B CN 201510567913 A CN201510567913 A CN 201510567913A CN 105045729 B CN105045729 B CN 105045729B
Authority
CN
China
Prior art keywords
request
directory
local
remote
state
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
CN201510567913.6A
Other languages
Chinese (zh)
Other versions
CN105045729A (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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201510567913.6A priority Critical patent/CN105045729B/en
Publication of CN105045729A publication Critical patent/CN105045729A/en
Application granted granted Critical
Publication of CN105045729B publication Critical patent/CN105045729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Multi Processors (AREA)

Abstract

本发明公开了一种远端代理带目录的缓存一致性处理方法与系统,令远端代理获取本地请求源发起的本地请求并进行处理,当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存,判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求,从本地请求发送到远端代理占据一项目录和数据缓存开始,至该笔请求的响应报文返回,在远端代理内部缓存资源失效为止的时间内,若有其它满足一定条件下同地址请求或侦听报文进入远端代理,该笔请求可以在远端代理内部直接处理,减少报文流转快速得到响应,无需跨节点操作,减小开销。

The invention discloses a cache consistency processing method and system of a remote agent with a directory, which enables the remote agent to obtain and process a local request initiated by a local request source, and when receiving a response message from the remote agent and data, return the response message and data to the local request source, write the corresponding directory and data into the directory cache and data cache respectively, and determine whether there are other target requests with the same address as the remote agent , if there is, then process the target requests sequentially, from the time when the local request is sent to the remote agent to occupy a directory and data cache, until the response message of the request is returned, and the internal cache resource of the remote agent becomes invalid , if there are other requests or listener messages from the same address that meet certain conditions and enter the remote agent, the request can be directly processed inside the remote agent, reducing message flow and getting a quick response without cross-node operations, reducing overhead.

Description

一种远端代理带目录的缓存一致性处理方法与系统A remote agent cache consistency processing method and system with directory

技术领域technical field

本发明涉及计算机体系结构领域,特别是涉及一种远端代理带目录的缓存一致性处理方法与系统。The invention relates to the field of computer architecture, in particular to a method and a system for processing cache consistency with a directory of a remote agent.

背景技术Background technique

基于一致性互联芯片的多路服务器系统,在实现过程中需要保持数据的cache缓存一致性。在目前cache一致性协议实现的过程中,本地代理和远端代理分别作为代理远端请求和本地请求的主体,是一致性芯片协议处理的两个主要部分。A multi-channel server system based on a coherent interconnection chip needs to maintain data cache consistency during the implementation process. In the process of implementing the current cache coherence protocol, the local proxy and the remote proxy act as the main body of proxying remote requests and local requests respectively, and are the two main parts of the coherence chip protocol processing.

为了减少中间过程中的侦听报文,加快系统的响应速度,远端代理和本地代理都可以采用“目录”的方式记录Cache Line缓存行的数据状态。然而,随着多路服务器系统,管理的物理存储资源越来越大,采用“目录”方式的存储资源开销也越来越大,尤其是多路系统的远端代理一侧。均衡考虑,在实现的过程中,往往采用远端代理无“目录”,本地代理采用全“目录”的方式,缺少一种开销较小的远端代理带目录的缓存一致性处理方法。In order to reduce interception messages in the intermediate process and speed up the response speed of the system, both the remote agent and the local agent can record the data status of the Cache Line cache line in the form of a "directory". However, as the multi-way server system manages more and more physical storage resources, the storage resource overhead of the "directory" method is also increasing, especially on the remote agent side of the multi-way system. Considering the balance, in the process of implementation, the remote agent has no "directory" and the local agent adopts a full "directory". There is a lack of a cache consistency processing method with a relatively small overhead and a remote agent with a directory.

发明内容Contents of the invention

有鉴于此,本发明的主要目的在于提供一种远端代理带目录的缓存一致性处理方法与系统,使远端代理带目录且有较小开销。In view of this, the main purpose of the present invention is to provide a cache consistency processing method and system for a remote agent with a directory, so that the remote agent has a directory with less overhead.

为实现上述目的,本发明提供了一种远端代理带目录的缓存一致性处理方法,包括:In order to achieve the above object, the present invention provides a cache consistency processing method with a remote proxy directory, including:

步骤A:令远端代理获取本地请求源发起的本地请求并进行处理;Step A: Make the remote agent obtain and process the local request initiated by the local request source;

步骤B:当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;Step B: When receiving the response message and data from the remote agent, return the response message and data to the local request source, and write the corresponding directory and data into the directory cache and data cache respectively ;

步骤C:判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求。Step C: Judging whether there are other target requests with the same address as the remote agent, and if so, processing the target requests in sequence.

优选地,与所述远端代理的地址相同的其他目标请求包括:Preferably, other target requests identical to the address of the remote agent include:

本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求。The local request source sends a local request to the address of the remote agent and a remote listening request from the address of the remote agent.

优选地,处理所述目标请求包括:Preferably, processing the target request includes:

判断所述目标请求的类型;determine the type of the target request;

当所述目标请求的类型为本地请求时,根据该本地请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求;When the type of the target request is a local request, process the target request according to the priority level of the local request and the directory state information in the directory cache;

当所述目标请求的类型为远端侦听请求时,根据该远端侦听请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求。When the type of the target request is a remote listening request, the target request is processed according to the priorities of the remote listening request and the directory status information in the directory cache.

优选地,所述状态信息包括修改态、独占态、共享态和无效态;Preferably, the state information includes modified state, exclusive state, shared state and invalid state;

所述修改态与独占态的优先级别相同,且高于所述共享态,所述共享态的优先级别高于所述无效态。The modified state has the same priority as the exclusive state and is higher than the shared state, and the shared state has a higher priority than the invalid state.

优选地,当所述目标请求的类型为本地请求时,根据该本地请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求:Preferably, when the type of the target request is a local request, the target request is processed according to the priority levels of the local request and the directory status information in the directory cache:

判断所述目录缓存的目录的优先级别是否高于或等同于该本地请求的优先级别;judging whether the priority level of the directory in the directory cache is higher than or equal to the priority level of the local request;

如果所述目录缓存的目录的优先级别高于或等同于该本地请求的优先级别时,保持远端地址数据在本地的状态信息不变,发起本地侦听,当所述本地侦听的响应返回时修改本地请求源对应的目录信息;If the priority level of the directory in the directory cache is higher than or equal to the priority level of the local request, keep the local state information of the remote address data unchanged, initiate local listening, and return when the response of the local listening When modifying the directory information corresponding to the local request source;

判断同地址请求队列为空且缓存资源需要释放的条件是否满足,如果不满足则返回所述步骤C,如果满足则判断目录状态信息是否为修改态,当所述目录状态信息非修改态时结束流程,当所述目录状态信息为修改态时,判断是否仅有一个请求源有副本时,如果是则结束流程,否则发起共享态写回请求,收到写回完成信息时释放对应资源并结束流程;Judging whether the same-address request queue is empty and the condition that the cache resource needs to be released is satisfied, if not, return to the step C, if satisfied, judge whether the directory status information is in the modified state, and end when the directory state information is not in the modified state Process, when the directory status information is in the modified state, judge whether there is only one request source with a copy, if so, end the process, otherwise initiate a shared state write-back request, release the corresponding resource and end when receiving the write-back completion information process;

如果所述目录缓存的目录的优先级别低于该本地请求的优先级别时,发起本地请求的失效侦听,失效本地请求源内数据,当所述失效侦听响应返回时向所述远端地址发起写回请求,收到写回请求完成信息时,向远端发起当前本地请求。If the priority level of the directory in the directory cache is lower than the priority level of the local request, initiate an invalidation interception of the local request, invalidate the data in the source of the local request, and initiate to the remote address when the invalidation interception response returns Write back request, when receiving the write back request completion information, initiate the current local request to the remote end.

优选地,当所述目标请求的类型为远端侦听请求时,根据该远端侦听请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求包括:Preferably, when the type of the target request is a remote listening request, processing the target request according to the priority level of the remote listening request and the directory status information in the directory cache includes:

判断所述目录缓存的目录的状态信息与该远端侦听请求的状态信息是否同为共享态,如果是则向远端返回共享态响应报文,并返回步骤C,否则发起与该远端侦听请求相同的本地侦听请求或失效侦听请求,当当所述本地侦听请求或失效侦听请求响应返回时,根据返回的响应更新或失效本地目录缓存和数据缓存,并返回步骤C。Judging whether the state information of the directory of the directory cache and the state information of the remote listening request are shared states, if so, return a shared state response message to the remote end, and return to step C, otherwise initiate and communicate with the remote end For the same local listening request or invalid listening request as the listening request, when the response of the local listening request or invalid listening request is returned, update or invalidate the local directory cache and data cache according to the returned response, and return to step C.

本发明还提供了一种远端代理带目录的缓存一致性处理系统,包括:The present invention also provides a remote proxy cache consistency processing system with directories, including:

初始处理模块,用于令远端代理获取本地请求源发起的本地请求并进行处理;The initial processing module is used to enable the remote agent to obtain and process the local request initiated by the local request source;

响应模块,用于当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;A response module, configured to return the response message and data to the local request source when receiving the response message and data from the remote agent, and write the corresponding directory and data into the directory cache and data cache;

同地址处理模块,用于判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求。The same address processing module is used to judge whether there are other target requests with the same address as the remote agent, and if so, process the target requests sequentially.

优选地,与所述远端代理的地址相同的其他目标请求包括:Preferably, other target requests identical to the address of the remote agent include:

本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求。The local request source sends a local request to the address of the remote agent and a remote listening request from the address of the remote agent.

应用本发明提供的一种远端代理带目录的缓存一致性处理方法与系统,令远端代理获取本地请求源发起的本地请求并进行处理,当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存,判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求,从本地请求发送到远端代理占据一项目录和数据缓存开始,至该笔请求的响应报文返回,在远端代理内部缓存资源失效为止的时间内,若有其它满足一定条件下同地址请求或侦听报文进入远端代理,该笔请求可以在远端代理内部直接处理,减少报文流转快速得到响应,无需跨节点操作,减小开销。Applying the cache consistency processing method and system of a remote agent with directory provided by the present invention enables the remote agent to obtain and process the local request initiated by the local request source, and when receiving the response message from the remote agent and data, return the response message and data to the local request source, write the corresponding directory and data into the directory cache and data cache respectively, and determine whether there are other targets with the same address as the remote agent Request, if there is, process the target request in sequence, from the time when the local request is sent to the remote agent to occupy a directory and data cache, until the response message of the request is returned, and the internal cache resource of the remote agent becomes invalid If there are other requests or listener messages from the same address that meet certain conditions and enter the remote agent, the request can be directly processed inside the remote agent, reducing message flow and getting a quick response without cross-node operations, reducing overhead .

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

图1为本发明一种远端代理带目录的缓存一致性处理方法实施例一的流程图;Fig. 1 is the flow chart of Embodiment 1 of a cache consistency processing method with a remote agent with a directory in the present invention;

图2为本发明一种远端代理带目录的缓存一致性处理方法实施例二的流程图;Fig. 2 is the flow chart of Embodiment 2 of a cache consistency processing method with a remote agent with directory in the present invention;

图3为本发明实施例二的缓存结构示意图;FIG. 3 is a schematic diagram of a cache structure in Embodiment 2 of the present invention;

图4为本发明一种远端代理带目录的缓存一致性处理系统实施例三的结构示意图。FIG. 4 is a schematic structural diagram of Embodiment 3 of a cache consistency processing system with a remote proxy directory in the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

实施例一:Embodiment one:

本发明提供了一种远端代理带目录的缓存一致性处理方法,图1示出了本发明远端代理带目录的缓存一致性处理方法的实施例一流程图,包括:The present invention provides a method for processing cache consistency of a remote agent with a directory. FIG. 1 shows a flow chart of Embodiment 1 of the method for processing cache consistency with a remote agent with a directory of the present invention, including:

步骤S101:令远端代理获取本地请求源发起的本地请求并进行处理;Step S101: Make the remote agent obtain and process the local request initiated by the local request source;

本地请求报文处理,远端代理获取本地请求并处理。The local request message is processed, and the remote agent obtains and processes the local request.

步骤S102:当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;Step S102: When receiving the response message and data from the remote agent, return the response message and data to the local request source, and write the corresponding directory and data into the directory cache and data cache respectively ;

将远端代理的响应报文和对应数据返回请求源,将对应的目录和数据分别写入目录缓存和数据缓存。Return the response message and corresponding data of the remote agent to the request source, and write the corresponding directory and data into the directory cache and data cache respectively.

步骤S103:判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求。Step S103: Determine whether there are other target requests with the same address as the remote agent, and if so, process the target requests in sequence.

目标请求的类型包括本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求,判断是否有同地址的本地请求或远端侦听请求,如果有则按这些请求或侦听报文进入流水线的顺序,写入对应的排队序列并依次处理。The type of target request includes the local request sent by the local request source to the address of the remote agent and the remote listening request from the address of the remote agent, and it is judged whether there is a local request or a remote listening request with the same address , if there is, write the corresponding queuing sequence according to the order in which these request or listening messages enter the pipeline and process them sequentially.

应用本实施例提供的一种远端代理带目录的缓存一致性处理方法,令远端代理获取本地请求源发起的本地请求并进行处理,当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存,判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求,从本地请求发送到远端代理占据一项目录和数据缓存开始,至该笔请求的响应报文返回,在远端代理内部缓存资源失效为止的时间内,若有其它满足一定条件下同地址请求或侦听报文进入远端代理,该笔请求可以在远端代理内部直接处理,减少报文流转快速得到响应,无需跨节点操作,减小开销。Applying a method for processing cache consistency with a remote agent with a directory provided in this embodiment enables the remote agent to obtain and process the local request initiated by the local request source. When receiving the response message from the remote agent and data, return the response message and data to the local request source, write the corresponding directory and data into the directory cache and data cache respectively, and determine whether there are other target requests with the same address as the remote agent , if there is, then process the target requests sequentially, from the time when the local request is sent to the remote agent to occupy a directory and data cache, until the response message of the request is returned, and the internal cache resource of the remote agent becomes invalid , if there are other requests or listener messages from the same address that meet certain conditions and enter the remote agent, the request can be directly processed inside the remote agent, reducing message flow and getting a quick response without cross-node operations, reducing overhead.

实施例二:Embodiment two:

图2示出了本发明远端代理带目录的缓存一致性处理方法实施例二,具体步骤如下:Fig. 2 shows Embodiment 2 of the cache consistency processing method of the remote proxy belt directory of the present invention, and the specific steps are as follows:

①调度开始,远端代理正常处理本地请求源发起的本地请求,等待直到该笔请求的响应和数据返回远端代理为止,将该远端响应报文和对应数据返回请求源,并将该目录和数据信息,写入目录缓存和数据缓存。在此时间内,如果有其它同地址的本地请求或远端侦听报文进入远端代理,可以将这些请求或侦听报文按进入流水线的顺序,写入对应的排队序列。① Scheduling starts, the remote agent normally processes the local request initiated by the local request source, waits until the response and data of the request are returned to the remote agent, returns the remote response message and corresponding data to the request source, and saves the directory And data information, write directory cache and data cache. During this time, if there are other local requests or remote listening messages with the same address entering the remote agent, these requests or listening messages can be written into the corresponding queuing sequence in the order of entering the pipeline.

②判断该远端地址对应的排队序列,是否为空。如果为空,则调度流程结束,对应缓存资源可以被其它请求占用,否则需要判断排队序列内待处理的报文是本地请求报文,还是远端侦听报文,并判断其所要求的数据状态与目录缓存内的记录的目录信息状态进行优先级对比。其中,两者之间关系情况引入的四种子情况如下述流程3、4、5、6所述。② Determine whether the queuing sequence corresponding to the remote address is empty. If it is empty, the scheduling process ends, and the corresponding cache resource can be occupied by other requests. Otherwise, it is necessary to determine whether the message to be processed in the queue sequence is a local request message or a remote listening message, and determine the required data The status is compared with the directory information status of records in the directory cache for priority. Among them, the four sub-cases introduced by the relationship between the two are as described in the following processes 3, 4, 5, and 6.

③若该报文为本地请求报文,且目录缓存内的目录信息需要降级或保持,即当前目录缓存内的目录级别高于本地请求报文所要求的目录级别,或与之平级。则目录缓存内的数据无需更新,目录无需修改或和只进行平级修改,并向本地请求源发起侦听报文,待侦听响应返回后,将缓存内的母本数据的副本发送给请求源,并根据实际拥有副本数据的情况,修改标记目录缓存中拥有最新副本数据的Bit位信息,完成该笔请求。如果条件不能满足后续排队请求队列为空,且有新的报文申请占用该缓存资源,则流程跳转到2。否则,需要判断当前目录缓存状态是否为M态,如果为M态,且不止一个本地请求源拥有数据缓存信息,则发起可以将本地数据标记为S态的写回请求,待收到写回响应后释放资源。否则,直接释放资源。③ If the message is a local request message, and the directory information in the directory cache needs to be downgraded or maintained, that is, the directory level in the current directory cache is higher than or equal to the directory level required by the local request message. Then the data in the directory cache does not need to be updated, the directory does not need to be modified or only modified at the same level, and a listening message is sent to the local request source. After the listening response is returned, a copy of the master data in the cache is sent to the request Source, and according to the actual copy data, modify the bit information of the latest copy data in the tag directory cache to complete the request. If the condition cannot be satisfied, the subsequent queuing request queue is empty, and there is a new message application to occupy the cache resource, then the process jumps to 2. Otherwise, it is necessary to determine whether the current directory cache status is M status. If it is M status and more than one local request source has data cache information, initiate a writeback request that can mark the local data as S status, and wait for the writeback response to be received Then release the resource. Otherwise, release the resource directly.

④若该报文为本地请求报文,且目录缓存内的目录信息需要升级,即当前目录缓存内的目录级别低于本地请求报文所要求的目录级别。则远端代理向拥有最新副本的请求源发起失效侦听报文,待收齐失效侦听响应后,根据目录缓存信息向远端发起写回请求,待写回响应收齐后,跳转到流程1,处理当前的请求报文。④ If the message is a local request message, and the directory information in the directory cache needs to be upgraded, that is, the directory level in the current directory cache is lower than the directory level required by the local request message. Then the remote agent sends an invalidation listening message to the request source with the latest copy. After receiving the invalidation listening response, it sends a write-back request to the remote end according to the directory cache information. After the write-back response is collected, it jumps to Process 1, processing the current request packet.

⑤若该报文为远端侦听报文,且目录缓存内的目录信息与侦听报文要求的目录信息同为S态。则远端代理直接返回S态响应报文,并跳转至流程2。⑤ If the message is a remote listening message, and the directory information in the directory cache and the directory information required by the listening message are both in the S state. Then the remote agent directly returns the S-state response message and jumps to process 2.

⑥若该报文为远端侦听报文,且目录缓存内的目录信息与侦听报文要求的目录信息不同为S态。则需要根据侦听报文所要求的目录状态与当前缓存内的目录信息进行判断。如果前者优先级高或前者要求的目录状态为E态,则远端代理向拥有本地最新数据的请求源发起失效侦听请求,否则,远端代理向拥有本地最新数据的请求源发起与该远端侦听报文相同的侦听报文。当所有侦听报文收齐后,然后根据侦听响应失效或更新本地目录缓存和数据缓存,并跳转至流程2。⑥ If the message is a remote listening message, and the directory information in the directory cache is different from the directory information required by the listening message, it is in the S state. Then it needs to judge according to the directory state required by the listening message and the directory information in the current cache. If the former has a high priority or the directory status required by the former is E state, the remote agent initiates an invalidation listening request to the request source with the latest local data, otherwise, the remote agent initiates a request to the remote request source with the latest local data The listener message is the same as the listener message at the end. After all the interception messages are collected, invalidate or update the local directory cache and data cache according to the interception response, and jump to process 2.

本实施例中根据远端代理的处理能力,预分配远端代理带目录的缓存资源,缓存结构示意图如图3所示。该缓存资源的每一项,都由索引ID,目录缓存和数据缓存组成。其中,索引ID与当前处理请求在远端代理内部所占据的状态信息表项一一对应;目录缓存由2Bit远端地址数据在本地的状态信息和N Bit本地各请求源对应的目录信息组成。其中,ST0,ST1,初始化为0,2B’00表示该远端地址对应数据为无效态,标记为I,2B’01为共享态,标记为S,2B’10为独占态,标记为E,2B’11为修改态,标记为M。我们规定E态和M态为最高优先级,S态次之,I优先级最低,那么当该远端地址对应数据的状态从高优先级修改为低优先级称为降级,反之称为升级,E态和M态的转化,称之为保持。本地各请求源对应的目录信息的个数N,对应本地可以向远端发起请求的请求源的个数,初始化为0,若对应请求源的Bit位,标记为1,那么表示该Bit位对应的请求源拥有最新的副本数据。数据缓存存放对应远端地址最新的母本数据,其中从0到M,表示该远端数据长度,一般情况下该长度是固定的。In this embodiment, according to the processing capability of the remote agent, cache resources with directories are pre-allocated on the remote agent, and a schematic diagram of the cache structure is shown in FIG. 3 . Each item of the cache resource consists of index ID, directory cache and data cache. Among them, the index ID is in one-to-one correspondence with the state information table items occupied by the current processing request in the remote agent; the directory cache consists of the local state information of 2Bit remote address data and the directory information corresponding to N Bit local request sources. Among them, ST0, ST1 are initialized to 0, 2B'00 indicates that the data corresponding to the remote address is invalid, marked as I, 2B'01 is shared, marked as S, 2B'10 is exclusive, marked as E, 2B'11 is a modified state, marked as M. We stipulate that the E state and M state are the highest priority, the S state is next, and the I priority is the lowest. Then when the state of the data corresponding to the remote address is changed from high priority to low priority, it is called downgrading, and vice versa is called upgrading. The conversion of E state and M state is called maintenance. The number N of directory information corresponding to each local request source corresponds to the number of local request sources that can initiate requests to the remote end. It is initialized to 0. If the bit corresponding to the request source is marked as 1, it means that the bit corresponds to The requesting source of has the latest replica data. The data cache stores the latest master data corresponding to the remote address, where 0 to M indicates the length of the remote data, which is generally fixed.

实施例三:Embodiment three:

本发明还提供了一种远端代理带目录的缓存一致性处理系统,图4示出了本发明远端代理带目录的缓存一致性处理系统实施例三的结构示意图,包括:The present invention also provides a cache consistency processing system with a remote proxy directory. FIG. 4 shows a schematic structural diagram of Embodiment 3 of the cache consistency processing system with a remote proxy directory in the present invention, including:

初始处理模块101,用于令远端代理获取本地请求源发起的本地请求并进行处理;The initial processing module 101 is configured to enable the remote agent to obtain and process the local request initiated by the local request source;

响应模块102,用于当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;The response module 102 is configured to return the response message and data to the local request source when receiving the response message and data from the remote agent, and write the corresponding directory and data into the directory cache respectively and data caching;

同地址处理模块103,用于判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求。The same address processing module 103 is configured to judge whether there are other target requests with the same address as the remote agent, and if so, process the target requests in sequence.

本实施例中与所述远端代理的地址相同的其他目标请求包括:Other target requests identical to the address of the remote proxy in this embodiment include:

本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求。The local request source sends a local request to the address of the remote agent and a remote listening request from the address of the remote agent.

应用本实施例提供的一种远端代理带目录的缓存一致性处理系统,令远端代理获取本地请求源发起的本地请求并进行处理,当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存,判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求,从本地请求发送到远端代理占据一项目录和数据缓存开始,至该笔请求的响应报文返回,在远端代理内部缓存资源失效为止的时间内,若有其它满足一定条件下同地址请求或侦听报文进入远端代理,该笔请求可以在远端代理内部直接处理,减少报文流转快速得到响应,无需跨节点操作,减小开销。Applying the cache coherency processing system with directory provided by the remote agent in this embodiment enables the remote agent to obtain and process the local request initiated by the local request source. When receiving the response message and data, return the response message and data to the local request source, write the corresponding directory and data into the directory cache and data cache respectively, and determine whether there are other target requests with the same address as the remote agent , if there is, then process the target requests sequentially, from the time when the local request is sent to the remote agent to occupy a directory and data cache, until the response message of the request is returned, and the internal cache resource of the remote agent becomes invalid , if there are other requests or listener messages from the same address that meet certain conditions and enter the remote agent, the request can be directly processed inside the remote agent, reducing message flow and getting a quick response without cross-node operations, reducing overhead.

需要说明的是,本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。对于系统类实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. For the same and similar parts in each embodiment, refer to each other, that is, Can. As for the system embodiment, because it is basically similar to the method embodiment, the description is relatively simple, and for the related parts, please refer to the part of the description of the method embodiment.

最后,还需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements not only includes those elements, but also other elements not expressly listed, or elements inherent in the process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.

以上对本发明所提供的方法、系统和移动终端进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method, system and mobile terminal provided by the present invention have been introduced in detail above. In this paper, specific examples have been used to illustrate the principle and implementation of the present invention. The descriptions of the above embodiments are only used to help understand the methods and methods of the present invention. Its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. limit.

Claims (2)

1.一种远端代理带目录的缓存一致性处理方法,其特征在于,包括:1. A cache consistency processing method of a remote proxy band directory, characterized in that, comprising: 步骤A:令远端代理获取本地请求源发起的本地请求并进行处理;Step A: Make the remote agent obtain and process the local request initiated by the local request source; 步骤B:当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;Step B: When receiving the response message and data from the remote agent, return the response message and data to the local request source, and write the corresponding directory and data into the directory cache and data cache respectively ; 步骤C:判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求;Step C: judging whether there are other target requests with the same address as the remote agent, and if so, processing the target requests in sequence; 其中,所述其他目标请求包括本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求;所述处理所述目标请求包括:判断所述目标请求的类型;当所述目标请求的类型为本地请求时,根据该本地请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求;当所述目标请求的类型为远端侦听请求时,根据该远端侦听请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求;所述目录状态信息包括:修改态、独占态、共享态和无效态;所述修改态与独占态的优先级别相同,且高于所述共享态,所述共享态的优先级别高于所述无效态;Wherein, the other target requests include a local request sent by a local request source to the address of the remote agent and a remote listening request from the address of the remote agent; the processing of the target request includes: judging the the type of the target request; when the type of the target request is a local request, process the target request according to the priority level of the local request and the directory state information cached in the directory; when the type of the target request is a remote When listening to the request, process the target request according to the priority level of the remote listening request and the directory status information of the directory cache; the directory status information includes: modified state, exclusive state, shared state and invalid state; The modified state has the same priority as the exclusive state, and is higher than the shared state, and the shared state has a higher priority than the invalid state; 当所述目标请求的类型为所述本地请求时,判断所述目录缓存的目录的优先级别是否高于或等同于该本地请求的优先级别;如果所述目录缓存的目录的优先级别高于或等同于该本地请求的优先级别时,保持远端地址数据在本地的状态信息不变,发起本地侦听,当所述本地侦听的响应返回时修改本地请求源对应的目录信息;判断同地址请求队列为空且缓存资源需要释放的条件是否满足,如果不满足则返回所述步骤C,如果满足则判断目录状态信息是否为修改态,当所述目录状态信息非修改态时结束流程,当所述目录状态信息为修改态时,判断是否仅有一个请求源有副本时,如果是则结束流程,否则发起共享态写回请求,收到写回完成信息时释放对应资源并结束流程;如果所述目录缓存的目录的优先级别低于该本地请求的优先级别时,发起本地请求的失效侦听,失效本地请求源内数据,当所述失效侦听响应返回时向所述远端地址发起写回请求,收到写回请求完成信息时,向远端发起当前本地请求;When the type of the target request is the local request, determine whether the priority level of the directory cached by the directory is higher than or equal to the priority level of the local request; if the priority level of the directory cached by the directory is higher than or When it is equal to the priority level of the local request, keep the local state information of the remote address data unchanged, initiate local interception, and modify the directory information corresponding to the local request source when the response of the local interception is returned; determine the same address Whether the request queue is empty and the condition that the cache resource needs to be released is satisfied, if not, return to the step C, if satisfied, determine whether the directory status information is in the modified state, end the process when the directory state information is not in the modified state, and when When the directory status information is in the modified state, when judging whether there is only one request source with a copy, if so, end the process, otherwise initiate a shared state write-back request, release the corresponding resource and end the process when receiving the write-back completion message; if When the priority level of the directory in the directory cache is lower than the priority level of the local request, initiate invalidation monitoring of the local request, invalidate the data in the source of the local request, and initiate a write to the remote address when the invalidation monitoring response returns Return request, when receiving the write-back request completion information, initiate the current local request to the remote end; 当所述目标请求的类型为远端侦听请求时,判断所述目录缓存的目录的状态信息与该远端侦听请求的状态信息是否同为共享态,如果是则向远端返回共享态响应报文,并返回步骤C,否则发起与该远端侦听请求相同的本地侦听请求或失效侦听请求,当当所述本地侦听请求或失效侦听请求响应返回时,根据返回的响应更新或失效本地目录缓存和数据缓存,并返回步骤C。When the type of the target request is a remote listening request, it is judged whether the status information of the directory cached in the directory and the status information of the remote listening request are shared, and if so, return the shared status to the far end Respond to the message, and return to step C, otherwise initiate the same local interception request or invalidation interception request as the remote interception request, when the local interception request or invalidation interception request response returns, according to the returned response Update or invalidate the local directory cache and data cache, and return to step C. 2.一种远端代理带目录的缓存一致性处理系统,其特征在于,包括:2. A cache coherency processing system with a remote proxy band directory, characterized in that it comprises: 初始处理模块,用于令远端代理获取本地请求源发起的本地请求并进行处理;The initial processing module is used to enable the remote agent to obtain and process the local request initiated by the local request source; 响应模块,用于当收到来自所述远端代理的响应报文和数据时,将所述响应报文和数据返回所述本地请求源,并将对应的目录和数据分别写入目录缓存与数据缓存;A response module, configured to return the response message and data to the local request source when receiving the response message and data from the remote agent, and write the corresponding directory and data into the directory cache and data cache; 同地址处理模块,用于判断是否有与所述远端代理的地址相同的其他目标请求,如果有则依次处理所述目标请求;其中,所述其他目标请求包括本地请求源发向所述远端代理的地址的本地请求与来自所述远端代理的地址的远端侦听请求;所述处理所述目标请求包括:判断所述目标请求的类型;当所述目标请求的类型为本地请求时,根据该本地请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求;当所述目标请求的类型为远端侦听请求时,根据该远端侦听请求与所述目录缓存的目录状态信息的优先级别处理所述目标请求;所述目录状态信息包括:修改态、独占态、共享态和无效态;所述修改态与独占态的优先级别相同,且高于所述共享态,所述共享态的优先级别高于所述无效态;当所述目标请求的类型为所述本地请求时,判断所述目录缓存的目录的优先级别是否高于或等同于该本地请求的优先级别;如果所述目录缓存的目录的优先级别高于或等同于该本地请求的优先级别时,保持远端地址数据在本地的状态信息不变,发起本地侦听,当所述本地侦听的响应返回时修改本地请求源对应的目录信息;判断同地址请求队列为空且缓存资源需要释放的条件是否满足,如果不满足则返回所述同地址处理模块,如果满足则判断目录状态信息是否为修改态,当所述目录状态信息非修改态时结束流程,当所述目录状态信息为修改态时,判断是否仅有一个请求源有副本时,如果是则结束流程,否则发起共享态写回请求,收到写回完成信息时释放对应资源并结束流程;如果所述目录缓存的目录的优先级别低于该本地请求的优先级别时,发起本地请求的失效侦听,失效本地请求源内数据,当所述失效侦听响应返回时向所述远端地址发起写回请求,收到写回请求完成信息时,向远端发起当前本地请求;当所述目标请求的类型为远端侦听请求时,判断所述目录缓存的目录的状态信息与该远端侦听请求的状态信息是否同为共享态,如果是则向远端返回共享态响应报文,并返回所述同地址处理模块,否则发起与该远端侦听请求相同的本地侦听请求或失效侦听请求,当当所述本地侦听请求或失效侦听请求响应返回时,根据返回的响应更新或失效本地目录缓存和数据缓存,并返回所述同地址处理模块。The same address processing module is used to judge whether there are other target requests with the same address as the remote agent, and if so, process the target requests sequentially; wherein, the other target requests include those sent by the local request source to the remote agent. The local request of the address of the end proxy and the remote listening request from the address of the remote proxy; the processing of the target request includes: judging the type of the target request; when the type of the target request is a local request , process the target request according to the priority level of the local request and the directory state information cached in the directory; when the type of the target request is a remote listening request, process the target request according to the remote listening request and the directory The priority level of the cached directory state information processes the target request; the directory state information includes: modified state, exclusive state, shared state and invalid state; the priority level of the modified state is the same as that of the exclusive state, and is higher than the Shared state, the priority level of the shared state is higher than the invalid state; when the type of the target request is the local request, it is judged whether the priority level of the directory in the directory cache is higher than or equal to the local request priority level; if the priority level of the directory in the directory cache is higher than or equal to the priority level of the local request, keep the local state information of the remote address data unchanged, initiate local monitoring, and when the local monitoring Modify the directory information corresponding to the local request source when the listened response is returned; judge whether the same-address request queue is empty and the condition that the cache resource needs to be released is satisfied, if not, return to the same-address processing module, and if so, judge the directory status information Whether it is in the modified state, when the directory status information is not in the modified state, end the process, when the directory status information is in the modified state, judge whether only one request source has a copy, if so, end the process, otherwise initiate the shared state For a write-back request, when the write-back completion message is received, the corresponding resources are released and the process ends; if the priority level of the directory in the directory cache is lower than the priority level of the local request, the invalidation interception of the local request is initiated, and the invalidation local request source Data, when the failure listening response returns, initiate a write-back request to the remote address, and when receiving the completion information of the write-back request, initiate a current local request to the remote end; when the type of the target request is remote detection When listening to the request, judge whether the state information of the directory cached in the directory and the state information of the remote listening request are in a shared state, if so, return a shared state response message to the remote end, and return the same address processing Module, otherwise initiate the same local listening request or invalidation listening request as the remote listening request, when the local listening request or invalidation listening request response returns, update or invalidate the local directory cache and The data is cached and returned to the same-address processing module.
CN201510567913.6A 2015-09-08 2015-09-08 A kind of buffer consistency processing method and system of the remote agent with catalogue Active CN105045729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510567913.6A CN105045729B (en) 2015-09-08 2015-09-08 A kind of buffer consistency processing method and system of the remote agent with catalogue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510567913.6A CN105045729B (en) 2015-09-08 2015-09-08 A kind of buffer consistency processing method and system of the remote agent with catalogue

Publications (2)

Publication Number Publication Date
CN105045729A CN105045729A (en) 2015-11-11
CN105045729B true CN105045729B (en) 2018-11-23

Family

ID=54452292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510567913.6A Active CN105045729B (en) 2015-09-08 2015-09-08 A kind of buffer consistency processing method and system of the remote agent with catalogue

Country Status (1)

Country Link
CN (1) CN105045729B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341114B (en) * 2016-04-29 2021-06-01 华为技术有限公司 A method, node controller and system for directory management
US10282297B2 (en) * 2017-02-08 2019-05-07 Arm Limited Read-with overridable-invalidate transaction
CN107368435B (en) * 2017-07-19 2020-03-06 郑州云海信息技术有限公司 A simplified directory and a method for implementing Cache consistency monitoring by using the simplified directory
CN107634982A (en) * 2017-07-27 2018-01-26 郑州云海信息技术有限公司 A method for realizing remote agent directory of multi-channel server interconnection chip
CN107249008B (en) * 2017-07-28 2020-09-22 苏州浪潮智能科技有限公司 Channel interconnection device and method for remote data direct access
CN109684237B (en) * 2018-11-20 2021-06-01 华为技术有限公司 Data access method and device based on multi-core processor
CN118260304B (en) * 2024-05-29 2024-08-13 山东云海国创云计算装备产业创新中心有限公司 Request processing method, device, equipment and medium based on cache consistency directory

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049422A (en) * 2012-12-17 2013-04-17 浪潮电子信息产业股份有限公司 A method for constructing a multi-processor node system with multiple cache coherency domains
CN103294611A (en) * 2013-03-22 2013-09-11 浪潮电子信息产业股份有限公司 Server node data cache method based on limited data consistency state
CN103294612A (en) * 2013-03-22 2013-09-11 浪潮电子信息产业股份有限公司 Method for constructing Share-F state in local domain of multi-level cache consistency domain system
CN103870435A (en) * 2014-03-12 2014-06-18 华为技术有限公司 Server and data access method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6578113B2 (en) * 1997-06-02 2003-06-10 At&T Corp. Method for cache validation for proxy caches

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049422A (en) * 2012-12-17 2013-04-17 浪潮电子信息产业股份有限公司 A method for constructing a multi-processor node system with multiple cache coherency domains
CN103294611A (en) * 2013-03-22 2013-09-11 浪潮电子信息产业股份有限公司 Server node data cache method based on limited data consistency state
CN103294612A (en) * 2013-03-22 2013-09-11 浪潮电子信息产业股份有限公司 Method for constructing Share-F state in local domain of multi-level cache consistency domain system
CN103870435A (en) * 2014-03-12 2014-06-18 华为技术有限公司 Server and data access method

Also Published As

Publication number Publication date
CN105045729A (en) 2015-11-11

Similar Documents

Publication Publication Date Title
CN105045729B (en) A kind of buffer consistency processing method and system of the remote agent with catalogue
WO2019127916A1 (en) Data read/write method and device implemented on the basis of distributed consensus protocol
TWI416322B (en) Optimize simultaneous access in a directory-based consistency protocol
CN110609742B (en) Method and device for configuring queues of Kubernetes scheduler
US8205045B2 (en) Satisfying memory ordering requirements between partial writes and non-snoop accesses
CN104106061B (en) Multiprocessor data processing system and method, cache memory and processing unit therein
CN103761141A (en) Method and device for realizing message queue
US8667227B2 (en) Domain based cache coherence protocol
US9798663B2 (en) Granting exclusive cache access using locality cache coherency state
US9619391B2 (en) In-memory caching with on-demand migration
US11093279B2 (en) Resources provisioning based on a set of discrete configurations
CN111782419B (en) Cache updating method, device, equipment and storage medium
CN105138679A (en) Data processing system and method based on distributed caching
CN111177032A (en) Cache space application method, system, device and computer readable storage medium
CN115686875A (en) Method, apparatus and program product for transferring data between multiple processes
CN111385255B (en) Asynchronous call implementation method, device, server and server cluster
US8904102B2 (en) Process identifier-based cache information transfer
CN119135686A (en) A server, a network-on-chip system, and a message processing device and method
US8756378B2 (en) Broadcast protocol for a network of caches
CN110401731B (en) Method and apparatus for distributing content distribution nodes
US9678873B2 (en) Early shared resource release in symmetric multiprocessing computer systems
US10616317B2 (en) Method and system for affinity load balancing
JP6115455B2 (en) Parallel computer system, parallel computer system control method, information processing apparatus, arithmetic processing apparatus, and communication control apparatus
US20120159087A1 (en) Ensuring Forward Progress of Token-Required Cache Operations In A Shared Cache
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium

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