Abstract:
The system and method for performing an update operation on the sharing list in a multi-node SCI-based system involves issuing an update command from a first node in the list to the remaining nodes in the sharing list, however the first node maintains its position at a head position in the sharing list. The first node issues an increment command to each successive node in the list until the end of the list is reached. Each node receives the increment command and updates its cache and then sends a reply back to the first node, listing the state of the node and a pointer to the next node. The method and system also prevents a node from rolling out of the sharing list before that node receives the update command. Each node has a phase value that is toggled as the node is incremented. Thus, a rollout request will be nullified unless the phase value of the rollout request matches the phase value of the node. The system and method also interlocks the rollout requests to inhibit a node that is being rolled out from being incremented.

Description:
BACKGROUND OF THE INTENTION 
     The Scaleable Coherent Interface (SCI) standard for updating cache lines is essentially an invalidate flow, wherein only one cache can have a copy of the line, and this is the copy that will be updated or written, and all other caches must be purged before the write can commence. 
     A barrier is a mechanism used in parallel processing which will synchronize all processors and/or threads at that point in the code. It is very desirable in parallel processing to have a fast barrier. The faster the barrier, the less time that must be spent on synchronizing, and the more time for performing real work. So a faster barrier allows finer grained parallelism in the system operations. Barriers generally consist of a join and release. The join operation is not covered here because that is generally a fetch and increment instruction. A barrier release is one of the applications that would use write commands involving many nodes trying to read and receive a new value. 
     FIGS. 1A-C depict a simple SCI sharing list 100 and the actions that are required to actually update or write a value in that list. This assumes that all the nodes that are in the sharing list want to see the new value. In this case, the list 100 has the memory 101, which is marked GONE, meaning that the data in memory is obsolete. The memory includes a pointer that is pointing to node 0 102. The memory pointer is always pointing to the head of the sharing list 100. Thus, as shown in FIG. 1A, node 0 102 is currently the head. 
     In this case, node 0 102 is marked head --  dirty, which means that even though the line is shared, node 0 is responsible for returning the data to memory if the sharing list is collasped. Node 0 102, or the head, has a forward pointer that points to node 1 103, which is a mid --  valid. Node 1 103 has a forward pointer that points to node 2 104, and node 1 103 also a back pointer which points back to node 0 102. Node 2 104 is a tail --  valid in FIG. 1A, and it has a back pointer to node 1 103. 
     If node 0 102 wants to increment the value in the line that is shared by the sharing list 100, it must first send a VALID --  INVALID request to node 1 103. Node 0 102 then receives the forward pointer from the node 1 103, the mid --  valid node. Node 0 102 uses that forward pointer then to send an invalid request, VALID --  INVALID to node 2 104. The state received back from node 2 104 is tail, which means that the end of the list has been reached. At that point, node 0 102 is now the only one in the sharing list, and since the list is a dirty list, it can therefore increment the value. 
     In the meantime, both node 1 103 and node 2 104 are reading the line to see the new value. To read, the nodes must go back to memory 101 and rejoin the sharing list 100. When node 1 103 sends a read request to memory 101, it sees that the line is gone, so memory 101 updates the line to point to node 1 103. Node 1 103 then receives a pointer to node 0 102, which has the only copy of the line. Node 2 104 also sends a read request to memory 101 to rejoin the list. It sees that the memory 101 is gone and that it points to node 1 103 and therefore it has to go to node 1 103 for a new copy of the line. Memory 101 updates its pointer to node 2 104 and then the forward pointer of node 2 104 is changned to node 1 103. 
     FIG. 1B depicts the state of the cache of the SCI sharing list 100 at the point where the memory 101 is marked GONE and is pointing to node 2 104. Node 2 104 is essentially queued and it is marked queued --  junk, because the data in the line is not valid. Node 2 104 points to node 1 103, which is also marked queued --  junk, and node 1 103 points to node 0 102, which has the only valid copy of the line. Thus, at this point node 1 103 sends a cache read request, CREAD, to node 0 102, and receives the new version of the line. Meanwhile, node 2 104 is sending a cache read request to node 1 103. When node 1 103 receives the new value, it will pass the new value to node 2 104, when it receives the next timely request from node 2 104. 
     FIG. 1C depicts the final state of the sharing list 100. In this case, the memory 101 is marked GONE, and is pointing to node 2 104, which is now marked head, and has valid data. The head, node 2 104, is pointing to node 1 103, which is the mid and has valid data. The mid, node 1 103, is pointing to node 0 102, which was the original writer, and is now the tail. 
     The main problem with the system and method shown in FIG. 1 is that the sharing list has to be completely disassembled and then rebuilt. This process takes a great deal of system time and resources that otherwise would be available for other transactions. 
     SUMMARY OF THE INVENTION 
     This problem and other problems are solved by a system and method which uses an increment update flow as an enhancement over the standard SCI data flows, which increments a word in all caches in an SCI sharing list, in order to significantly speed up a barrier release. The processor/node that is executing the increment update must first become the head of the sharing list just like a read private flow. At this point the node then traverses the sharing list and increments a word in each cache. The state and pointers return from each cache allowing the head processor to continue down the list. 
     Special care must be taken if a node attempts to roll out of the sharing list while the head is traversing the list. In this case, additional states are used to prevent the list from becoming corrupted. Even though this method is described only for an increment update flow version, this method could also work for a full write update operation. 
     A technical advantage of the present invention is to issue an update command from the head node in the sharing list to the remaining nodes while maintaining the position of the head node in the sharing list. 
     Another technical advantage of the present invention is to have the head node issue an increment command to each successive node in the list until the end of the list is reached. As each node receives the increment command, it updates its cache and then sends a reply back to the first node. 
     A further technical advantage of the present invention is to prevent a node from rolling out of the sharing list before that node receives the update command. Each node has a phase value that is toggled as the node is incremented. Thus, a rollout request will be nullified unless the phase value of the rollout request matches the phase value of the node. 
     A further technical advantage of the present invention is to provide an interlock to inhibit a node that is being rolled out from being incremented until it has issued a rollout request with the correct phase. 
     The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention. It should be appreciated by those skilled in the art that the conception and the specific embodiment disclosed may be readily utilized as a basis for modifying or designing other structures for carrying out the same purposes of the present invention. It should also be realized by those skilled in the art that such equivalent constructions do not depart from the spirit and scope of the invention as set forth in the appended claims. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the present invention, and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which: 
     FIGS. 1A, 1B and 1C depict the steps to update a SCI sharing list using a standard SCI operations; 
     FIGS. 2A and 2B depict the inventive method for updating a SCI sharing list; 
     FIG. 3 depicts the pseudo code that describes the table initialization state machine in the SCI controller for implementing the inventive increment update method; 
     FIG. 4 depicts the pseudo code that describes the request state machine in the SCI controller for implementing the inventive increment update method; 
     FIGS. 5A to 5E depict the pseudo code that describes the conflicting request state machine in the SCI controller for implementing the inventive increment update method; 
     FIGS. 6A to 6F depict the pseudo code that describes the response state machine in the SCI controller for implementing the inventive increment update method; 
     FIGS. 7A and 7B depict the various cache state transitions; 
     FIG. 8A depicts a state diagram with the resulting behavior for cache lines in mv --  back --  in or tv --  back --  in states; 
     FIG. 8B depicts the flow states that a cache line that is a mv --  back --  in or a tv --  back --  in move through when an increment request is received from the current head of the sharing list; and 
     FIG. 9 depicts the shared phase bit marked with a P in a response packet. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIGS. 2A and 2B depict the inventive increment update flow process on the simple SCI sharing list shown in FIG. 1A. In FIG. 2A, again, like FIG. 1A, shows a sharing list 100 with the memory 101 marked gone, and the memory 101 is pointing to node 0 102. Node 0 102 is in the head --  dirty state and is pointing to node 1 103. Node 1 103, which is mid --  valid and is pointing to node 2 104, which is tail --  valid. 
     In this case, node 0 101 wants to release a barrier with an increment update. Node 0 102 will send a coherent increment command, CINC, to node 1 103. Node 1 103 will increment its value, purge local processor caches (within the node) and send its state and pointer back to node 0 102. Node 0 102 then will receive this response from node 1 103, examine the state, and determine that it is mid --  valid. Node 0 102 will then take the pointer and send a coherent increment command, CINC, to node 2 104, which is the tail --  valid node. Node 2, on receiving that request, will increment its value in its cache, and then pass its tail --  valid state back to node 0 102. Node 0 102, upon receiving the tail --  valid, knows that the end of the sharing list 100 has been reached and thus is done. Node 0 102 then increments its own value and the increment update flow is complete. FIG. 2B shows that resulting sharing list 200 is unchanged except that the value has been incremented in each node. 
     The system shown in FIG. 1 is compared to the system shown in FIG. 2 and reveals that each essentially depict the same process from a program&#39;s point-of-view, but the FIG. 1 system has significantly more traffic to achieve the same result as does the FIG. 2 system. FIG. 1 tears down the list and forces it to rebuild, while FIG. 2 essentially follows the list and increments as needed. The tearing down and rebuilding takes a significantly longer time and uses SCI resources that otherwise would be available for other transactions. 
     FIGS. 3A through 3C depict the pseudo code that describes the tasks of the various hardware state machines in the SCI controller that are used to implement the inventive increment update process. FIG. 3 describes the operations when the memory access controller (MAC) sends a request to the SCI controller (or TAC). FIG. 4 describes for each state what request to make to the SCI rings. FIGS. 5A-5E explain what happens to a response in a given state and what to do next, i.e. make another request to the SCI ring, make a response to the MAC, or do both. FIGS. 6A-6F describe the response state machine. 
     FIG. 3 is the code that explains the task of the MAC request state machine. In this code, there is a case statement for each one of the possible states that the MAC could send to the TAC (or SCI controller) for increment update requests. In this case, the SCI write subroutine is essentially a ring request. So in the first case where there is an increment update to CS --  invalid, then a ring request would be sent with the state being pending. 
     Another example would be where increment update is performed with a head --  dirty. In that case, the state is changed to the head --  dirty --  update head --  dirty and a ring request would be sent. The exact ring request for each of the states is then described in FIG. 4. In this figure, if the state was the state --  of --  pending, a ring request would be made of a memory read with the sub-opcode of cache dirty, which means the current contents of memory are read and then marked gone so that it can be written. 
     FIGS. 5A-5E depict a conflicting request state machine. What this means is that while a particular TAC is doing an increment update flow, it can receive requests for the same line from other nodes that are doing other flows. FIGS. 5A-5E describe what state transitions are made when requests are received from other nodes. For example, if in the mid --  valid --  back --  in state, which means rolling out of a mid --  valid state and trying to get to the head before beginning the increment update part of the flow, a CPURGE, another CINC, or any other ones could be received. All other ones that are not listed here are automatically nullified. The states that are listed here will perform the stated transition. In this case, with the mid --  valid --  back --  in, if a CPURGE request is received, then the state will be changed to to --  invalid, which means that when the response to the current request is received you can go to an INVALID state. 
     FIGS. 6A-6F depict the response state machine. This is the state machine that will take a response to the request and the current state and then determine what to do next. For example, if state was pending and a non-nullified response of home is received, which means that the line was unused and there is no sharing list, then one can immediately go to the only --  dirty state and finish the flow. 
     FIG. 7A shows a table of the cache transitions made when increment requests are received while in the SCI stable states of invalid only --  fresh, only dirty, etc. 
     FIG. 7B shows a table of the cache transitions made when increment requests are received while in the SCI transitory states. This is a simplified table version of FIGS. 5A-5E. The table lists the current cache state, the incoming cache command, and whether the proper local pointer is equal to the requester&#39;s node ID. It also explains what the new state will be and whether the response is nullified. The one of the most important of the types of the requests are coherent increment (CINC) requests. For example, if a CINC request is received to a line that is only --  fresh, then this is an error, because this should never happen. Another example would be a CINC request to a mid --  valid. In this case, the shared phase will be toggled, the cache line incremented, and the state will remain mid --  valid. 
     Two significant problems had to be solved for increment update to work in all cases. One problem is that a node can rollout of a sharing list just before it receives the cache increment command. At this point, the next pointer is lost and the sharing list appears to be broken to the head. The solution was the introduction of a concept of shared phase. 
     All sharing states: head --  dirty, head --  fresh, etc., have a phase 0 or 1. All nodes in the static sharing list have the same phase for the line. As the head increments each node in the list, the phase is toggled. A pre --  vtail or pre --  vmid rollout request is nullified until the shared phase in the request packet and therefore, the shared phase of the requester, matches the local shared phase for that line. For this to be true, the head must have incremented both nodes involved in the rollout and therefore, the rollout is safe. 
     An example of this in the process as shown in FIGS. 5A-5E. In this case, if a particular line is in the mid --  valid forward mid --  valid state and a CUPDATE pre --  vmid is received from the next mid --  valid in the sharing list, the local node ensures that both the request came from the node it is pointed to by the forward pointer and that the shared phases are equal before allowing the pre --  vmid command to complete. 
     The second major problem is that the shared phase used to solve the first problem did not solve all cases of rollout conflicts. In some cases, rollout requests can take a long time to reach the target such that the list can be in process of being incremented a second time before the target is reached. And since the shared phase only has two values, the new value of the target is equal to the original value. The rollout request reaches its destination after the second increment, but before the node that is rolling out is incremented the second time. This rollout is allowed to complete and the head now has an invalid pointer. 
     The solution was to put an interlock in rollouts. A node that is in the process of rolling out of a sharing list is not allowed to be incremented until a rollout request with the current phase has been made. This is achieved by nullifying the incoming increment request until the proper rollout request is made. The state needed for this is depicted in FIG. 8. The request referred to by this state machine is the coherent increment request or CINC request. The response referred to by this state machine is the response to the pre --  vmid or pre --  vtail rollout requests. 
     FIG. 8A depicts a state diagram with the resulting behavior for cache lines in mid --  valid or tail --  valid back --  in states. FIG. 8B depicts the flow states that a cache line that is a mid --  valid or tail --  valid back --  in move through when an increment request is received from the current head of the sharing list. As a line enters the mid --  valid back --  in or tail --  valid --  back --  in state it is in the normal state 501 in this state machine 500. If a response is received to the request while in the normal state 501, and the response is not nullified 503, then the flow could not be in the middle of coherent increment update. The response is then just completed normally. 
     If the response is nullified 502, this means that the flow could be doing an increment update, and thus requires a new request and waiting for the coherent increment or a non-nullified response to our last request. When in the normal state 501 and a coherent increment update request is received from the head of the sharing list 504, the local state transitions to wait response state 506. Going into the wait response 506 also changes the shared phase of the flow. In the wait response 506, the flow will continue to nullify coherent increment updates and wait for a response. When a nullified response 507 is received, the flow will then switch to the correct phase state 509, and then make a new request 508 with the corrected phase. 
     At this point if a new coherent increment is received, the flow can then go to the normal state 501 and wait for a non-nullified response 503. While in the correct phase state 509, the flow may receive a non-nullified response 510 before getting a new coherent increment request. In that case, the flow moves to the correct phase done state 511 and then remains in that state, and waits for the coherent increment update 512 to reach state 513. Nullify responses such as 502 specify that a request to the node that is pointed to by a back pointer nullified the rollout request and therefore this node must make a new request. Non-nullified responses such as 503 mean that the request was successful. States 501, 506, 509, and 511 are substates of the mv --  back --  in or tv --  back --  in SCI states. 
     State 513 is a result of the receipt of a coherent increment while in the correct --  phase --  done state. Then the SCI state is transitioned from the mid --  valid --  back --  in or tail --  valid --  back --  in state to the state of to --  invalid or to --  pending 513. In this case, the flow is waiting for a response from the cupdate pre --  vmid request made to the node that was pointed to by the back --  pointer. When the flow receives that response, the flow then moves 514 to the invalid or pending state 515. This means that either the flow is done, which is the invalid state, or that the flow is ready to begin the next part of the flow, which is the pending state. The to --  invalid 513 and the invalid 515 states are standard SCI states. 
     For each of the different states of the state machines, incoming coherent increment requests are handled differently. If in the normal state, a coherent increment request will be nullified and the shared --  phase will be toggled. If in the wait response state, the coherent increment will be nullified. If in the correct --  phase --  done or correct --  phase states, the coherent increment will receive a normal response. 
     An example of how this state machine is used is shown in FIGS. 5A-5E. In the case of mid --  valid --  back --  in, one can see that if a coherent increment request is received, then the states will be changed as in the state diagram. For example, in the normal state, the shared phase will be toggled and a nullified response will be sent when a CINC request is received. If in normal state or wait response, one can also see how the rollout phase changes according to the state diagram. 
     FIGS. 5A-5E just shows the transitions made from the coherent increment requests. The transitions made from the responses are another documentation. FIGS. 6A-6F the mid --  valid --  back --  in and tail --  valid --  back --  in states will show the state transitions made from the responses to the rollout requests, either nullified or non-nullified. 
     FIG. 9 shows the shared phase bit 601 marked with a P in a send response packet 600. A similar bit is in a send request packet, which is not shown. On the request packet, the P bit 601 is sent along with the request so that it is known that the phase is the same, thus allowing the rollout to complete. On the response packet, the P bit 601 is used when building a list to initialize the correct state. 
     Although the present invention and its advantages have been described in detail, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.