Support non-contiguous multi-extent files on the CPU/P2P read path - #11
Merged
Merged
Conversation
Rework the CPU/P2P read path to read files whose extents are not physically contiguous, instead of bailing out with ENOTSUP. For each file, coalesce physically-adjacent extents into runs and submit each run in iosize-sized commands (_submit_run), advancing the buffer pointer across runs so the file lands contiguously in memory. A tail command shorter than iosize is now handled, dropping the old divisibility requirement. This also simplifies the path: the _work/_range cooperative state machine and the per-device slbas/elbas arrays (struct fil_cpu_io) are gone. The completion callback (fil_io_cb) is now a plain reaper that tallies errors into device->io_errors, registered once per queue in _xnvme_setup rather than on every batch. _submit_device always drains the queue before returning, including on the error path, so no outstanding command is left referencing a buffer. Note: prep_time is no longer reported for CPU/P2P; extent resolution is now interleaved into submission and folded into io_time. Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
The CPU/P2P submit path computed io_nblocks = iosize / blocksize without checking that iosize is a multiple of the device LBA size, as the GPU path already does. A misconfigured iosize smaller than the LBA size yields io_nblocks == 0, hanging _submit_run and dividing by zero in _flush_run. Reject it up front with EINVAL, mirroring fil_gpu_submit. Signed-off-by: Karl Bonde Torp <k.torp@samsung.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the CPU/P2P read path so it can read files whose extents are not physically contiguous, instead of bailing out with ENOTSUP. Also hardens the path against a misconfigured iosize that previously caused a hang and a divide-by-zero.