mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 13:20:28 -05:00
Document streaming parameter as a strict 0 or 1 value
This commit is contained in:
parent
de00981504
commit
bfe5ee7643
5 changed files with 12 additions and 10 deletions
|
|
@ -160,11 +160,11 @@ MOVNT / non-temporal stores vs cached generation
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
* raid_gen(..., streaming) allows the caller to select between non-temporal
|
* raid_gen(..., streaming) allows the caller to select between non-temporal
|
||||||
streaming stores (streaming != 0, using MOVNTDQ/VMOVNTDQ + sfence on x86) and
|
streaming stores (streaming == 1, using MOVNTDQ/VMOVNTDQ + sfence on x86) and
|
||||||
normal temporal/cached stores (streaming == 0, using MOVDQA/VMOVDQA without sfence).
|
normal temporal/cached stores (streaming == 0, using MOVDQA/VMOVDQA without sfence).
|
||||||
|
|
||||||
* Generation backends select MOVNTDQ / VMOVNTDQ for parity output when
|
* Generation backends select MOVNTDQ / VMOVNTDQ for parity output when
|
||||||
streaming != 0 is requested.
|
streaming == 1 is requested. Values other than 0 and 1 are invalid.
|
||||||
|
|
||||||
* The synthetic speedtest naturally favors non-temporal stores because generated
|
* The synthetic speedtest naturally favors non-temporal stores because generated
|
||||||
parity is not consumed afterwards. This benchmark therefore measures producer
|
parity is not consumed afterwards. This benchmark therefore measures producer
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ library startup before normal RAID operations.
|
||||||
Computes 'np' parity blocks from 'nd' data blocks. Vector 'v' contains
|
Computes 'np' parity blocks from 'nd' data blocks. Vector 'v' contains
|
||||||
'nd + np' block pointers (data blocks v[0..nd-1], parity blocks
|
'nd + np' block pointers (data blocks v[0..nd-1], parity blocks
|
||||||
v[nd..nd+np-1]). Each block must be aligned to a 64-byte boundary.
|
v[nd..nd+np-1]). Each block must be aligned to a 64-byte boundary.
|
||||||
Data blocks are read-only; parity blocks are written. If 'streaming' is
|
Data blocks are read-only; parity blocks are written. 'streaming' must be
|
||||||
non-zero, non-temporal streaming stores are used where supported to avoid
|
either 0 or 1. If it is 1, non-temporal streaming stores are used where
|
||||||
polluting the CPU cache when parity is written directly to disk. If
|
supported to avoid polluting the CPU cache when parity is written directly
|
||||||
'streaming' is zero, normal cached stores are used.
|
to disk. If it is 0, normal cached stores are used.
|
||||||
|
|
||||||
void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v)
|
void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v)
|
||||||
Recovers 'nr' failed blocks (data or parity) listed in sorted index array
|
Recovers 'nr' failed blocks (data or parity) listed in sorted index array
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,8 @@ void raid_rec6_neon32(int nr, int *id, int *ip, int nd, size_t size, void **vv);
|
||||||
* It has (@nd + #parities) elements. The starting elements are the blocks
|
* It has (@nd + #parities) elements. The starting elements are the blocks
|
||||||
* for data, following with the parity blocks.
|
* for data, following with the parity blocks.
|
||||||
* Each block has @size bytes.
|
* Each block has @size bytes.
|
||||||
* @streaming Nonzero for streaming/non-temporal stores where supported, 0 for cached stores.
|
* @streaming 1 for streaming/non-temporal stores where supported, 0 for cached stores.
|
||||||
|
* No other values are valid.
|
||||||
*/
|
*/
|
||||||
typedef void (raid_gen_fn)(int nd, size_t size, void **vv, int streaming);
|
typedef void (raid_gen_fn)(int nd, size_t size, void **vv, int streaming);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ void raid_gen(int nd, int np, size_t size, void **v, int streaming)
|
||||||
/* enforce valid vector */
|
/* enforce valid vector */
|
||||||
BUG_ON(v == 0);
|
BUG_ON(v == 0);
|
||||||
|
|
||||||
/* enforce valid streaming flag */
|
/* enforce the documented 0/1 store policy */
|
||||||
BUG_ON(streaming != 0 && streaming != 1);
|
BUG_ON(streaming != 0 && streaming != 1);
|
||||||
|
|
||||||
BUG_ON(raid_gen_ptr[np - 1] == 0);
|
BUG_ON(raid_gen_ptr[np - 1] == 0);
|
||||||
|
|
|
||||||
|
|
@ -200,9 +200,10 @@ int raid_selftest(void);
|
||||||
* data, following with the parity blocks.
|
* data, following with the parity blocks.
|
||||||
* Data entries are used as inputs and parity entries as outputs.
|
* Data entries are used as inputs and parity entries as outputs.
|
||||||
* Entries may point to the same block buffer.
|
* Entries may point to the same block buffer.
|
||||||
* @streaming Store policy hint: nonzero for streaming / non-temporal stores
|
* @streaming Store policy hint: 1 for streaming / non-temporal stores
|
||||||
* (bypassing cache) where supported, or 0 for normal cached / temporal stores.
|
* (bypassing cache) where supported, or 0 for normal cached / temporal stores.
|
||||||
* Use nonzero when generated output will not be read immediately by the CPU
|
* No other values are valid.
|
||||||
|
* Use 1 when generated output will not be read immediately by the CPU
|
||||||
* (e.g., parity queued for disk writes during sync), avoiding cache pollution.
|
* (e.g., parity queued for disk writes during sync), avoiding cache pollution.
|
||||||
* Use 0 when output will be consumed immediately by the CPU (e.g., in-memory
|
* Use 0 when output will be consumed immediately by the CPU (e.g., in-memory
|
||||||
* parity verification or single-disk data recovery).
|
* parity verification or single-disk data recovery).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue