Skip to content

Batch io#177

Merged
ming1 merged 2 commits intomasterfrom
batch-io
Mar 18, 2026
Merged

Batch io#177
ming1 merged 2 commits intomasterfrom
batch-io

Conversation

@ming1
Copy link
Copy Markdown
Collaborator

@ming1 ming1 commented Feb 1, 2026

  • support UBLK_F_BATCH_IO feature

@ming1 ming1 force-pushed the batch-io branch 2 times, most recently from 5ebd1df to 9738ca0 Compare February 12, 2026 13:40
ming1 added 2 commits March 3, 2026 14:37
Add support for batch IO mode which uses batch-based operations instead
of per-tag FETCH/COMMIT_AND_FETCH:

- UBLK_U_IO_PREP_IO_CMDS: One-time prep with buffer info
- UBLK_U_IO_FETCH_IO_CMDS: Multishot fetch returning 2-byte tags
- UBLK_U_IO_COMMIT_IO_CMDS: Batch commit of completed IOs

Key implementation details:

- Add batch structures (ublk_batch_elem, batch_commit_buf, batch_fetch_buf)
- Extend _ublksrv_queue with batch IO fields for double-buffered fetch
  and commit operations
- Implement io_uring buffer rings for multishot fetch commands
- Add UBLKSRV_QUEUE_BATCH_IO queue state flag
- Handle multishot command completion correctly: only decrement
  cmd_inflight when command truly ends (no IORING_CQE_F_MORE or error)

The batch mode is transparent to targets - ublksrv_complete_io() routes
internally to batch commit buffers when UBLK_F_BATCH_IO is set.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Add command line option to enable UBLK_F_BATCH_IO mode:

- Add -b short option and --batch-io long option
- Check kernel feature support before enabling
- Update help text to document the new option

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
@ming1 ming1 merged commit acb06e9 into master Mar 18, 2026
1 check passed
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