Background technique
Domestic series processors of soaring are based on ARM64 architecture, and compatible with ARMV8 instruction set, inside is realizedNEON expands instruction.The SIMD instruction part of this expansion compensates for weak tendency of the Feiteng processor in terms of cpu frequency, can be used forThe internal storage access of data-intensive applications, data is accelerated to calculate.Common data-intensive applications have graphics calculations, amusement shadowSound, data check etc..
Along with the development of cloud computing and the arrival of big data era, the requirement that people store data is higher and higher.It is existingStorage equipment relative to being greatly improved on memory capacity and storage speed in the past, but the following storageReliability, safety is also at people's increasingly concern, and data are once lost, it will to bringing on a disaster property of enterprises and individualsLoss.The appearance of RAID technique solves the problems, such as that field of data storage encounters to a certain extent.Especially RAID6, itMemory capacity, storage speed and storage security have been combined, all trades and professions of digital area are widely used in.
RAID6 sacrifices two in disk array disks for doing even-odd check to ensure the safeties of data, thisDifferent checking algorithms is respectively adopted in two check disks, and this twin check mechanism supports that at most there are two disks in disk arrayDamage can use this double verification to carry out data recovery once there are one or two disk failures.If there is twoA disk failures data are in Restoration stage, have new disk failures again at this time, lose then will lead to user dataIt loses.Therefore, the data resume speed of RAID6 is most important, the risk of loss of data can be not only reduced if resume speed is fast but alsoUser experience can be promoted.The RAID6 data soared on platform at present are restored using general SISD (single instrction odd numberAccording to) instruction handled, this SIMD than relatively time-consuming, introduces Feiteng processor for computation-intensive RAID6 recovery operationIncluded NEON expands instruction and optimizes to it, can accelerate the data recovery procedure of RAID6.
It is reported that in existing RAID6 data recovery technique, without it is a kind of can solve data on platform of soaring and restore slow askTopic.Current realization is instructed using SISD, and single executes the data that can only restore a byte, in the not high situation of cpu frequencyUnder, longer time will be consumed by restoring the biggish disk array of capacity.
Chinese invention patent " a kind of method of RAID6 block corruptions processing " (application number CN201410393820.1), shouldInvention proposes a kind of method of RAID6 block corruptions processing, and specific implementation is: reading data strip first establishes oneBad block message record sheet records bad block transinformation;Then inquiry record process, read-write operation first inquire this in the mapping tableWhether band is recorded;Record process is added again;Inquiry then judges whether with the presence or absence of read-write error if there is read-write errorIt can just repair;The last phase during idle time starts a cycle thread and finds mistake in time for scanning disk.This methodBy truthful data block being transferred in the verification data block of same band, data access efficiency is improved, it is general to reduce loss of dataRate, but effective ways is not taken to accelerate the resume speed after RAID6 loss of data.
Chinese invention patent " a kind of data reconstruction method for RAID6 " (application number CN201510280713.2), shouldInvention proposes a kind of data reconstruction method for RAID6, the following steps are included: S1: retrieving NTFS partition in all disksDBR;MFT table starting position is retrieved in S2:DBR;S3: computing array stripe size;S4: computing array starting position;S5: sentenceDisconnected effect area, group pattern of laying equal stress on;S6: restore to lose data.The invention is quickly scanned and is obtained using DBR feature and MFT featureEntire array structure accurately distinguishes data field and check field data, carries out data using the common array arrangement mode of RIAD6Weight set can cope with the data that one piece of hard disk is lost and two pieces of hard disks are lost and restore.It is fast to parse entire array structure speed, dataRecombination speed is fast, and data revert to power height.But the invention application scenarios are limited, need disk array support DBR feature andMFT feature, and the SIMD acceleration function provided using processor is not provided when data are restored.
Summary of the invention
In view of the above problems, the problem to be solved in the present invention is to provide a kind of, and the RAID6 data based on platform of soaring are restoredOptimization method, by the NEON technology supported using processing of soaring, the single byte of data before changing restores processing mode, realizesRestore multiple byte verification data within a cpu instruction period, reaches and RAID6 data is accelerated to restore.
In order to solve the above technical problems, the technical solution adopted by the present invention is that: the RAID6 data based on platform of soaring are restoredOptimization method, comprising the following steps:
S1: the access of single multibyte is carried out using NEON register;
S2: it carries out restoring factor conversion;
S3: the double odd-even check of single multibyte is carried out;
S4: the data storage restored.
Further, step S1 the following steps are included:
S11: multibyte data is loaded to register variable A from the first damage data field;
S12: the value of register variable A copies to register variable B.
Further, the recovery factor is converted to pseudo- Galois Field multiplication table being converted into Galois Field multiplication in step S2Table, specifically includes the following steps:
S21: target under Galois Field multiplication table high four and low four are calculated separately;
S22: by multiple low list items of pseudo- Galois Field multiplication table and multiple high list items be loaded into respectively register variable C andRegister variable D;
S23: carrying out pseudo- Galois Field multiplication table and Galois Field multiplication table is converted;
Further, step S21 the following steps are included:
S211: first moving to right 4 by channel for register variable B, then each channel and 0x0f is allowed to carry out and operation;
S212: by each channel of register variable A and 0x0f is carried out and operation;
Further, the number and NEON of the low list item of the pseudo- Galois Field multiplication table in step S22 and high list item are depositedDevice port number is consistent;
Further, step S23 the following steps are included:
S231: it using the value in each channel of register variable A as the channel index value of register variable C, replaces with and postsThe value of storage variable C corresponding channel;
S232: it using the value in each channel of register variable B as the channel index value of register variable D, replaces with and postsThe value of storage variables D corresponding channel.
Further, step S3 the following steps are included:
S31: allowing register variable A and register variable B to carry out XOR operation by channel, and operation result is saved in registerVariables A;
S32: multiple byte datas are loaded to multiple channels of register variable B from the second corrupted data area;
S33: allowing register variable A and register variable B to carry out XOR operation by channel, and operation result is saved in registerVariable B.
Further, step S4 the following steps are included:
S41: being stored to the first corrupted data area for the value of register variable A, the number after restoring as the first corrupted data areaAccording to;
S42: being stored to the second corrupted data area for the value of register variable B, the number after restoring as the second corrupted data areaAccording to.
Further, the number of channels of ENON register is 16.
Further, pseudo- Galois Field multiplication table is converted into Galois Field multiplication table in step S2, pseudo- galois fieldThe list item of the list item of multiplication table and Galois Field multiplication table corresponds, there are following mathematical relationship,
For any one element qfmul [a] in Galois Field multiplication table gfmul,
Qfmul [a]=vgfmulL [low4 (a)] ^vgfmulH [hig4 (a)];
Wherein, subscript a is the natural number between 0 to 256, and vgfmulL [] indicates low the 16 of pseudo- Galois Field multiplication list itemByte, vgfmulH [] indicate high 16 byte of pseudo- Galois Field multiplication list item, and hig4 (a) indicates 4 high, the low4 of subscript a(a) indicate that subscript a is 4 low.
The advantages and positive effects of the present invention are:
(1) the design and implementation autonomous Design of accelerating algorithm, autonomous controllability are strong;
(2) originality of implementation makes full use of the NEON characteristic and RAID6 Galois Field multiplication table of Feiteng processorBetween mathematical relationship come realize data restore concurrency;
(3) it realizes that effect is obvious, the single byte processing broadening before optimization is handled for 16 bytes after optimization, substantiallyIt saves RAID6 data and restores the cpu instruction period occupied.
Specific embodiment
The present invention is further illustrated in the following with reference to the drawings and specific embodiments.
Fig. 2 shows the flow charts of the data recovery and optimization method of one embodiment of the invention, this implementation has been shown in particularThe logic flow of the data recovery and optimization method of example, it is excellent that the present embodiment is related to a kind of RAID6 data recovery based on platform of soaringChange method, by the NEON technology supported using processing of soaring, the single byte of data before changing restores processing mode, realizesRestore multiple bytes in one cpu instruction period and verify data, to reaching the mesh for accelerating RAID6 data to restore, utilizeNEON register carries out the access of single multibyte, and carries out double odd even inspection according to the recovery factor of the multiple bytes of single operationIt tests, carries out data recovery.
As shown in Figure 1, Fig. 1 shows the process that the RAID6 recovery algorithms soared on platform restore low-quality disk, RAID6 is usedDouble odd-even check ensures the safeties of data, and first is the inspection done using exclusive or (XOR) algorithm again, and second examines again and makeGalois Field multiplication is used.Therefore, specific second order Galois Field multiplication has been arrived in RAID6 use when doing data recoveryThe element definition of table (gfmul), this second order Galois Field multiplication table is 8 arrays without symbol shaping, every time to Biao NeichaLooking for or read data must all be carried out by single byte.Based on this reason, in the prior art, a byte data can only be handled every time,The band of RAID6 is 4KB to be defaulted as under platform of soaring, therefore extensive for the data of a band as unit of page sizeIt is multiple, need to repeat 4096 operations, this will consume a large amount of cpu instruction period.
Complete set column processor of soaring all is 64, and register supports the operand of 64 bit wides, along with the branch to NEONIt holds, can widen to 128 positional operands.But since the element of Galois Field multiplication table is the shape data of individual character pitch width, limitationWe can only be accessed by single byte size, and reason is that exclusive or when 128 the first heavy exclusive or algorithm checks calculatesAny 16 elements in corresponding Galois Field multiplication table can not be determined later, even if which 16 element knows is, if they are notIt continuously also cannot disposably load calculating.But due to, RAID6 provides a second order puppet Galois Field multiplication table (vgfmul),Its list item and the list item of Galois Field multiplication table correspond, and there are following mathematical relationships:
For any one element qfmul [a] in gfmul,
Qfmul [a]=vgfmulL [low4 (a)] ^vgfmulH [hig4 (a)];
Wherein subscript a is the natural number between 0 to 256, and low 16 byte of pseudo- Galois Field multiplication list item is with vgfmulL []It indicating, high 16 byte of pseudo- Galois Field multiplication list item is indicated with vgfmulH [], and high 4 of subscript a are indicated with hig4 (a),Low 4 are indicated with low4 (a).This conversion process by pseudo- Galois Field multiplication table to Galois Field multiplication table is suitble to NEON skillArt carries out parallel processing to it.This transformational relation is that RAID6 data restore the basis that NEON can be used to be accelerated, RAID6It has no idea in data recovery process the list item for disposably operating multiple Galois Field multiplication tables, it can be with the multiple puppets of single operationThe list item of Galois Field multiplication table, by the list item for obtaining multiple Galois Field multiplication tables after calculating indirectly.
As shown in Fig. 2, should be ensured based on the RAID6 data recovery and optimization method for platform of soaring using double odd-even checkThe safety of data carries out RAID6 data recovery and optimization side using the access of single multibyte and the calculating of single multibyteMethod.
RAID6 data recovery and optimization method based on platform of soaring, comprising the following steps:
S1: carrying out the access of single multibyte using NEON register, specifically, defines NEON register A and NEON depositDevice B, and the storage of single multibyte is successively carried out, include the following steps,
S11: multibyte data is loaded to register variable A from the first damage data field, defines 128 of 16 channelsNEON register variable A, each channel are 8, i.e. then NEON instruction can be added with byte-oriented operation from the first damage data field16 byte datas are carried to 16 channels of register variable A, the multibyte of the first damage data field is to utilize not damage hereData field and check field first damage data field with second damage data field be first damage data field it is calculated portion inBetween data;
S12: the value of register variable A copies to register variable B, defines the 128 bit register variables in 16 channelsB, each channel are 8, and the value copy of register variable A is a to B.
S2: it carries out restoring factor conversion, which, which is converted to, is converted into pseudo- galois field for Galois Field multiplication tableMultiplication table, according to the mathematical relationship between pseudo- Galois Field multiplication table (vgfmul) and Galois Field multiplication table (gfmul)
Qfmul [a]=vgfmulL [low4 (a)] ^vgfmulH [hig4 (a)] is converted, specifically includes the following steps:
S21: target is four and the 4th high under calculating Galois Field multiplication table, specific steps are as follows:
S211: first moving to right 4 by channel for register variable B, then each channel and 0x0f is allowed to carry out and operation, last everyA channel is actually to remain target Gao Siwei under Galois Field multiplication table;
S212: by each channel of register variable A and 0x0f is carried out and operation, and last each channel is actually to retainTarget is four low under Galois Field multiplication table;
S22: two 16 channel, 128 bit register variable C and register variable D are defined, by the multiple low of pseudo- galois fieldList item and multiple high list items are loaded into register variable C and register variable D respectively, here the low table of pseudo- Galois Field multiplication tableThe number of Xiang Yugao list item is consistent with NEON port number, i.e., the low list item number of the puppet Galois Field multiplication table is 16, shouldThe number of the high list item of pseudo- Galois Field multiplication table is 16.
S23: carrying out pseudo- Galois Field multiplication table and converted with Galois Field multiplication table, specifically include following steps,
S231: using the value in each channel of above-mentioned register variable A as the channel index value of register variable C, andReplace with the value of register variable C corresponding channel;
S232: using the value in each channel of above-mentioned register variable B as the channel index value of register variable D, andReplace with the value of register variable D corresponding channel.
S3: carrying out the double odd-even check of single multibyte, and detailed process includes the following steps,
S31: it allows register variable A and register variable B to carry out XOR operation by channel, and operation result is saved in and is postedStorage variables A;
S32: multiple byte datas are loaded to multiple channels of register variable B from the second corrupted data area, are deposited hereThe number of channels of device variable B is 16 channels;
S33: allowing register variable A and register variable B to carry out XOR operation by channel, and operation result is saved in registerVariable B.
S4: carrying out restoring data storage, specifically includes the following steps:
S41: being stored to the first corrupted data area for the value of register variable A, the number after restoring as the first corrupted data areaAccording to;
S42: being stored to the second corrupted data area for the value of register variable B, the number after restoring as the second corrupted data areaAccording to.
The above-mentioned RAID6 data recovery and optimization method based on platform of soaring using pseudo- Galois Field multiplication table as restore becauseSon can handle 16 byte datas by the NEON register single of broadening, save many instruction cycles.
Data field is located at two low-quality disks below and the first weight check field is specifically described, for other low-quality disksForm, such as two low-quality disks are all located at data field, restore that principle is similar, be all using RAID6 double even-odd check intoRow calculates.
Data are to store on RAID6 array by the form of band, need to confirm that low-quality disk is located at before restoring dataThe specific location of band.Assuming that current band, there are two low-quality disk, first is located at data field, it is denoted as D, second is located at the first weightCheck field is denoted as P, and RAID6 can be D using unspoiled data field and Q check field according to checking algorithm before restoring D and PA intermediate data is calculated with P, is denoted as VD and VP, for convenience of stating, the second weight check field is denoted as Q herein.
The RAID6 data recovery and optimization method based on platform of soaring, when carrying out data recovery, comprising the following steps:
Step S1: defining 128 NEON register variable A in 16 channels, and each channel is 8, i.e. NEON instruction16 byte datas then can be loaded to 16 channels of register variable A from VD with byte-oriented operation.
Step S2: the 128 bit register variable B in 16 channels are defined, each channel is 8, by register variable A'sValue copy is a to arrive register variable B.
Step S3: first moving to right 4 by channel for register variable B, then each channel and 0x0f is allowed transport with (and)It calculates, last each channel is actually to remain target Gao Siwei under Galois Field multiplication table.
Step S4: each channel of register variable A and 0x0f are carried out and (and) operation, last each channel realityOn be retain Galois Field multiplication table under target it is four low.
Step S5: two 16 channel, 128 bit register variable C and register variable D are defined, by pseudo- Galois Field multiplication tableLow 16 list items and high 16 list items be loaded into register variable C and register variable D respectively.
Step S6: allowing each channel of register variable A using the value in channel as the channel index value of register variable C,Then the value of register variable C corresponding channel is replaced with.
Step S7: allowing each channel of register variable B using the value in channel as the channel index value of register variable D,Then the value of register variable D corresponding channel is replaced with.
Step S8: register variable A and register variable B is allowed to carry out XOR operation by channel, operation result, which is saved in, to be postedStorage variables A.
Step S9: 16 byte datas are loaded to 16 channels of register variable B from P.
Step S10: register variable A and register variable B is allowed to carry out XOR operation by channel, operation result, which is saved in, to be postedStorage variable B.
Step S11: being stored to D for the value of register variable A, the data after restoring as data field.
Step S12: being stored to P for the value of register variable B, the data after restoring as the first weight check field.
The advantages and positive effects of the present invention are: the design and implementation autonomous Design of accelerating algorithm, autonomous controllabilityBy force;The originality of implementation makes full use of the number between the NEON characteristic of Feiteng processor and RAID6 Galois Field multiplication tableRelationship come realize data restore concurrency;It realizes that effect is obvious, is optimization by the single byte processing broadening before optimization16 bytes processing afterwards substantially saves RAID6 data and restores the cpu instruction period occupied.
One embodiment of the present invention has been described in detail above, but the content is only preferable implementation of the inventionExample, should not be considered as limiting the scope of the invention.It is all according to all the changes and improvements made by the present patent application rangeDeng should still be within the scope of the patent of the present invention.