BRIEF DESCRIPTION OF THE DRAWINGS
The subject matter, which is regarded as the invention, is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other objects, features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a schematic diagram illustrating one example of an N queue system where there is one request for Stage 1 arbitration per queue, and then a variety of requests for Stage 2 arbitration;
FIG. 2 is a system diagram illustrating one example of detecting and breaking up of the requestor starvation process; and
FIG. 3 is a flowchart illustrating one example of detecting and breaking up of the requester starvation process.
DETAILED DESCRIPTION OF THE INVENTION
One aspect of the exemplary embodiments is a method for detecting and breaking up requester starvation. The exemplary embodiments of the present invention maintain the arbitration based on a standard round-robin scheme, and in addition detect when a queue starvation scenario may be occurring. It is noted that this need not apply only to store requestors, but may be employed by one skilled in the art for a number of different requesters. In general, when a queue starvation is detected, the arbitration scheme is modified such that the priority of the queue being starved is made higher than the priority of the other requesters into the arbitration logic. Once the queue with higher priority is able to make some forward progress, its priority drops to the normal level and arbitration then reverts back to the standard round-robin scheme. FIGS. 1-3 described below illustrate how the exemplary embodiments detect and break up requestor (e.g., store and/or load) starvation.
FIG. 1 illustrates an example of an N queue system 10 where there is one request for stage one arbitration 12 per queue, and then a variety of requests for stage two arbitration 14. In particular, N queue system 10 includes two arbitration stages; stage one arbitration 12 and stage two arbitration 14. Stage one arbitration 12 includes a plurality of queues 16 that feed a mux 18. Stage two arbitration 14 includes a mux 20 being fed by the mux 18 of stage one arbitration 12, and from a plurality of queues (not shown), which have bypassed stage one arbitration 12. In the system 10, the exemplary embodiments of the present invention have one counter 22 per arbitration requester. Counter 22 is incremented whenever its stage one request won arbitration and then was rejected due to lost stage two arbitration or perhaps detection of a hazard. The round-robin arbitration continues rotating through the stage one requests. If the request successfully proceeds past the possibility of rejection, then counter 22 is reset. When counter 22 reaches its threshold, there is a signal that is turned on to bias the arbitration to select this requester over the other requesters. This signal effectively blocks all other requests until the request is able to pass the point of rejection. Therefore, the exemplary embodiments detect when a starvation scenario occurs by assigning priority levels to requests (or queues) that want to access the cache of a system. However, the priority assigned to a queue is dynamic, in that it diminishes after the queue with the higher priority has made progress.
Referring to FIG. 2, there is shown a schematic diagram of a system 30 illustrating one example of detecting and breaking up of the requestor starvation process. The system 30 includes two sets of queues, load queues 32 and store queues 34. The load queues 32 provide their output to a load arbitration level 36. The store queues 34 provide their output to a store arbitration level 38. The queues in the load arbitration level 36, the store arbitration level 38, and the snoop arbitration level 42 are sent to a main arbitration level 40. The output of the main arbitration level 40 is provided to an L2 access pipeline 44, which includes the functions detect data hazards, collect hazard results, and reject if hazard is detected. For store requests, the output of the L2 access pipeline 44 is fed to the store arbitration level 38. If a store is rejected, the starvation detection counter 22 for the originating queue is incremented. If a store is not rejected, the starvation detection counter 22 for the originating queue is reset and the store is allowed to complete.
Referring to FIG. 3, there is shown a flowchart illustrating one example of detecting and breaking up of the requester starvation process. The requester starvation process flowchart 50 includes the following steps. In step 52, the counter is set to zero. In step 54, a STQX request is made to the store arbiter 38. In step 56, it is determined whether the STQX requester wins a store arbitration. If the STQX requester does not win a store arbitration, the process flows to step 54. If the STQX requester does win store arbitration, then the process flows to step 58. In step 58, a stage two STQ request is made to the main arbiter 40. The stage two STQ request is the STQX request that won arbitration at the first level, the first level being the store arbitration level in this example. In step 60, it is determined whether the stage two STQ request has won arbitration at the second level. If the stage two STQ request has not won arbitration, then the process flows to step 70. If the stage two STQ request has won arbitration, the process flows to step 62. In step 62, the process flows to the L2 access pipeline where data hazards are detected, where hazard results are collected, and where the hazard may cause the request to be rejected. In step 64, it is determined if a hazard has been detected. If a hazard has been detected, the process flows to step 70. In step 70, the starvation detection counter 22 for STQX is incremented. Once the threshold for the counter has been reached, a high priority signal is sent with the request, which improves the likelihood of STQX winning both at the store arbitration level 38 and at the main arbitration level 40, shown in FIG. 2. The rejection of the store occurs because even though the store won both arbitrations (i.e., store arbitration (stage one) and main arbitration (stage two)), it was blocked due to some other active operation. As a result, the store is rejected and its store starvation detection counter 22 is incremented. If a hazard has not been detected in step 64, the process flows to step 66. In step 66, it is determined if resources are available. If resources are not available, the process flows to step 70. If resources are available, then the process flows to step 68. In step 68, since the arbitration has been won at both levels (store arbitration level 38 and at the main arbitration level 40), the counter 22 is reset.
Concerning the threshold, it could be set one of a variety of ways. For instance, it could be a static number, determined by the implementer, a user-set value, or a randomly set value, which changes completely independent of the operation of the machine. If it was the random number, a user or the implementer would probably choose a range that it could randomly change between.
In the case where multiple of a similar queue (both requesting to the same stage 1 arbiter) both get the raised priority level, arbitration between those high-priority queues is round-robin in nature. If the case arises where multiple stage 2 requesters both have raised priority requests, in most cases, the non-priority based arbitration scheme is used to choose among the high-priority requesters. So, for instance, if a LDQ and a STQ both have high-priority requests, and in a regular scenario, loads always beat stores, then high-priority loads beat high-priority stores.
As a result, the exemplary embodiments of the present invention employ a counter that counts the number of times a store from a particular processor has won arbitration but subsequently gotten rejected for some reason. Once the counter reaches a certain threshold, it triggers an event that increases the priority of that queue's stores versus other arbitration requesters. This signal remains on until that queue wins arbitration and gets past the point of being rejected. The advantage of the exemplary embodiments is that performance degradation due to blocking out the other queues is only temporary. The case only arises when the store's starvation is starting to occur. At all other times, the arbiters are able to perform as normal. Therefore, it has the throughput advantages of a round-robin arbiter with the forward progress guarantee of a static priority-based arbiter.
The capabilities of the present invention can be implemented in software, firmware, hardware or some combination thereof.
As one example, one or more aspects of the present invention can be included in an article of manufacture (e.g., one or more computer program products) having, for instance, computer usable media. The media has embodied therein, for instance, computer readable program code means for providing and facilitating the capabilities of the present invention. The article of manufacture can be included as a part of a computer system or sold separately.
Additionally, at least one program storage device readable by a machine, tangibly embodying at least one program of instructions executable by the machine to perform the capabilities of the present invention can be provided.
The flow diagrams depicted herein are just examples. There may be many variations to these diagrams or the steps (or operations) described therein without departing from the spirit of the invention. For instance, the steps may be performed in a differing order, or steps may be added, deleted or modified. All of these variations are considered a part of the claimed invention.
While the preferred embodiment to the invention has been described, it will be understood that those skilled in the art, both now and in the future, may make various improvements and enhancements which fall within the scope of the claims which follow. These claims should be construed to maintain the proper protection for the invention first described.