Method for testing and mitigating shared memory contention in multi-processor systems6128708Abstract The method of the present invention provides a procedure for testing shared-memory multi-processor (SMMP) performance by formulating and modifying a given memory contention matrix (MCM), which is generated by collecting traces of memory addresses accessed by so-called subcalls in an SMMPCC. A subcall pair contending for at least one shared memory access address enters a "1" at the respective matrix element. For subcall pairs not sharing any memory address a ".O slashed." is entered. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
______________________________________
SUBCALL 1
SUBCALL 2 SUBCALL 3
______________________________________
SUBCALL 1 A B A
(50% call mix)
C D C C
E L
SUBCALL 2 A C C
(30% call mix)
A C G H
H K K
SUBCALL 3 C H K B C F
(20% Call mix)
C H I J K
______________________________________
The gain index is computed as: gain index (address)=sum over subcall pairs accessing this address of: ##EQU4## For example, the gain index GI(A) for "A" in the above matrix would be ##EQU5## while for 61l(F) it is ##EQU6## Both the "hot spot" strategy and "gain index" strategy start with a "must list" for a given target processing capacity, then produce preferred removal of addresses. The "hot spot" strategy leads the removal by access intensity; the "gain index" strategy computes the gain indexes leads to removal of some members of addresses from the top of the list, and then repeats the procedure iteratively. The "gain index" approach is, therefore, more conserving of the existing software of the SMMPCC. The step of capacity prediction 12 may use the following theoretical quasi random model devised by one of the co-inventors. A paper on this model was given at the 15th International Teletraffic Congress, Washington, U.S.A. in 1997 by T. Drwiega entitled "Shared Memory Contention and its Impact on Multi-Processor Call Control Throughput", which is incorporated herein by reference. Processing a call is performed in stages, called subcalls, which correspond to the phases of the call, such as off-hook, digits, supervision, release, etc. Subcall execution may require accessing some data from the shared memory. Subcalls, which have to access the shared memory, can block, or be blocked on memory access when they are executing concurrently in different processors. In order to be able to model memory contention, accesses of shared memory by subcalls have been studied. The following key characteristics of memory contention were found: 1. There is a fraction of subcalls which do not access the shared memory. 2. Shared memory addresses accessed by two different subcalls are accessed in the same order by both subcalls. For example, if one subcall accesses addresses A, C, E, K, U, V, then the other subcall accesses B, C, D, E, O, U, Y, Z. 3. Subcalls which access shared memory addresses do not necessarily have common addresses with all other subcalls accessing shared memory. Many pairs of subcalls access disjoint sets of addresses. Moreover, depending on the call mix, subcalls from groups, which we call contention groups, such that members of a group access common shared memory addresses, and subcalls from different groups do not contend, or very little contend, for shared memory addresses. The first observation means that a part of the load of subcalls offered to the SMMPCC will never block on memory access. The second observation means that if two subcalls concurrently try to access the same addressees in the shared memory, the subcall that accesses the first common address cannot be blocked by the other. Based on the observations the important parameters characterizing memory contention between subcalls are: 1) the fraction of subcalls which do not access shared memory, and therefore never block, 2) the number of contention groups and their sizes, 3) for each pair of subcalls, the time into the subcalls execution when the first common address is accessed. The first two parameters are indicators of potential for memory contention in the call processing software, for a given mix of subcalls, which we call potential blocking. Potential blocking is independent of the number of processors and of the intensity of the traffic offered to SMMPCC. The above parameters are an input of the model for studying the impact of memory contention on SMMPCC throughput. With reference to FIG. 2, the steps of sorting of the initial (raw) contention matrix into the sorted contention matrix will be described. To reduce complexity, the method proceeds in a hierarchical fashion. First, call types are permuted so that all the interacting call types are placed together in the subcall contention matrix. All the interacting call types together are called a call type group. Next, subcalls within each interacting call type group are permuted so that all the interacting subcalls are placed together. When permuting subcalls, possible interaction between call types in different call type groups is ignored. Proceeding in such a hierarchical fashion, time complexity of the algorithm is significantly reduced from o(n.sup.3) (when all interacting subcall pairs are considered) to o(k.sup.2)+o(n.sup.2 /k*log(n.k)), where n is the no. of subcalls and k is the number of call types. For sorting a 400 by 400 matrix (the largest matrix encountered so far), this reduces the running time to less than 5 minutes from 5 hours on a HP 9000/712/60 Unix machine. Thus, given a set of call types (K--number of call types) and a set of subcalls (N--number of subcalls), the steps are: 1. Find the interacting call types. Two call types interact, if the portion of the contention matrix corresponding to these call types has at least 30% of the entries filled. 2. Partition the set of call types into disjoint subsets that: (a) For every call type in a subset, there exists at least one other call type, with which it interacts, (b) any two call types in two different subsets do not interact with each other; (c) every call type is exactly in one subset. Each such disjoint subset is henceforth called an interacting call type group. At this point, all the possible interaction between subcalls in two different interacting call type groups is ignored. 3. Partition the subcalls in each interacting call type group into disjoint subsets just the same way as we partitioned call types) of subcalls. Two subcalls interact with each other, if there is an entry in the contention matrix; at this point, each subset of subcalls within each interacting call type group is a contention group. 4. Re-arrange the subcalls within each contention group in the decreasing order of number of contention entries it has with the rest of the members in the group. 5. Split those contention groups which have less than 80% of entries filled into smaller contention groups. If the contention group has less than 80% of entries filled, then, the members from the end of the group are removed (subcalls having least number of contention entries with the rest of the members in the group) until a contention group which has 80% of the entries filled is obtained; finally, the same procedure is repeated to the group containing the left over members in the bottom. In the above procedure, there are three key parameters: (i) Two call types interact, if the rectangular matrix formed by their subcalls contain at least 30% of the entries; this criterion is used in determining the interaction between two call types in steps 1 and 2, above. (ii) Each call type should interact with at least one other call type to be in a call type group; this criterion is used in forming the call type groups in step 2. (iii) Density of each contention group should be at least 80%; this criterion is used in splitting the sparse, contention groups in Step 5. The result of the sorting procedure is shown in FIG. 2 on the right, where the diagonal boxes delineate contention groups with at least 80% of the entries filled. Having obtained the sorted contention matrix, we now turn to FIG. 3 and the step of compacting the sorted matrix into the compacted matrix. At the end of the sorting step, all the contention groups have been identified. These contention groups may not have all pairs contending. In other words, there may be holes inside the groups. Also, there may be contention entries present outside the contention groups. First the compacting fills the holes inside the contention groups from the contention entries present outside the groups. This will increase the contention inside the groups. Then, it adjusts the call mix weights so that all the contention groups could be treated as if they were fully blocking (that is, every subcall inside the group contends with every other subcall in the group) and independent (that is, there are no entries present outside the contention groups). That is, for each row in the contention matrix, either call mix weight is reduced if there are no holes that cannot be filled, or, the call mix weight is increased if there are entries outside the contention group that cannot be removed. This operation is performed so that the total potential blocking (sum of products of call mix weight of subcalls for each of the entries present in a contention matrix) is conserved. The weight adjustment is done iteratively until the total potential blocking in the transformed matrix is within a few percent (less than 5%) of the total potential blocking in the empirical contention matrix. In the following detailed description of the compacting step, the term grey/light grey matrix and black/white matrix are used. The first term means a matrix in which there are contention entries (i.e. "1") present outside the contention groups, which is usual in a sorted matrix. The second term means a matrix wherein all the subcalls contend with each other and wherein no two subcalls in two different contention groups contend with each other. The capacity prediction mentioned above requires a black/white matrix. The object of the compacting procedure is to convert the stored dark/light grey matrix into a complete black/white matrix while conserving the total potential blocking in the matrix. The total potential blocking in the matrix can be computed as the sum of products of call mix weights of subcalls i and j for every ijth entry present in the matrix. The total potential blocking in the matrix is a prime indicator of the capacity present in the matrix. Therefore, it is essential that this transformation process conserves the total potential blocking in the matrix. For the purpose of describing the compacting procedure, we adopt the following notation: The contention matrix C is of size (N.times.N). i,j represent the row and column indices of the matrix. Both i and j range from 1 to N. There are K contention groups. The contention groups are indexed by k. k ranges from 1 to K. The starting row of contention group k is denoted by U.sub.k. The ending row of contention group k is denoted by L.sub.k. The entry in the contention matrix corresponding to ith row and jth column is denoted as C.sub.ij. C.sub.ij =1, if the entry is present and 0 otherwise. Call mix weight of ith subcall is denoted as W.sub.i. A pseudo code for the compacting procedure is given below. threshold-0.0 while (total blocking of the transformed matrix is within 5% of the total potential blocking of the empirical matrix) For contention group k=1 to K do for row i=L.sub.k to U.sub.k do Exchange any hole inside the group in ith row with a entry outside the group along ith row. calculate the sum of call mix weights of all subcalls (denoted by Sum.sub.-- row) corresponding to those columns j where the entry C.sub.ij =1. calculate the sum of call mix weights of all subcalls (denoted by Sum.sub.-- group.sub.-- corresponding to those columns j (j being inside the group) where the entry C.sub.ij =1. Adjust the call mix weight W.sub.i as follows: ##EQU7## end (of the inner for loop) end (of the outer for loop) threshold=threshold+0.01 end(of the outer while loop) In FIG. 1, the example matrix illustrates the application of the compacting procedure. In this example, the matrix on the left side is the empirical sorted contention matrix and the matrix on the right side is the transformed compacted matrix. Note that the matrix on the left side is divided into dark grey and light grey regions. In the dark grey regions, 80% of the entries are filled. In the light grey regions, 15% of the entries are filled. Dark grey regions correspond to contention groups. The objective of the compacting procedure is to convert dark grey regions into complete dark region (100% of the entries filled) and eliminate light grey region while conserving the total potential blocking. Note that the transformed matrix appears much bigger in size as the modified call mix weights of each of the contention groups are bigger than their original call mix weights in the empirical matrix. But, the product of call mix weights of subcalls corresponding to contention entries (that is, total potential blocking) in both the matrices are equal.
|
Same subclass Same class Consider this |
||||||||||
