Abstract:
In a multiprocessor computer system where a number of &#34;agents&#34; can compete for access to a &#34;resource&#34;, a method of ameliorating &#34;Livelock&#34; and preventing any such agent from being unduly frustrated from such access, this method comprising: arranging the system to include an arbitrating unit and a common system bus connecting a number of processors, plus an Avoidance unit included in each processor and including a Random-Number generator and automatic &#34;Random Backoff&#34; that causes an agent that fails to secure access to wait for one or more given random time periods T B  before reattempting such access, with each said time period T B  being provided by the random number generator so as to likely differentiate from competing agents.

Description:
This relates to cache control means in a computer, and particularly to means for avoiding &#34;Livelock&#34;. 
     BACKGROUND, FEATURES 
     In many multiprocessor computer systems, control of the addressing unit is important, likewise for related cache control elements. An exemplary multiprocessor is depicted in FIG. 1, with a number of processor boards (B-l thru B-N) all similar and coupled to a system bus mb (SCM, or synchronous coherent memory bus), along with an Arbiter Unit 2, Main memory M and I/O interfaces (ST10 and open system 10 to respective bus means). Each board B is similar and includes a local processor P (e.g., Pentium by Intel Corp.), cache memory C, a cache controller cc (comprising a Data stage DU coupled to cache c, and Address stage AU, coupled to processor P, with each stage coupled to bus mb by a respective bus), plus a pair of Tag memory units (pref RAM): a P-tag coupled to processor P and Address unit AU, and a B-tag, also coupled to AU. With such separate addressing and data units (and their buses) this may be called a &#34;split transactions&#34; type processor board. 
     Arbitration for access to the SCM bus is provided by an arbiter ASIC #2. Arbiter 2 ensures &#34;fairness&#34; by granting requests for access to SCM address busses and data busses in round robin fashion: i.e., whereby any requesting agent is guaranteed access to a bus after waiting no longer than one prior access by other competing agents. Such an &#34;agent&#34; may be a local processor; such bus access may be desired by an agent in order to use a system &#34;resource&#34; that other agents are competing for (e.g., the resource may be main memory, I/O lines or another processor--quite commonly one processor wants to use another processor, or its cache memory). 
     Due to lack of resources, the agent which is the target of a request made by an address unit AU, or any other SCM agent, may have the request &#34;retried&#34;, whereby the target indicates that the requester should re-issue his request at a later time--whereupon the resource initiates a RETRY (--the requester is thus said to have been &#34;retried&#34;). In such a case, arbiter 2 (FIG. 1) will not be aware that the requesting agent (now &#34;retried&#34;) has forfeited its access to the system bus SCM, so it will lower this agent&#39;s priority, forcing it to wait until all other devices have been serviced before it can retry its transaction. 
     In certain situations a condition called &#34;livelock&#34; can occur; i.e., when the system bus transaction patterns frustrate access by a &#34;livelocked agent&#34;: i.e., such an agent is retried because a resource is unavailable, then this resource becomes available but is captured by a different agent, so this &#34;Retried-agent&#34; re-acquires the SCM bus only to find that the target resource is, again, unavailable; so it must, again, RETRY. In some cases this pattern can re-occur indefinitely and cause &#34;starvation&#34; of a repeatedly-retried agent: such is called &#34;system livelock&#34;. 
     One approach to preventing system livelock would be to provide a &#34;backoff mechanism&#34; whereby an agent waits a predetermined time before re-arbitrating for the bus in the hope this will give the requested resource time to become available. In some cases, however, &#34;backoff&#34; alone, may not be sufficient to prevent &#34;livelock&#34;. 
     Our invention addresses this problem, and provides two other unique solutions to address &#34;livelock&#34;. The first solution is a &#34;random backoff&#34; mechanism which causes the AU to wait a &#34;random&#34; time period t b  before rearbitrating for the system bus, then going direct to Resource request. 
     The second solution is a &#34;stretch&#34; mechanism which enables the AU to immediately arbitrate for the system bus, and then, once access is granted, wait some &#34;random&#34; time period t s  before attempting to use the resource. This prevents other agents from accessing the resource, while allowing time for the resource to become available. In common these solutions provide that the delay time during such a &#34;backoff&#34;, or during such a &#34;stretch&#34;, is random, with the delay t b  for Backoff preceding bus-request, but delay t s  for stretch occurring after bus-request (bus-capture), and before Resource request. Workers will note that either t b  or t s  can build-in system delays, but t s  is more serious in that it also ties-up a bus. Thus, a manufacture will select, and test sample t s , t b  numbers and select either, or both Backoff or stretch for a machine. 
     Now, these delay times, according to our invention, are made &#34;random&#34;, rather than one or several prescribed delay times, so as to better avoid matching the related times of competing agents; also, they are repeatedly invoked--each time with a different, i.e., random, delay--so as to better avoid (accidentally) matching the periodicity of other agents. For example, if another competing agent re-attempts to capture the desired bus (resource) every x seconds, the subject agent having a random &#34;retry-time&#34; may retry in x seconds the first time, but then retry in &#34;y&#34; seconds the second time (it being quite unlikely that a random-number generator would issue x on two successive times). 
     Preferably, the system software will set a &#34;range&#34; of delay times (e.g., see Table I, below--so that the times will be &#34;reasonable&#34; in light of the circumstances, and so they will be closed-ended, and closely-limited; otherwise extended, even unlimited, delay times might result, badly compromising system efficiency). And, preferably, the system software will be &#34;set&#34; (or reset, as desired) to a range of delay-times, while the hardware will automatically generate random values, within this range, and do so repeatedly, until a Retry succeeds. 
     As a further preferred feature, a minimum-delay, or &#34;offset&#34; will also be prescribed (e.g., by software; see Table I) to assure that some reasonable MIN delay time always elapses (e.g., enough to let a resource free-up--never ZERO delay time|). For example, a &#34;successful&#34; delay-range may be quite hard to predict (to avoid Livelock), so a manufacturer may select a &#34;low&#34; range, low offset initially, and then test to see if Livelock is avoided--if not, these values could be adjusted (increased) until the system is successful. Such adjustments can also be made &#34;in the field&#34; (e.g., with a software &#34;patch&#34;). 
     Thus, an object hereof is to address &#34;system livelock&#34;, especially with a &#34;backoff&#34; solution. A related object is to do so via &#34;random backoff&#34;. Another related object to do so via a &#34;stretch&#34; mechanism, especially &#34;random stretch&#34;. A further object is to implement such &#34;random backoff&#34; and/or &#34;random stretch&#34; mechanisms with addressing means which is adapted to generate the related random number (delay), especially where this is done with a linear feedback shift register, providing a &#34;pseudo-random sequence&#34;. A related object is to do this also using control means adapted for selection of &#34;window range&#34; (width) and &#34;offset&#34; values used to generate a random backoff/random stretch count, programmed to provide a delay range which can resolve &#34;livelock&#34; and also enhance system performance. A further object is to address the problems here mentioned and to provide related features and advantages. 
     Other objects and advantages of the present invention will be apparent to those skilled in the art. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The foregoing and other features and advantages of the present invention will be appreciated by workers as they become better understood by reference to the following detailed description of the present preferred embodiments, these being considered in conjunction with the accompanying drawings, wherein like reference symbols denote like elements: 
     FIG. 1 is a very schematic, idealized showing of a multiprocessor computer for illustrating livelock problems; while FIG. 2 illustrates, in block diagram form, a modification of salient control functions, in an address unit of a processor such as indicated in FIG. 1,--this for addressing &#34;Livelock&#34; according to a preferred embodiment of the invention; and 
     FIG. 3 is a related block diagram illustrating operation of a preferred shift register embodiment, as a &#34;pseudo-random number generator. 
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
     As mentioned, FIG. 2 illustrates how an Address unit (e.g., as in FIG. 1, and known in the art) may be modified--according to a preferred embodiment--to include control means (e.g., Control Register CR), &#34;random number generator&#34; means (e.g., Linear feedback shift register SR) and related output means (e.g., combinational logic unit CL, backoff counter, stretch counter, etc.). This allows a given processor array to so implement the desired &#34;random backoff&#34; and &#34;random stretch&#34; mechanisms (delay times): both &#34;Livelock Avoidance&#34; (LA) mechanisms preferably incorporated for each local processor array. 
     Here, while other means may be used to provide such &#34;random backoff&#34; and/or &#34;random stretch&#34; mechanisms, we prefer to use unique, modified address unit (AU) structure (e.g., of each processor array in FIG. 1) adapted to generate the random number (delay time) for the AU backoff or stretch. For this, the AU uses a linear feedback shift register (see SR, FIG. 2) to provide a &#34;pseudo-random sequence&#34;, while a 5-bit control register (CR, FIG. 2) is used to select a &#34;window range&#34; and &#34;offset&#34; which are then used to generate the random backoff/stretch count. This allows the AU to be programmed with a &#34;delay range&#34; which optimize both livelock avoidance and system performance. 
     The random number for such backoff/stretch delay is preferably generated by a 9-bit pseudo-random number generator which provides a repeating 9-bit sequence every 511 clocks. Such a period (511 clock beats) should be long enough to prevent any retry pattern from developing on the bus--after which the 9-bit sequence will repeat. This random number generator is implemented as shown in FIG. 2 by Linear Feedback Shift Register SR, as fed by Control Register CR and suitable Combinational Logic stage CL. Register SR comprises nine (9) flip-flops (#0 thru #8) in series, and sharing input from Control bus 11 and the common clock CLK, plus a feedback from #4 and #0 via EX-NOR gate G. 
     This random number generator will work as follows (also see FIG. 3): 
     In FIGS. 2, 3, the &#34;pseudo-random Number Generator&#34; (e.g., SR) comprises a series of nine (9) flip-flops (#0-#8) sharing a common clock--such that, on each rising clock edge, each flip-flop will assume the value of the preceding flip-flop. The first flip-flop assumes the value of the feedback circuit: here, simply the Exclusive-NOR (EX-NOR) gate presenting output values of flip-flops #4 and #0 as in FIG. 2. The nine bits in FIG. 3 will repeat after 511 clocks. 
     The random number (issued to CL, thence to the backoff or stretch counters) is controlled by two control fields in an internal QCTL register (in the AU, see CR in FIG. 2), one field for backoff, the other for stretch as FIG. 2 shows. Each of these fields is composed of two subfields; a &#34;range sub-field&#34; and an &#34;offset&#34; sub-field. A 2-bit &#34;range width&#34; sub-field specifies the range of random numbers that may be generated (also see Range width in Table I), while a 3-bit &#34;range offset&#34; register specifies an &#34;offset&#34;, (number--also see Table I) that will be added to each random number to derive a final random &#34;stretch&#34; value or random &#34;backoff&#34; value (delay time)--this being generated from the linear feedback register SR, and the range and offset fields by combinational logic unit CL. 
     The number issued from CL will be an 8-bit number (8-bits being sufficient to represent the maximum &#34;random backoff/random stretch&#34; value, or 183 as seen in Table I below), and will be issued to both a backoff means and a stretch means, and will represent a prescribed unit of (system-clock) time. 
     Whenever a &#34;retry&#34; occurs and is unsuccessful, and the random backoff and/or random stretch mechanisms are enabled, the 8-bit value output (backoff delay t b , and stretch delay t s ) by CL is loaded into an associated counter (t s  to backoff CTR and t s  to stretch CTR&#39;, see FIG. 2). Each counter is then decremented by ONE on each clock pulse from the system clock. When the counter reaches ZERO, the backoff/stretch period is said to have expired, and the system allows the agent to then request the desired resource. 
     The Table I below indicates sample, preferred &#34;range width&#34; and &#34;offset&#34; values for each combination of bits in the aforementioned range and offset fields, as well as the resulting random number range: (Note: the Random Number Generator will be controlled to issue a number RN that is output to the backoff counter CTR and to the stretch counter, CTR&#39;--doing so repeatedly until RETRY succeeds--each time a different RN): 
     
                       TABLE I______________________________________  Range WidthOffset   16(00)  32(01)      64(10)                              128(11)______________________________________ 4(000)   4-19    4-35       4-67   4-131 8(001)   8-23    8-39       8-71   8-13516(010)  16-31   16-47       16-79 16-14324(011)  24-39   24-55       24-87 24-15132(100)  32-47   32-63       32-95 32-15940(101)  40-55   40-71       40-103                              40-16748(110)  48-63   48-79       48-111                              48-17556(111)  56-71   56-87       56-119                              56-183______________________________________ 
    
     The &#34;Range Width&#34; values are selected and encoded as indicated for Control Register CR, FIG. 2 (e.g., note two range bit positions, so in Table I &#34;00&#34; indicates the &#34;first range&#34; value--here 16 units, &#34;01&#34; indicates the &#34;second range&#34; value--here 32 units; etc.; also note the three offset bit positions in CR, so in Table I, &#34;000&#34; indicates a &#34;first offset&#34; --here four, while &#34;001&#34; indicates a &#34;second offset&#34; value--here eight, etc.). 
     In Table I, also note how a given range width (e.g., &#34;16&#34; or values 0 to 15) is modified, or &#34;offset&#34; &#34;positively&#34;, by adding a given offset value (e.g., 4 to 19 for offset=4 and width of 16 units; similarly, range width becomes 8 to 23 for offset of 8 and width of 16 units). 
     As a further example from Table I, if Range Width is programmed as &#34;32&#34; (2&#39;b 01, or &#34;two-bit, binary&#34; notation &#34;01&#34;) and the offset is &#34;40&#34; (3&#39;b 101, or three-bit binary notation: 101), the resultant &#34;random delay&#34; range value becomes 40-71 (add 40 to raw range 0-31) So, register SR will output (successive) delay numbers RN lying in this range i.e., Backoff time delay t b , Stretch delay t s  : for counters LTR, CTR&#39;, respectively. Thus, logic unit CL would output a random delay number t b  as an 8-bit backoff value to the Backoff Counter CTR (FIG. 2), which would then count-down, as controlled by system clock-pulses (i.e., each clock pulse decrements this Counter, until t b  is reached, then bus-request, is allowed, followed by Resource access)--thus yielding the desired &#34;random backoff&#34; delay, whereby this so-modified AU waits for &#34;random time&#34; t b  and then re-arbitrates for the system bus. 
     In like fashion, a similar &#34;random stretch count&#34; is produced and fed to counter CTR&#39; as delay t s  : this solution enabling the so-modified AU to immediately arbitrate for the system bus, then once &#34;access&#34; is granted, &#34;sit&#34; on it for the so-generated &#34;random time&#34;, and then attempt to use the desired resource--meanwhile allowing the resource to, hopefully, become available, and blocking other, competing agents from using the bus. 
     In the foregoing, workers should preferably assume that each &#34;agent&#34; accessing Register SR, etc. identifies itself with a unique &#34;agent-ID&#34; symbol, and that register SR is &#34;seeded&#34; with all such &#34;agent-ID&#34; numbers, so that each agent will generate a different set of random numbers, and not duplicate those of any other accessing agent (e.g., at least a different &#34;offset&#34; initially). 
     For example, if the range width is programmed to 32 (2&#39;b01: means the register is programmed with &#34;01&#34; which indicates a range at 32) and the offset is 40 (3&#39;b101: ), then a random delay between 40-71 (clocks) will be generated, (adding the offset (40) to the random number: 0-31). 
     The combination logic CL generates the random number using the range to generate a &#34;mask&#34; which selects a subset of the 9 bits in the shift register. The offset is then added to this number to generate a final random stretch or backoff value, to be fed to a respective counter CTR, CTR&#39; (FIG. 2). 
     Of course, whether Backoff or Stretch, or both, is invoked depends on how the machine was set-up (by manufacturer) or later adjusted (by user). And either/both mechanisms are automatically invoked each time a RETRY fails (including repeating foiled RETRYs--the random delay value likely changing each time). 
     In summary, this, modified Addressing unit, AU, according to the invention, provides ways for avoiding livelock via such novel features as: 
     1) implementing a &#34;random backoff&#34;; 
     2) implementing &#34;random stretch&#34;; 
     3) combination of 1) and 2); 
     4) feedback shift register used to generate the random number for 1) and 2); 
     5) windowing technique used to allow the range of random numbers (delay times) to be programmed. 
     These features will be found especially apt for use in &#34;split-transaction&#34; systems of the type described, as well as in other similar systems where multiple agents contend for limited resources. 
     Results 
     It sill be apparent that any aforedescribed invention is apt for effecting the objects mentioned; e.g., to ameliorate &#34;Livelock&#34;--such as by providing a backoff delay--especially via a random backoff mechanism--and/or by providing an automatic random stretch mechanism. And, while we prefer that this be done by so-modifying the cache control of N processor units in a multi-processor array (e.g., to generate the needed random values), workers will realize that other means may, instead, be employed. 
     And, many modifications to the preferred embodiment described are possible without departing from the spirit of the present invention, as claimed. For example, there are other ways to provide a random delay time, nor is our claimed invention limited to the particular types of storage or control, or counting means described. As a further example, the offset and range width in our preferred embodiment are described as implemented with a software algorithm, but it is well known that the same functions can be accomplished using known hardware. Additionally, some features of the present invention can be used to advantage without the corresponding use of other features. 
     Accordingly, the description of the preferred embodiment should be to be considered as including all possible modifications and variations coming within the scope of the invention as defined by the appended claims.