Token manager for execution of global operations utilizing multiple tokens6460101Abstract Serialization of global operations within a multi-processor system is achieved utilizing a plurality of tokens each permitting completion of a single global operation, requiring a bus master to acquire the token for completion of each individual global operation initiated by that bus master. A combined token and operation request, in which a token request and an operation request are transmitted in a single bus transaction, is employed once for a global operation, to initiate the global operation for the first time. A token manager determines whether a token is available or all are checked out and responds to the token portion of the combined request. Snoopers respond to the operation portion of the combined request depending on whether they are busy. If at least the token portion of the combined request is acknowledged or if a token request is acknowledged, the combined response will include a token number for the token granted to the bus master initiating the global operation. The token manager allows only n bus masters to own a token at a time (where n is the number of token supported), and infers release of a token from a combined response acknowledging a combined request or an operation request containing the token number assigned to a global operation. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
TABLE 1
Flags Request Type Possible combined response
10 Token request retry or ack
11 Token + Op request token ack/snoop retry
ack (token & snoop)
retry (token & snoop)
01 Op request retry or ack
As shown in Table I, a token request may be made alone, without an operation request, and an operation request may be made alone, without a token request, or a combined token and operation request may be made by a bus master. Normally a bus master initiating an operation for the first time will issue a combined token and operation request. The combined token and operation request minimizes latency as described above and allows speculative processing of the operation. The combined token and operation request is limited to one time, attempted only the first time a particular global operation is initiated (i.e., not attempted when a global operation is being retried). Subsequent attempts to initiate a global operation utilize the token request (only) and operation request (only). However, the frequency of occurence of global operations on a system bus is very small compared to normal data transfer operations. As a result, serialization of global operations enforced by token protocol has no meaningful impact on overall system processing. An operation request may be utilized by itself by a bus master where a previous combined token and operation request received a grant of the requested token but a snoop retry of the requested operation was asserted. However, a retry of a token request intrinsically implies a snoop retry (i.e., a combined response retrying the token request portion of a combined token and operation request while acknowledging the operation request portion of the combined request is not supported in order to prevent system livelocks). Speculative processing of an operation by snoopers can occur whenever a combined token and operation request is retried, although this speculative processing will have to be aborted if an operation request (only) is subsequently snooped. A token request (only) is unlikely to be utilized in the present invention unless more than one bus master is competing for the token at the same time. When a combined token and operation request or an operation request (only) receives a combined response acknowledging the operation request, the combined response implies that the token has been released (all bus participants are performing the requested global operation) and is available for subsequent use by a bus master seeking to initiate a global operation. With the multiple token, speculative processing system described, snoopers need only have a single queue for global operations, with a depth equal to the maximum number of tokens supported, greatly reducing and simplifying the hardware required to support global operations in large multiprocessor systems (e.g., 128-way SMP systems). By limiting the number of global operations per token to one, acknowledgement of an operation within the combined response implies release of the token. With reference now to FIG. 3, a timing diagram for a hypothetical sequence of global operations within a multi-processor system in accordance with a preferred embodiment of the present invention is depicted. The example depicted is for a multiple token bus protocol with speculative processing of operations, allowing only one operation per token. Within the example shown, which employs address bus transaction data structure 202 illustrated in FIG. 2 for initiating global operations, "TOR" designates a combined token and operation request, "TR" designates a token request (only), and "OR" designates an operation request (only). In the example of FIG. 3, an address transaction for a combined token and operation request ("TOR-A") is driven on a bus during bus cycle 0. Queue 1 ("Q1") of snooper 0 is not busy with any other global operation and begins speculative processing of the operation requested by address transaction A. Queue 2 of snooper 0 does nothing, seeing that queue 1 of snooper 0 is available to begin speculative processing of the requested operation. Both queue 1 and queue 2 of snooper 1, however, are busy with a previous global operation and therefore both transmit a retry snoop response to the combined request, which results in a combined response during bus cycle 4 (a four-cycle combined response window is assumed for this example) acknowledging (granting) the token request portion of address transaction A and assigning token X (an integer number) to the operation, but retrying the operation request portion. An address transaction for a different combined token and operation request ("TOR-B") is then driven on the bus (either by the same device which drove the address transaction for TOR-A or by a different device) during bus cycle 2. Queue 1 of snooper 0, now busy speculatively processing the operation requested in TOR-A but seeing that queue 2 of snooper 0 is not busy, ignores the operation; queue 2 of snooper 0, seeing that queue 1 of snooper 0 is busy with a previous operation, begins speculative processing of the operation requested by address transaction B. Queue 1 of snooper 1, having completed the earlier global operation during the cycles between TOR-A and TOR-B (as did queue 2 of snooper 1), begins speculative processing of the operation requested by TOR-B. Since both snoopers are capable of processing the global operation in one or their snoop queues, the token manager causes a combined response acknowledging both the token and operation request portions of TOR-B to be driven during bus cycle 6. Since token X is checked out to the device initiating TOR-A, token Y is assigned to TOR-B. After receiving the combined response granting token X but retrying the operation during bus cycle 4, the device initiating TOR-A drives an address transaction for an operation request (only) ("OR-A") during bus cycle 8. Snooper 0, after comparing the processor identifier within the address transaction OR-A and recognizing the operation as the same previously requested during bus cycle 0 and currently being processed in queue 1 of snooper 0, collapses the new operation request with the existing operation request already being speculatively performed in response to the address transaction TOR-A. Snooper 1 continues processing the operation requested by address transaction TOR-B (if the operation is not completed) in queue 1 of snooper 1, and begins processing the operation for address transaction OR-A in queue 2 of snooper 1. When address transaction OR-A is detected, snooper 1 need not halt speculative processing of the operation requested by TOR-B because an additional token for global operations is currently available. If all snoop queues within a snooper are busy processing a combined token and operation request (i.e., all tokens are currently checked out) and an operation request (only) is detected, one of the queues must suspend processing of the respective combined token and operation request and begin processing the new operation request (only). During bus cycle 10, another combined token and operation request ("TOR-C") is driven on the bus, either by one of the devices previously driving address transactions A and B or by a different device. Queue 2 of snooper 0 completed processing of the operation TOR-B requested by address transaction B during the previous bus cycle and, seeing that queue 1 of snooper 0 is busy, acknowledges TOR-C and begins speculatively processing the operation. Both queue 1 and queue 2 for snooper 1 are busy, though, and therefore snooper 1 retries operation TOR-C. If a snooper has completed speculatively processing an operation, the result may be preserved rather than discarded to avoid duplication of work if the same operation is later requested and a token is granted to the requesting device. Thus, when a snooper completes a snooped operation, the snooper saves the address ("Addr") and processor identifier ("PID") in a history register so that, when the next combined token and operation request is snooped, the snooper may begin processing the new operation while continuing to collapse the previous operation (in case the previous operation is still spinning on the bus waiting for an acknowledge combined response). To maintain consistency and prevent potential system livelocks, several constraints should be imposed on processing of combined token and operation requests and subsequent operation requests (only). Each snooper queue depth should be at least equal to the maximum number of tokens available to ensure no livelocks occur. If all snoop queues for a snooper are busy processing a combined token and operation request and the snooper detects a subsequent operation request (only) from the same processor as one of the combined requests being processed but with a different address, the snooper should retry the operation request (only) and continue processing the combined token and operation request. If all snoop queues within a snooper are busy processing a combined token and operation request and the snooper detects a subsequent operation request (only) from a processor other than those originating the combined requests being processed (which implies that the other processor has been granted a token and one of the processors originating the combined requests being processed has not), the snooper should suspend processing of at least one combined token and operation request and begins processing the new operation request (only). The assigned token number must be logged by the snooper to prevent both snoop queues from proceeding to operate on operations utilizing the same token. If both queues were allowed to process operations using the same token, then operations acquiring the other token could get locked out and make no forward progress (i.e., a livelock could result). Referring to FIG. 4, a high level flow chart for a process within a bus master of issuing global operations in a system employing multiple tokens each limited to one operation in accordance with a preferred embodiment of the present invention is illustrated. This example and other examples herein relate to a system utilizing multiple tokens and limiting the benefit of having a token to a single global operation, such that a token must be requested and received for each individual global operation. The process begins at step 402, with a device (processor or cache) initiating a global operation on a bus within a system. The process first passes to step 404, which illustrates the initiating device issuing a combined token and operation request without specifying a token number, then passes to step 406, which depicts a determination of what combined response is received for the combined token and operation request. If a retry combined response is received, the process proceeds to step 408, which illustrates the initiating device issuing a token request (only) on the bus, and then to step 410, which depicts a determination of what combined response is received for the token request (only). If a retry response to the token request (only) is received, the process returns to step 408 and issues another token request (only). However, if an acknowledge response, with a token number, is received to the token request (only), the process proceeds to step 411, which depicts saving the token number, and then to step 412, which illustrates issuing an operation request (only) with the token number. The process next passes to step 414, which depicts a determination of what combined response is received to the operation request (only). If a retry response to the operation request (only) is received, the process returns to step 412 and issues another operation request (only) with the token number. However, if an acknowledge response is received to the operation request (only), the process proceeds to step 416, with the process being complete. Referring back to step 406, if a token acknowledge (with token number), operation retry response is received to the combined token and operation request, the process proceeds to step 412, in which the initiating device issues an operation request (only) with the token number. If an acknowledge response, with a token number, is received to the combined token and operation request in step 406, however, the process proceeds instead directly to step 416. Receipt of an acknowledge (with token number) to both portions of a combined token and operation request, as well as to an operation request (only), implies release of the token for a subsequent global operation. With reference now to FIGS. 5A through 5C, a high level flow chart for a process within a bus participant of snooping global operations in a system employing multiple tokens each limited to one operation in accordance with a preferred embodiment of the present invention is depicted. The flow depicted illustrates a single snoop queue operating with respect to a single token, without including dependencies between snoop queues, branching based on token number comparisons, and the like. Such variances from the flow depicted are described following the description of the flow chart. The process begins at step 502, and passes first to step 504, which illustrates a determination of whether an address transaction for an operation request (only) ("IOR") or a combined token and operation request ("TOR") has been snooped from a bus (the snooper ignores token-only requests). If not, the process returns to step 504 and continues polling for an address transaction for operation request (only) or a combined token and operation request. When an address transaction for an operation request (only) or a combined token and operation request is snooped from the bus, the process proceeds from step 504 to step 506, which depicts responding to the snooped address bus transaction with a snoop response of acknowledge, and then to step 508, which illustrates allocating the queue for the snooped operation (which involves saving the address and processor identifier for the snooped operation to the snoop queue) and beginning processing of the snooped operation. If the snooped address transaction is for a operation request (only), the process passes to step 540 depicted in FIG. 5B. If the snooped address bus transaction is for a combined token and operation request, the process proceeds from step 508 to step 510, which depicts a determination of whether the processing of the operation from the snooped combined token and operation request is completed. If so, the process proceeds to step 550 depicted in FIG. 5C. If not, however, the process proceeds instead to step 512, which illustrates a determination of whether an operation request (only), a new combined token and operation request, or a synchronization ("Sync") request has been snooped from the bus. If not, the process returns to step 510 to continue polling for completion of the global operation from the snooped combined token and operation request and detection of any subsequent global operation. If an operation request (only) is detected at step 512, the process proceeds instead to step 514, which depicts a determination of whether the processor identifier ("PID") of the processor which sourced the newly-snooped operation matches the processor identifier of the snooped global operation being processed within the snoop queue from the combined token and operation request detected at step 508. If not, the process proceeds to step 516, which illustrates a determination of the value of the "HistVal" flag, a valid flag qualifying the contents of the address and processor identifier history register within the snooper. If the HistVal flag is clear (set to zero), the process returns to step 506 to acknowledge the newly-snooped operation request (only). If the HistVal flag is set, however, the process proceeds to step 518, which depicts a determination of whether the address ("Addr") and processor identifier for the newly-snooped operation request (only) matches the address and processor identifier stored in the history register. If not, the process proceeds to step 520, which illustrates clearing the HistVal flag, and then returns to step 506. If the address and processor identifier are matched to the history register contents in step 518, the process returns instead to step 510. When a snooper completes a snoop operation, the snooper saves the address and processor identifier for the completed operation in the history register. This allows the snooper, upon snooping the next combined token and operation request, to begin processing the new operation while continuing to collapse the previous operation (in case the previous operation is still spinning on the bus awaiting an acknowledge combined response). The snooper thus avoids processing the same operation twice in the case where the snooper speculatively completes the first operation, then snoops a second speculative combined token and operation request and completes that operation while the first operation is still spinning on the bus trying to get a null (acknowlege) response. Any snooped operation request (only) with an address and processor identifier match on the (valid) contents of the history register is collapsed (i.e., not retried). Referring back to step 514, if the processor identifier for the newly-snooped operation request (only) matches that of the snooped operation being process in the snoop queue, the process proceeds instead to step 522, which depicts a determination of whether the address of the newly-snooped operation request (only) matches the address of the snooped operation being processed within the snoop queue. If not, the process proceeds to step 524, which illustrates asserting a retry snoop response. If the addresses match, however, or once the retry snoop response is asserted, the process proceeds to step 526, which depicts clearing the HistVal flag to invalidate the contents of the history register. The process then returns to step 510. Referring once again to step 512, if a combined token and operation request is snooped (the snooper ignores token-only requests), the process proceeds to step 528, which illustrates asserting a retry snoop response, and then returns to step 510. If a synchronization operation is detected in step 512, the process proceeds instead to step 530, which depicts a determination of whether the processor identifier for the snooped synchronization operation matches the processor identifier for the snooped operation being processed within the snoop queue. If the processor identifiers for the snooped synchronization operation and the operation being processed in the snoop queue match, the process proceeds to step 532, which illustrates clearing the HistVal flag, and then to step 528. If the processor identifiers for the snooped synchronization operation and the operation being processed in the snoop queue do not match, the process proceeds instead to step 534, which depicts a determination of the state of the HistVal flag. If the HistVal flag is clear, the process returns to step 510. If the HistVal flag is set, the process proceeds instead to step 536, which illustrates a determination of whether the processor identifier for the newly-snooped synchronization operation matches the processor identifier stored within the history register. If the processor identifier for the newly-snooped synchronization operation does not match the processor identifier stored within the history register, the process merely returns to step 510. However, a snooped synchronization operation with a processor identifier matching the contents of the history register will invalidate the contents of the history register. Therefore, if the processor identifier for the newly-snooped synchronization operation does not match the processor identifier stored within the history register, the process proceeds instead to step 538, which depicts clearing the Histval flag, and then returns to step 510. From step 508, when an operation request (only) is detected, the process proceeds to step 540 depicted in FIG. 5B, which illustrates a determination of whether processing of the snooped operation request (only) is completed. If so, the process proceeds to step 550 depicted in FIG. 5C. If processing is not yet complete, however, the process proceeds instead to step 542, which depicts a determination of whether an operation request (only), a combined token and operation request, or a synchronization operation has been detected on the bus by the snooper. If not, the process simply returns to step 540 to continue polling for completion of the operation request (only) and for initiation of other global operations. If an operation request (only) is detected at step 542, the process proceeds to step 544, which illustrates a determination of whether the address and processor identifier for the new-snooped operation request (only) matches the address and processor identifier for the operation from the operation request (only) detected at step 508 which being processed in the snoop queue. If so, the process merely returns to step 540. If not, however, the process proceeds to step 546, which depicts asserting a retry snoop response, and then returns to step 540. If a newly-snooped address transaction detected at step 542 is for a combined token and operation request, the process proceeds to step 546, in which a retry snoop response is asserted, and then returns to step 540. If a newly-snooped address transaction detected at step 542 is for a synchronization operation, the process proceeds instead to step 548, which illustrates a determination of whether the processor identifier for the newly-snooped address transaction for a synchronization operation matches the processor identifier for the previously detected operation request (only). If so, the process proceeds to step 546, in which a retry snoop response is asserted, and then returns to step 540. If not, the process returns directly to step 540. Referring back to step 540, once processing of a snooped global operation from an operation request (only) is complete, the process proceeds from step 540 to step 550 depicted in FIG. 5C, which depicts a determination of whether an operation request (only), a combined token and operation request, or a synchronization operation is detected by the snooper while not processing any other global operation. If not, the process simply returns to step 550 to continue polling for a global operation. If an operation request (only) is detected at step 550, the process proceeds to step 552, which illustrates a determination of whether the address and processor identifier for the detected operation request (only) matches the address and processor identifier for the completed operation. If so, the process proceeds to step 554, which illustrates clearing the HistVal flag, and then returns to step 550. If not, however, the process proceeds to step 556, which depicts a determination of the state of the HistVal flag. If the HistVal flag is set, the process proceeds to step 558, which illustrates a determination of whether the address and processor identifier for the detected operation request (only) matches the address and processor identifier stored in the history register. If so, the process merely returns to step 550. If not, however, the process proceeds instead to step 560, which depicts clearing the HistVal flag, and then returns to step 506 depicted in FIG. 5A. The process also returns to step 506 from step 556 if the Histval flag is determined to be cleared at that step. If a combined token and operation request is detected at step 550, the process proceeds to step 562, which illustrates a determination of whether the address and processor identifier for the detected combined token and operation request matches the address and processor identifier for the completed operation. If so, the process simply returns to step 550. If not, however, the process proceeds to step 564, which depicts a determination of the state of the HistVal flag. If the HistVal flag is determined to be cleared at step 564, the process proceeds to step 566, which depicts loading the address and processor identifier for the previously completed operation within the queue into the history register and setting the HistVal flag, and then passes to step 506 depicted in FIG. 5A. If the Histval flag is set at step 564, the process proceeds instead to step 568, which illustrates a determination of whether the address and processor identifier for the detected combined token and operation request matches the address and processor identifier stored in the history register. If so, the process merely returns to step 550. If not, however, the process proceeds instead to step 570, which depicts asserting a retry snoop response, and then returns to step 550. If a synchronization operation is detected at step 550, the process proceeds to step 572, which illustrates a determination of whether the processor identifier for the detected synchronization operation matches the processor identifier for the completed operation. If so, the process proceeds to step 574, which illustrates clearing the HistVal flag, and then returns to step 504 depicted in FIG. 5A. If not, however, the process proceeds to step 576, which depicts a determination of the state of the HistVal flag. If the HistVal flag is cleared, the process returns to step 550. If the HistVal flag is set, the process proceeds to step 578, which illustrates a determination of whether the processor identifier for the detected synchronization operation matches the processor identifier stored in the history register. If not, the process merely returns to step 550. If so, however, the process proceeds instead to step 580, which depicts clearing the HistVal flag, and then returns to step 550. The snooper flow for implementations employing multiple tokens may be derived from the above-described flow chart by noting the following exceptions: The snooper queue depth must be at least equal to the total number of tokens employed to ensure no livelocks. If n (an integer number) of tokens are employed and all n snoop queues are busy processing combined token and operation requests when an operation request (only) is detected, one of the queues must suspend processing of the respective combined token and operation request and begin processing the operation request (only). The snoop queue which suspends processing may be predesignated, randomly selected, selected in a round-robin fashion, etc. When a snooper begins speculatively processing a combined token and operation request, the snooper looks for the combined response for that request. The combined response to a combined token and operation request is accompanied by a token number or identifier if a token has been awarded. The snooper stores this token number in a save register associated with the queue speculatively processing the requested operation. The token number is then utilized to prevent both snoop queues from proceeding to operate on operation requests having the same token. If both queues were allowed to process operations having the same token, then operations acquiring another token could get locked out and make no forward progress (i.e., a livelock could result). When a snooper begins processing an operation request (only), the token number accompanies the request--having been awarded in response to a prior combined token and operation request or a prior token request (only)--so there exists no need to look for the combined response. Only the combined response to a combined token and operation request need be checked for the token number of the token awarded to the request. Referring to FIG. 6, a state diagram for token control logic in a system employing multiple tokens for global operations, each limited to one operation, in accordance with a preferred embodiment of the present invention is illustrated. The token control logic is typically integrated within the bus arbitration function, to implement a token manager for the tokens. The logic diagram illustrated is for a system employing two tokens, A and B. State 00 depicted in FIG. 6 indicates that both tokens are available, while state 10 indicates that token B is available but token A is checked out, state 01 indicates that token A is available but token B is checked out, and state 11 indicates that both tokens are checked out. The control logic remains in state 00 as long as no token request (only) ("TR") or combined token and operation request ("TOR") is received. The control logic transitions from state 00 to state 10 when a token request (only) or combined token and operation request is received, with the response acknowledging the token request (only) with the token number for token A or acknowledging at least the token request portion of the combined token and operation request with the token number for token A. The control logic remains in state 10 as long as a no operation ("Noop") or an operation request (only) containing the token number for token A is received, and no combined response to an operation for token A ("CR-A") or a retry combined response to an operation for token A is received. While the control logic is in state 10, operations for token A will be acknowledged. The control logic transitions back to state 00 from state 10 when a combined response the operation for token A is received. The control logic transitions from state 10 to state 01 when a token request (only) or combined token and operation request is received and the combined response to an operation request (only) for token A is acknowledged, with the response acknowledging the token request (only) or at least the token portion of the combined token and operation request with the token number for token B. The control logic remains in state 01 as long as a no operation or an operation request (only) containing the token number for token B is received, and no combined response to an operation for token B ("CR-B") or a retry combined response to an operation for token B is received. While the control logic is in state 01, operations for token B will be acknowledged. The control logic transitions back to state 10 from state 01 when a token request (only) or combined token and operation request is received and the combined response to an operation for token B is an acknowledge, with the response acknowledging the token request (only) or at least the token portion of the combined token and operation request with the token number for token A. The control logic transitions from state 10 to state 11 when a token request (only) or combined token and operation request is received and no combined response or a retry combined response to an operation for token A is received, with the response acknowledging the token request (only) or at least the token portion of the combined token and operation request with the token number for token B. The control logic remains in state 11 as long as no combined response or a retry combined response to an operation for token A is received, and no combined response or a retry combined response to an operation for token B is received. While the control logic is in state 11, all token requests (only) and combined token and operation requests are retried, but all operation requests (only) for either token A or B are acknowledged. The control logic transitions back to state 10 from state 11 when a no operation or an operation request (only) for token A is received, and a combined response acknowledging an operation for token B is received but no combined response or a retry combined response to an operation for token A is received. The control logic transitions from state 01 to state 11 when a token request (only) or combined token and operation request is received and no combined response or a retry combined response to an operation for token B is received, with the response acknowledging the token request (only) or at least the token portion of the combined token and operation request with the token number for token A. The control logic transitions back to state 01 from state 11 when a no operation or an operation for token B is received, and a combined response acknowledging an operation for token A is received but no combined response or a retry combined response to an operation for token B is received. The present invention serializes global operations with simplified and reduced hardware, requiring fewer snoop queues for each bus participant. By implementing only a single token, requiring a bus master to request and obtain the token for each individual global operation, and by requiring snoopers to process operation requests (only) even if processing of another operation must be suspended, the present invention allows release of the token to be implied from a combined response acknowledging the token request, or acknowledging at least the token request portion of a combined token and operation request. Support for combined token and operation requests allows speculative execution of the operation and minimizes overall latency. While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.
|
Same subclass Same class Consider this |
||||||||||
