Method and controller for processing data multiplication in RAID system
09594631 ยท 2017-03-14
Assignee
Inventors
Cpc classification
G06F11/1076
PHYSICS
G06F2211/1057
PHYSICS
International classification
H03M13/15
ELECTRICITY
G06F11/10
PHYSICS
Abstract
The invention discloses a method and controller for processing data multiplication in a RAID system. Map tables are generated for all values in a field, respectively. The length of an XOR operation unit is chosen to be appropriate w bits (e.g., 32 bits or 64 bits). One or several XOR operation units form a multiplication unit of a data sector. When computing on-line, data in a disk drive of a disk array are performed with XOR operations in accordance with one of the map tables using an XOR operation unit as one unit while computing on the multiplication unit to obtain a product of multiplication. Making use of the RAID system established according to the disclosed method, only XOR operations are required to compute parity data or recover damaged user data. Moreover, several calculations can be performed simultaneously. Therefore, the efficiency of the RAID system can be effectively improved.
Claims
1. A method for accessing data in a physical storage device (PSD) array including a plurality of PSDs, at least one memory, a storage virtualization controller (SVC) comprising a central processing circuit (CPC), and a hardware computation device, comprising the steps of: receiving a first I/O request from a host by the SVC for writing data into a first user data block in the PSDs of the PSD array, said first user data block being located on a first stripe having a first parity data block and a second parity data block; updating the second parity data block due to the first I/O request writing data into the first user data block, comprising the steps of: using at least one memory for temporarily storing a first group of target data sets provided by a data source, wherein each of the first group of target data sets is of a length of a multiplication unit containing a XOR operation units, each of the XOR operation units being of a data length of w bits and being used for performing an XOR operation, and the multiplication unit being of a data length of a multiplying w bits and being used for performing a multiplication operation, wherein a and w are each a positive integer larger than one and w is independent of a; using the central processing circuit (CPC) to generate or to access at least one map table each associated with one value in a field, and storing the at least one map table in the at least one memory, wherein said at least one map table has a dimension of a by a; performing a multiplication operation on a first target data set of the first group of target data sets to obtain a first multiplication result, wherein said performing a multiplication operation is through using the hardware computation device to perform a plurality of XOR operations on the first target data set according to the at least one map table, wherein each of the plurality of XOR operations is performed on a part of the first target data set, said part of the first target data set being data in one of the a XOR operation units; storing the first multiplication result in the at least one memory; generating the second parity data block by obtaining a plurality of multiplication results by performing a plurality of multiplication operations each of which comprising performing a plurality of XOR operations on its corresponding target data set of the first group of target data sets; and storing the generated second parity data set; and returning by the SVC a completion message of the first I/O request to the host.
2. The method of claim 1, further comprising the steps of: receiving a second I/O request from the host by the SVC for reading data from a plurality of user data blocks in the PSDs of the PSD array, said user data blocks being located on the first stripe; identifying by the SVC data access errors on two of the user data blocks of the first stripe; initializing by the SVC a recovering process involving the second parity data block to recover a failed-access user data block, wherein the recovering process comprises the steps of: using at least one memory for temporarily storing a second group of target data sets provided by a data source, wherein each of the second group of target data sets is of a length of a multiplication unit containing a XOR operation units, each of the XOR operation units being of a data length of w bits and being used for performing an XOR operation, and the multiplication unit being of a data length of a multiplying w bits and being used for performing a multiplication operation, wherein a and w are each a positive integer larger than one and w is independent of a; performing a multiplication operation on a second target data set of the second group of target data sets to obtain a second multiplication result, wherein said performing a multiplication operation is through using the hardware computation device to perform a plurality of XOR operations on the second target data set according to the at least one map table, wherein each of the plurality of XOR operations is performed on a part of the second target data set, said part of the second target data set being data in one of the a XOR operation units; storing the second multiplication result in the at least one memory; and generating a data set identical to the failed-access user data block by obtaining a plurality of multiplication results by performing a plurality of multiplication operations each of which comprising performing a plurality of XOR operations on its corresponding target data set of the second group of target data sets; and returning by the SVC the regenerated data set identical to the failed-access user data block to the host.
3. The method of claim 2, wherein the regenerated data set is obtained using the following formula:
D.sub.x=A.Math.(P+P.sub.xy)+B.Math.(Q+Q.sub.xy)
D.sub.y=(P+P.sub.xy)+D.sub.x where x and y are the serial numbers of two user data PSDs with errors of the plurality of PSDs; D.sub.x and D.sub.y are target data sets corresponding to the two user data PSDs x and y of the plurality of PSDs; A and B are constants only dependent upon x and y:
A=g.sup.y-x.Math.(g.sup.y-x+1).sup.1
B=g.sup.x.Math.(g.sup.y-x+1).sup.1 P.sub.xy and Q.sub.xy are the values of P and Q, respectively, when D.sub.x and D.sub.y are both 0, i.e.,
P.sub.xy+D.sub.x+D.sub.y=P
Q.sub.xy+g.sup.x.Math.D.sub.x+g.sup.y.Math.D.sub.y=Q where + represents an XOR operation; and .Math. represents the multiplication operation of the Galois Field.
4. The method of claim 1, wherein the second parity block is obtained using the following formula:
Q=g.sup.0.Math.D.sub.0+g.sup.1.Math.D.sub.1+g.sup.2.Math.D.sub.2+ . . . +g.sup.n-1.Math.D.sub.n-1 where g is a generator of a Galois Field and given to be 2; D.sub.0, D.sub.1, D.sub.2, . . . , D.sub.n-1 denote target data sets from n number of user data PSDs of the plurality of PSDs, respectively; + represents an XOR operation; and .Math. represents the multiplication operation of the Galois Field.
5. The method of claim 1, wherein the field is a Galois Field and wherein the map table is generated according to an algorithmic rule of the Galois Field.
6. The method of claim 5, wherein when the domain of the Galois Field is GF(2.sup.8) the algorithmic rule is:
m.sub.0,j=m.sub.7,j,0j7
m.sub.1,j=m.sub.0,j,0j7
m.sub.2,j=m.sub.1,j+m.sub.7,j,0j7
m.sub.3,j=m.sub.2,j+m.sub.7,j,0j7
m.sub.4,j=m.sub.3,j+m.sub.7,j,0j7
m.sub.5,j=m.sub.4,j,0j7
m.sub.6,j=m.sub.5,j,0j7
m.sub.7,j=m.sub.6,j,0j7 where m.sub.0,jm.sub.7,j and m.sub.0,jm.sub.7,j with 0j7 are elements of matrixes M.sub.K and M.sub.K, respectively, M.sub.K being a given matrix associated with K, M.sub.K being a matrix associated with K=2.Math.K wherein K0.
7. The method of claim 1, wherein the plurality of XOR operations are performed according to the following formula:
m.sub.i,j.Math.x.sub.j=x.sub.j, if m.sub.i,j=1
m.sub.i,j.Math.x.sub.j=0, if m.sub.i,j=0 where x.sub.0, x.sub.1, x.sub.2, . . . , and x.sub.a-1 represent data whose length is the same as the length of the XOR operation unit, respectively, X represents data of the multiplication unit; and Y represents the result of multiplying K by X.
8. The method of claim 7, wherein the XOR operation performed according to the map tables is the one selecting the data of the XOR operation unit whose corresponding elements in the same row of the matrix M are 1 to do the XOR operation.
9. The method of claim 1, wherein the length of the XOR operation unit is determined according to a processing unit of a central processing unit (CPU) or the hardware computation device.
10. The method of claim 1, wherein the length of the XOR operation unit is 32 bits or 64 bits.
11. The method of claim 1, wherein the length of the multiplication unit is 32 bytes or 64 bytes.
12. The method of claim 1, wherein the data source is a physical storage device (PSD) array or a computer host.
13. A controller for accessing data in a physical storage device (PSD) array including a plurality of PSDs and a hardware computation device, comprising: at least one I/O device interconnect controller for receiving a first I/O request from a host for writing data into a first user data block in the PSDs of the PSD array, said first user data block being located on a first stripe having a first parity data block and a second parity data block; at least one memory for temporarily storing a first group of target data sets provided by a data source, wherein each of the first group of target data sets is of a length of a multiplication unit containing a XOR operation units, each of the XOR operation units being of a data length of w bits and being used for performing an XOR operation, and the multiplication unit being of a data length of a multiplying w bits and being used for performing a multiplication operation, wherein a and w are each a positive integer larger than one and w is independent of a; and a central processing circuit (CPC) for interacting with the at least one memory, for generating or accessing at least one map table each associated with one value in a field, and storing the at least one map table in the at least one memory, wherein the at least one map table has a dimension of a by a; wherein the CPC is for performing a multiplication operation on a first target data set of the first group of target data sets to obtain a first multiplication result, wherein said performing a multiplication operation is through using the hardware computation device to perform a plurality of XOR operations on the first target data set according to the at least one map table, wherein each of the plurality of XOR operations is performed on a part of the first target data set, said part of the first target data set being data in one of the a XOR operation units; wherein the first multiplication result is stored in the at least one memory; wherein the CPC is further for generating the second parity data block for storing into the first stripe of the PSD array by obtaining a plurality of multiplication results by performing a plurality of multiplication operations each of which comprising performing a plurality of XOR operations on its corresponding target data set of the first group of target data sets.
14. The controller of claim 13, wherein the CPC further includes a CPU.
15. The controller of claim 13, wherein the data source is a PSD array or a computer host for providing the first group of target data sets for the multiplication operation.
16. The controller of claim 13 further comprising a device-side I/O device interconnect controller connected between the PSD array and the CPC.
17. The controller of claim 13 further comprising a host-side I/O device interconnect controller connected between the host and the CPC.
18. The controller of claim 13, wherein the field is a Galois Field and the map table is generated according to an algorithmic rule of the Galois Field.
19. The controller of claim 18, wherein when the domain of the Galois Field is GF(2.sup.8), the algorithmic rule is:
m.sub.0,j=m.sub.7,j,0j7
m.sub.1,j=m.sub.0,j,0j7
m.sub.2,j=m.sub.1,j+m.sub.7,j,0j7
m.sub.3,j=m.sub.2,j+m.sub.7,j,0j7
m.sub.4,j=m.sub.3,j+m.sub.7,j,0j7
m.sub.5,j=m.sub.4,j,0j7
m.sub.6,j=m.sub.5,j,0j7
m.sub.7,j=m.sub.6,j,0j7 where m.sub.0,jm.sub.7,j and m.sub.0,jm.sub.7,j with 0j7 are elements of matrixes M.sub.K and M.sub.K, respectively, M.sub.K being a given matrix associated with K, M.sub.K being a matrix associated with K=2.Math.K wherein K0.
20. The controller of claim 13, wherein the the plurality of XOR operations are performed according to the following formula:
m.sub.i,j.Math.x.sub.j=x.sub.j, if m.sub.i,j=1
m.sub.i,j.Math.x.sub.j=0, if m.sub.i,j=0 where x.sub.0, x.sub.1, x.sub.2, . . . , and x.sub.a-1 represent data whose length is the same as the length of the XOR operation unit, respectively, X represents data of the multiplication unit; and Y represents the result of multiplying K by X.
21. The controller of claim 13, wherein the length of the XOR operation unit is determined according to a processing unit of the central processing unit (CPU) or the hardware computation device.
22. The controller of claim 13, wherein the length of the XOR operation unit is 32 bits or 64 bits.
23. The controller of claim 13, wherein the length of the multiplication unit is 32 bytes or 64 bytes.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) These and other features, aspects and advantages of the invention will become apparent by reference to the following description and accompanying drawings which are given by way of illustration only, and thus are not limitative of the invention, and wherein:
(2)
(3)
(4)
(5)
(6)
DETAILED DESCRIPTION OF THE INVENTION
(7) The present invention will be apparent from the following detailed description, which proceeds with reference to the accompanying drawings, wherein the same references relate to the same elements.
(8) A feature of the invention is in the appropriate definitions of operational rules for the data in the RAID system in order to speed up the data operations. In practice, the operational rules for the RAID data are commonly taken to be the algebraic rules of the Galois Field. Therefore, the algebraic rules of the Galois Field are used in the following embodiments. One embodiment of the invention is established on the hypothesis of GF(2.sup.a) of the Galois Field and its related algebraic rules. As a=8 is a currently-preferred choice in practice, most of the embodiments in this specification assume the domain of the Galois Field to be GF(2.sup.8). That is, the covered numbers are between 0 and 255. This is because 2.sup.8 is exactly the amount represented by one byte which is a basic unit of computer memory. The RAID system accordingly established can accommodate up to 255 user data disks, which are sufficient for normal RAID systems. Although the embodiments in this specification assume GF(2.sup.8), the invention can be applied to other cases with other hypotheses. In other embodiments of the invention, the disclosed technique may be applied in a Galois field domain different from GF(2.sup.8). Moreover, the invention can also use the operations in other fields or number systems, as long as appropriate operational rules are found in those fields or number systems.
(9) Most of the embodiments described below take a RAID6 system with two parities as the example. However, the invention can be applied to more general cases. Other RAID 6 systems with more than two parities can be implemented with the disclosed method as well. The conventional formulas quoted in the specification are listed as follows.
P=D.sub.0+D.sub.1+D.sub.2+ . . . +D.sub.n-1(1)
Q=g.sup.0.Math.D.sub.0+g.sup.1.Math.D.sub.1+g.sup.2.Math.D.sub.2+ . . . +g.sup.n-1.Math.D.sub.n-1(2)
D.sub.x=A.Math.(P+P.sub.xy)+B.Math.(Q+Q.sub.xy)(3)
D.sub.y=(P+P.sub.xy)+D.sub.x(4)
A=g.sup.y-x.Math.(g.sup.y-x+1).sup.1(5)
B=g.sup.x.Math.(g.sup.y-x+1).sup.1(6)
where P and Q are the two parities in the RAID6 system; x and y are the serial numbers of the two data disks with errors; D.sub.x and D.sub.y are the user data corresponding to the two data disks x and y; A and B are constants only related to x and y; and P.sub.xy and Q.sub.xy are the values of P and Q when D.sub.x and D.sub.y are both 0, i.e.,
P.sub.xy+D.sub.x+D.sub.y=P(7)
Q.sub.xy+g.sup.x.Math.D.sub.x+g.sup.y.Math.D.sub.y=Q(8)
(10) Aside from the fact that the power yx is a normal subtraction, the other algebraic operations in Eqs. (1) to (8) are all operations following the rules of the Galois Field. Moreover, g is a generator of the Galois Field. It usually be chosen as g=2.
(11) Definition of the Map Table
(12) The map table is a key ingredient of the invention. It is defined as follows.
(13) Suppose Y, X, and K are numbers in GF(2.sup.a). That is, Y, X, and K are all composed of a bits. If y.sub.i and x.sub.i represents the i-th bits of Y and X, respectively, then the vectors Y and X can be represented by:
(14)
(15) Let Y=K.Math.X; that is, Y is the multiplication result of K with an arbitrary number X in the Galois Field. Here K is a given constant. Then the map table of K is defined as an aa matrix M.sub.K, whose elements m.sub.i,j (0<=i, j<=a1) are 0 or 1 and satisfy:
(16)
(17) In other words,
(18)
(19) The addition in the above operations is defined as the XOR operation. Since the elements in the matrix M.sub.K are either 0 or 1, the computation of y, can be regarded as follows: the data units x.sub.j corresponding to m.sub.i,j=1 in the i-th row of the matrix M.sub.K are selected to do XOR operations.
(20) Generation of the Map Table
(21) The way of generating the map table is closely related to the algebraic rules of the Galois Field. Take GF(2.sup.8) as an example. Suppose the product of an arbitrary number X and 2 is X, then X can be obtained from the following formula (+ represents an XOR operation):
(22)
(23) Suppose the map table of K is a given matrix M.sub.K and the map table of K=2.Math.K is the matrix M.sub.K. Based on the above formula, one can derive the algorithmic rule A for generating M.sub.K from M.sub.K, shown in Table 1:
(24) TABLE-US-00001 TABLE 1 m.sub.0,j = m.sub.7,j , 0 <= j <= 7 m.sub.1,j = m.sub.0,j , 0 <= j <= 7 m.sub.2,j = m.sub.1,j + m.sub.7,j , 0 <= j <= 7 m.sub.3,j = m.sub.2,j + m.sub.7,j , 0 <= j <= 7 m.sub.4,j = m.sub.3,j + m.sub.7,j , 0 <= j <= 7 m.sub.5,j = m.sub.4,j , 0 <= j <= 7 m.sub.6,j = m.sub.5,j , 0 <= j <= 7 m.sub.7,j = m.sub.6,j , 0 <= j <= 7
(25) One algebraic feature of the Galois Field is as follows. Start from K=1 and multiply K each time by 2. The derived new K values do not repeat until covering all the numbers in the Galois Field. Take GF(2.sup.8) as an example. Start from K=1 and record it. Multiply K by 2 each time. After 255 times recording, the derived K values will cover all the GF(2.sup.8) numbers (except for 0).
(26) According to the above-mentioned algebraic properties of the Galois Field and the algorithmic rule A, all map tables corresponding to different K values, i.e., all the matrix M.sub.K, can be generated. Please refer to
(27) With reference to
(28) A few map tables in GF(2.sup.8) are listed below for references.
(29)
Application of the Map Table
(30) One advantage of using the map tables for the multiplication operations in the Galois Field is to avoid the operations of shifting digits or looking up the log table/inverse log table. All it needs is the XOR operations.
(31) Take GF(2.sup.8) as an example. Suppose Y is the product of a constant 20 and an arbitrary number X, i.e., Y=20.Math.X, and the map table associated with 20 (the matrix M.sub.20) is given as:
(32)
(33) According to the definition,
(34)
(35) For example, if X=83, then Y=8, as given below:
(36)
(37) If the value of Y is computed using the conventional technique by looking up the log table/inverse log table, then
Y=20.Math.83=2.sup.206.Math.2.sup.52=2.sup.206+52=2.sup.258=2.sup.258255=2.sup.3=8
which is the same as the result computed by the disclosed technique of the invention.
Explanation of the Algorithm
(38) The disclosed algorithm of the invention allows the operations of a huge amount of Galois Field multiplication to proceed at the same time, particularly the multiplication operations of a constant with a lot of different numbers. Therefore, it speeds up the operations in a RAID system.
(39) Please refer to
(40) How to generate the map tables (step 200) is already described above.
(41) The technique of how to enlarge the XOR operation unit to w bits (step 300) is described as follows.
(42) According to the definition of the map table, i.e. Eq. (9), y.sub.i and x.sub.i denote the i-th bit of Y and X, respectively, where Y and X are numbers in GF(2.sup.a). It implies that when the map tables are used for conventional operations, the XOR operation unit is 1 bit and the multiplication unit is a number in GF(2.sup.a). The disclosed method of the invention enlarges the XOR operation unit to w bits, and thus the multiplication unit is enlarged to w.Math.a bits. Take GF(2.sup.8) as an example. If setting w=32, then the XOR operation unit has 32 bits according to the invention, and the multiplication unit has 32.Math.8=256 bits=32 bytes, namely, the set of 32 numbers in GF(2.sup.8).
(43) One of the chief considerations of selecting the length of the XOR operation unit to be w is the system hardware environment. For example, the consideration could be the operation unit of the CPU or dedicated XOR operation unit or the width of the data bus. If the operation unit of the CPU or dedicated XOR operation unit is 32 bits, then w=32 is an appropriate choice. If the operation unit of the CPU or dedicated XOR operation unit is 64 bits, then setting w=64 is suitable. Of course, it does not imply that the choice of w is necessarily limited to be the same as the length of the operation unit of the CPU or dedicated XOR operation unit. Different w values may be used in other embodiments of the invention.
(44) Another factor influencing the value of w is considering that the basic storage unit (a sector) of the disks had better be an integer multiple of the multiplication unit. Take GF(2.sup.8) as an example. If setting w=20, then the multiplication unit has 20.Math.8=160 bits=20 bytes. The basic storage unit, i.e. a sector, of the disks usually has 512 bytes. Since 512 is not an integer multiple of 20, therefore additional operations have to be performed when the multiplication unit is incomplete.
(45) After determining the value of w, the system can perform online multiplication of the Galois Field according to the map tables (step 400). The multiplication may be performed for computing a parity or lost user data. The operation rule is still following Eq. (9). However, the XOR operation unit is enlarged to an appropriate w bits, and the multiplication unit is enlarged to w.Math.a bits. That is, both y.sub.i and x.sub.i have w bits, and both Y and X have w.Math.a bits.
(46) In the following, an embodiment is used to explain the disclosed method. If it is the intention to calculate the product of Y=20.Math.X in GF(2.sup.8). X is a 32-byte data sector. In the hexadecimal number system, X is represented as follows:
(47)
where the 0-th byte of X is denoted by B.sub.0, the first byte by B.sub.1, the second byte by B.sub.2, and so on, until B.sub.31.
(48) According to the disclosed method, the RAID system computes and stores all the map tables when its starts. Therefore, the map table associated with 20 is already given. Suppose the system CPU is 32-bit. Therefore, w is set to be 32. In this case, Y and X are considered to be the data series composed of 8 units, given as: Y=y.sub.0 y.sub.1 y.sub.2 y.sub.3 y.sub.4 y.sub.5 y.sub.6 y.sub.7 X=x.sub.0 x.sub.1 x.sub.2 x.sub.3 x.sub.4 x.sub.5 x.sub.6 x.sub.7
where y.sub.i and x.sub.i represent operation units consisting of 32 bits (4 bytes), 0i7.
(49)
(50) The map table of the constant 20 is already given in Eq. (11). Using Eqs. (9) and (12), one obtains (in the hexadecimal system):
y.sub.0=x.sub.4+x.sub.6=(a5 42 78 03)+(01 92 47 86)=(a4 d0 3f 85)
y.sub.1=x.sub.5+x.sub.7=(77 25 19 64)+(22 55 9a 76)=(55 70 83 12)
y.sub.2=x.sub.0+x.sub.4=(25 2a 1b 33)+(a5 42 78 03)=(80 68 63 30)
y.sub.3=x.sub.1+x.sub.4+x.sub.5+x.sub.6=(52 6a 11 90)+(a5 42 78 03)+(77 25 19 64)+(01 92 47 86)=(81 9f 37 71)
y.sub.4=x.sub.0+x.sub.2+x.sub.4+x.sub.5+x.sub.7=(25 2a 1b 33)+(80 46 7c ab)+(a5 42 78 03)+(77 25 19 64)+(01 92 47 86)=(55 5e 9c 89)
y.sub.5+x.sub.3+x.sub.5+x.sub.6=(52 6a 11 90)+(6e 21 5b 44)+(77 25 19 64)+(01 92 47 86)=(4a fc 14 36)
y.sub.6=x.sub.2+x.sub.4+x.sub.6+x.sub.7=(80 46 7c ab)+(a5 42 78 03)+(01 92 47 86)+(22 55 9a 76)=(06 c3 d9 58)
y.sub.7=x.sub.3+x.sub.5+x.sub.7=(6e 21 5b 44)+(77 25 19 64)+(22 55 9a 76)=(3b 51 d8 56)
(51) Therefore, Y=|a4 d0 3f 85|55 70 83 12|80 68 63 30|81 9f 37 7155 5e 9c 89|4a fc 14 36|06 c3 d9 58|3b 51 d8 56|
(52) The above example assumes that the length of X is 32 bytes. If the length of X is greater than 32 bytes, then X is divided into groups each composed of 32 bytes. Each group of 32 byte forms a multiplication unit. Therefore, the product Y can be obtained by repeating the above operations.
(53) Features of the Algorithm
(54) Using the disclosed algorithm of the invention on the RAID system, the obtained parity is different from that obtained in the prior art. However, its effect and the way of application are completely the same as the prior art.
(55) For example, suppose D.sub.0, D.sub.1, and D.sub.2 are three disk drives for storing user data, which are 32-byte data series, shown as follows (expressed in the hexadecimal system):
(56)
where B.sub.0 denotes the 0-th byte, B.sub.1 the first byte, and so on, until B.sub.31. The RAID6 system comprising the three user data disk drives requires additional two party data disk drives for storing parities P and Q. According to Eqs. (1) and (2), one obtains:
P=D.sub.0+D.sub.1+D.sub.2
Q=2.sup.0.Math.D.sub.0+2.sup.1.Math.D.sub.1+2.sup.2.Math.D.sub.2
(57) In the prior art, the values of P and Q in GF(2.sup.8) are computed as follows:
(58)
(59) Using the disclosed method of the invention, the P value is unchanged. The value of Q is as follows (assuming w=32):
(60)
(61) Suppose the data in D.sub.0 and D.sub.2 are damaged, they can be recovered by using D.sub.1, P, and Q. Using Eqs. (3), (4), (5), (6), (7), and (8), one obtains:
x=0,y=2,A=166,B=167;
D.sub.0=166.Math.P+167.Math.Q+245.Math.D.sub.1
D.sub.2=P+D.sub.1+D.sub.0(13)
(62) 1. In the prior art, each byte is computed one by one to solve:
166.Math.P=|fe 9a d2 9a|2d 30 9a ae|05 be be 55|51 34 78 c375 5c bb 70|31 cf d6 8b|82 96 c2 28|5c 97 54 a3
167.Math.Q=|31 57 0f 63|75 a1 13 5d|15 99 82 01|ad 44 89 f9f4 c4 49 33|74 57 03 71|75 e1 16a8|ca 2c 2d 10|
245.Math.D.sub.1=|e5 db cd cf|08 85 91 95|4c 26 3a 46|c9 0e b7 309b a1 9d 54|1c ed 9d a7|dd 70 83 b9|99 8b 58 83|
Therefore,
D.sub.0=|2a 16 10 36|50 14 18 66|5c 01 06 12|35 7e 46 0a1a 39 6f 17|59 75 48 5d|2a 07 57 39|0f 30 21 30|
D.sub.2 is then obtained by substituting D.sub.0 in Eq. (13).
(63) 2. According to the disclosed method of the invention, one obtains:
166.Math.P=|52 4b 78 13|0f 5b 57 7b|4f 32 68 32|33 77 4a 1851 3d 58 5d|3e 15 7b 59|7e 76 04 31|44 20 16 39|
167.Math.Q=|08 72 67 3c|36 58 65 22|06 42 1c 57|09 62 56 1917 49 00 70|63 52 59 40|42 56 64 36|60 7f 4c 5c|
245.Math.D.sub.1=|70 2f 0f 19|69 17 2a 3f|15 71 72 77|0f 6b 5a 0b5c 4d 37 3a|04 32 6a 44|16 27 37 3e|2b 6f 7b 55|
Therefore,
D.sub.0=|2a 16 10 36|50 14 18 66|5c 01 06 12|35 7e 46 0a1a 39 6f 17|59 75 48 5d|2a 07 57 39|0f 30 21 30|
Likewise, D.sub.2 is obtained by substituting D.sub.0 in Eq. (13).
(64) The above example reveals that even though the value of Q obtained by the techniques disclosed in the invention is different from the one computed by the prior art, however, the functions of protecting and recovering the user data are identical to the one in the prior art.
(65) Correctness of the Algorithm and its Mathematical Meaning
(66) Take GF(2.sup.8) as an example. Suppose Y and X are composed of 8 XOR operation units, each of which has a length of w bits. Here w is an appropriate number, such as 32 in the previous example. Y and X are represented in a vector format as follows,
(67)
where y.sub.i and x.sub.i are w-bit numbers and 0i7.
(68) Let Y=K.Math.X, where K is a constant whose map table is the matrix M.sub.K. Then
(69)
That is,
(70)
(71) Let y.sub.i,j and x.sub.i,j denote the j-th bits of y.sub.i and x.sub.i, respectively, where 0i7 and 0jw1. Since both y.sub.i and x.sub.i have w bits, the above equations can be unfolded as follows:
(72)
(73) Analyzing Eqs. (14) to (21), one finds:
(74)
(75) That is, (y.sub.0,0 y.sub.1,0 . . . y.sub.7,0) and (x.sub.0,0 x.sub.1,0 . . . x.sub.7,0) satisfy the definition of the map table in Eq. (9). Therefore, the former one is the product of K and the latter one in the Galois Field. Likewise, the numbers of (y.sub.0,j y.sub.1,j . . . y.sub.7,j) for all j satisfying 0jw1 are the products of K and (x.sub.0,j x.sub.1,j . . . x.sub.7,1).
(76) The above-mentioned analysis provides a mathematical meaning for the disclosed technique. Please refer to
(77) From the viewpoint of the equivalent method mentioned above, the disclosed method of the invention still follows the algebraic principles of the Galois Field. The difference from the prior art is the way of data sampling. That is, the disclosed method of the invention can be regarded as being equivalent to sampling one bit every w bits in the data sector until a GF(2.sup.a) number is obtained.
(78) For example, as shown in
(79) In contrast, the prior art samples data in sequence, as shown in
(80) From the equivalent point of view mentioned above, although the invention has different sampling method from the prior art, this does not affect the correctness of Eqs. (2) to (8). Therefore, the functions of data protecting and recovering remain the same.
(81) The above-mentioned equivalent method is only for explaining the essence of the invention. In practice, the disclosed method of the invention can simultaneously compute several Galois Field products, thereby increasing the operation speed of the RAID system. This advantage originates from the special data sampling method in the equivalent method.
(82) System Structure Using the Disclosed Algorithm
(83) In an embodiment of the invention, the disclosed method is applied to a redundant array of independent disk (RAID) subsystem. With reference to
(84) In this embodiment, the SVC 100 comprises a host-side I/O device interconnect controller 120, a central processing circuit (CPC) 140, a memory 180, and a device-side I/O device interconnect controller 500. Although these components are described using individual functional blocks, in practice some or even all the functional blocks can be integrated on a single chip.
(85) The host-side I/O device interconnect controller 120 is connected to the host 10 and the CPC 140 to be the interface and buffer between the SVC 100 and the host 10. It receives the I/O requests and the related data transmitted from the host 10 and converts and/or maps them to the CPC 140.
(86) The memory 180 is connected to the CPC 140 to be a buffer. It buffers the data transmitted between the host 10 and the PSD array 600 that pass through the CPC 140.
(87) The device-side I/O device interconnect controller 500 is disposed between the CPC 140 and the PSD array 600 to be the interface and buffer between the SVC 100 and the PSD array 600. The device-side I/O device interconnect controller 500 receives the I/O requests and the related data transmitted from the CPC 140 and maps and/or transmits them to the PSD array 600.
(88) The CPC 140 includes a CPU chipset 144 that has a parity engine 160, a central processing unit (CPU) 142, a read only memory (ROM) 146, and a non-volatile random access memory (NVRAM) 148. The CPU 142 can be, for example, a Power PC CPU. The ROM 146 can be a flash memory for storing the basic input/output system (BIOS) and/or other programs. The CPU 142 is coupled via the CPU chipset 144 to other electronic devices (e.g., the memory 180). The NVRAM 148 is used to store information related to the status of I/O operations on the PSD array 600, so that the information can be used as a check when the power is unexpectedly shut down before the I/O operations are finished. The ROM 146, the NVRAM 148, an LCD module 550, and an enclosure management service (EMS) circuit 560 are coupled to the CPU chipset 144 via an X-bus. Moreover, the NVRAM 148 is optional; namely, it may be omitted in other embodiment. Although the CPU chipset 144 is described as a functional block integrated with the parity engine 160, they can be disposed separately on different chips in practice.
(89) In an embodiment of the invention, the target data processed in the multiplication operations may come from the PSD array 600 or the host 10. The multiplication result may be stored in the memory 180, the disk drives of the PSD 600, or the buffer built in the parity engine 160 or the CPU 142 (not shown in the drawing). The algorithm of the invention is implemented by program coding. The program can be stored in the ROM 146 or the memory 180 for the CPC 140 to execute. In other words, the CPC 140 is responsible for generating map tables corresponding to the numbers in a field domain (e.g., GF(2.sup.8)) during power on or on line. The generated map tables can be stored in the memory 180. In another embodiment of the invention, all the necessary map tables can be computed in advance and stored in the ROM 146 or the memory 180 so that the CPC 140 only needs to access the stored map tables after power on. During the online real-time operations, for a given multiplication unit, an XOR operation unit is taken as an unit to perform an XOR operation on the target data stored in the memory according to the map tables. The multiplication result is then obtained after several the XOR operations.
(90) Although in the above embodiment, disks are taken as an example for the physical storage devices (PSDs) used in the RAID subsystem, it is noted that other kinds of physical storage devices, such as CD, DVD, etc., can be used alternatively, depending on different demands of the market.
(91) The invention being thus described, it will be obvious that the same may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the invention, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.