Commit Graph
7 Commits
Author SHA1 Message Date
Ping QiuandClaude Opus 4.6 003b8c2f28 fix: require explicit build tags for io_uring backends, add implementation logging
All three io_uring backends (iceber, giouring, raw) now require explicit
build tags — no tag means standard-only. Each backend registers its name
via IOUringImpl so startup logs show compiled implementation alongside
requested/selected backend mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:19:31 -07:00
Ping QiuandClaude Opus 4.6 cd1e0afa3b feat: three io_uring backends for A/B/C benchmarking
Split iouring_linux.go into three build-tagged implementations:

1. iouring_iceber_linux.go  (-tags iouring_iceber)
   iceber/iouring-go library. Goroutine-based completion model.
   Known -72% write regression due to per-op channel overhead.

2. iouring_giouring_linux.go  (-tags iouring_giouring)
   pawelgaczynski/giouring — direct liburing port. No goroutines,
   no channels. Direct SQE/CQE ring manipulation. Kernel 6.0+.

3. iouring_raw_linux.go  (default on Linux, no tags needed)
   Raw syscall wrappers — io_uring_setup/io_uring_enter + mmap.
   Zero dependencies. ~300 LOC. Kernel 5.6+.

Build commands for benchmarking:
  go build -tags iouring_iceber  ./...   # option A
  go build -tags iouring_giouring ./...  # option B
  go build ./...                          # option C (raw, default)
  go build -tags no_iouring ./...        # disable all io_uring

All variants implement the same BatchIO interface. Cross-compile
verified for all four tag combinations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:11:39 -07:00
Ping QiuandClaude Opus 4.6 5e4baccc46 fix: use RequestSet.Requests() API for io_uring result iteration
The iceber/iouring-go SubmitRequests returns a RequestSet interface
which cannot be ranged over directly. Use resultSet.Done() to wait
for all completions, then iterate resultSet.Requests().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:13:24 -07:00
Ping QiuandClaude Opus 4.6 9d0ec8efa3 feat: tri-state IOBackend config with explicit logging and CLI flag
Replace UseIOUring bool with IOBackend IOBackendMode (tri-state):
- "standard" (default): sequential pread/pwrite/fdatasync
- "auto": try io_uring, fall back to standard with warning log
- "io_uring": require io_uring, fail startup if unavailable

NewIOUring now returns ErrIOUringUnavailable instead of silently
falling back — callers decide whether to fail or fall back based
on the requested mode. All mode transitions are logged:
  io backend: requested=auto selected=standard reason=...
  io backend: requested=io_uring selected=io_uring

CLI: --io-backend=standard|auto|io_uring added to iscsi-target.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 16:02:30 -07:00
Ping QiuandClaude Opus 4.6 66d5ba0a84 fix: BatchIO review fixes — linked SQE, ring overflow, resource leak, sync parity
1. HIGH: LinkedWriteFsync now uses SubmitLinkRequests (IOSQE_IO_LINK)
   instead of SubmitRequests, ensuring write+fdatasync execute as a
   linked chain in the kernel. Falls back to sequential on error.

2. HIGH: PreadBatch/PwriteBatch chunk ops by ring capacity to prevent
   "too many requests" rejection when dirty map exceeds ring size (256).

3. MED: CloseBatchIO() added to Flusher, called in BlockVol.Close()
   after final flush to release io_uring ring / kernel resources.

4. MED: Sync parity — both standard and io_uring paths now use
   fdatasync (via platform-specific fdatasync_linux.go / fdatasync_other.go).
   Standard path previously used fsync; now matches io_uring semantics.
   On non-Linux, fdatasync falls back to fsync (only option available).

10 batchio tests, all blockvol tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:47:03 -07:00
Ping QiuandClaude Opus 4.6 04b1827b4a feat: io_uring BatchIO implementation + UseIOUring config wiring
Add iouring_linux.go (build-tagged linux && !no_iouring) using
iceber/iouring-go for batched pread/pwrite/fdatasync. Includes
linked write+fsync chain for group commit optimization.

iouring_other.go provides silent fallback to standard on non-Linux.
blockvol.go wires UseIOUring config flag through to flusher BatchIO.
NewIOUring gracefully falls back if kernel lacks io_uring support.

10 batchio tests, all blockvol tests pass unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:19:00 -07:00
Ping QiuandClaude Opus 4.6 e55f369d66 feat: BatchIO interface for swappable flusher I/O backend
New package batchio/ with BatchIO interface (PreadBatch, PwriteBatch,
Fsync, LinkedWriteFsync) and standard sequential implementation.

Flusher refactored to use BatchIO: WAL header reads, WAL entry reads,
and extent writes are now batched through the interface. With the
default NewStandard() backend, behavior is identical to before.

UseIOUring config field added for future io_uring opt-in (Linux 5.6+).
9 interface tests, all existing blockvol tests pass unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:13:33 -07:00