Skip to content

Conversation

@minwooim
Copy link
Contributor

@minwooim minwooim commented Dec 2, 2025

See the first commit description for the background and details.

The following jobfile is an example for the multiple write job based data verification.
16 jobs are going to write[zeroes, uncor, trim] to the same area [0, 1M).

[global]                                            
ioengine=io_uring_cmd                               
cmd_type=nvme                                       
filename=/dev/ng0n1                                 
size=1M                                            
thread=1                                            
                                                    
verify=crc32                                        
verify_header_seed=0                                
norandommap                                         
                                                    
ignore_error=0x2281  # to mask uncorred (errored) offsets                                 
iodepth=64                                          
                                                    
group_reporting=1                                   
                                                    
[trim]                                              
rw=randtrim                                         
numjobs=4                                           
verify_table_id=1                                   
do_verify=1                                         
bs=4k                                               
                                                    
[uncor]                                             
rw=randwrite                                        
numjobs=4                                           
write_mode=uncor                                    
verify_table_id=1                                   
do_verify=1                                         
bs=4k                                               
                                                    
[write]                                             
rw=randwrite                                        
verify_table_id=1                                   
numjobs=4                                           
do_verify=1                                         
group_reporting=1                                   
bs=4k                                               
                                                    
[zeroes]                                            
rw=randwrite                                        
numjobs=4                                           
write_mode=zeroes                                   
verify_table_id=1                                   
do_verify=1                                         
nonvectored=0  ; to mask BAD ADDRESS error in kernel
bs=4k                                               

Background
  FIO has supported data verification integrity test based on per-job
methodology.  Each job should have its own dedicated offset area to make
sure that other jobs do not corrupt the written offsets to keep the
consistency based on the job point-of-view.  NVMe spec supports various
I/O commands causing written data pattern(e.g., zeroes) or status(e.g.,
unmap, uncor) updated.  This means that these commands should be the
candidates necessarily used for the data verification test.  It leads to
a demand for multiple jobs issuing various write-family commands to the
same area and see the *latest* snapshot of written data pattern or
status.

This patch added a new option `--verify_table_id=<n>` to represent the
verification table identifier for multiple jobs.  If one or more jobs
have the same value for this option, they will share the verification
table, which is a lock-free concurrent skiplist to keep the `ipo`, i.e.,
io pieces.  This patch does not change any functionalities for the
previous dedicated area-based data verification if `--verify_table_id=`
option is not given.  The classical data verify methodology will keep as
flist or rb-tree.

This shared verify table also considers trimmed offset by setting
`ipo->flags` with IP_F_TRIMMED and when the read phase starts, it will
be treated as it was.

Basically, fio verify job starts on the its own job context (thread or
process) each.  But, when the jobs are sharing the same verify table id,
one of the jobs will win the race and only a single job will do the
verify phase by atomic operation.

Currently this patch only supports thread-based usages (--thread=1) for
the simplicity.

Signed-off-by: Minwoo Im <[email protected]>
As TRIM does, some I/O requests can cause written data pattern(e.g.,
zeroed)  or status updated(uncor).  This patch, for example, added
support for IO_U_F_TRIMMED, IO_U_F_ZEROED, and IO_U_F_ERRORED for NVMe
commands to io_uring ioengine.

Signed-off-by: Minwoo Im <[email protected]>
For example, in io_uring_cmd with nvme cmd_type, trimmed offset might
return NVMe status code to represent the given offsets are unmapped.  In
this case, failure might be expected.  This patch added a new option
just like the other trim_verify_* series to maskd the expected error
value from the ioengine.

Signed-off-by: Minwoo Im <[email protected]>
@minwooim minwooim force-pushed the shared-verify-table-rebased branch from a3aa301 to b02ee38 Compare December 2, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant