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.
Discard is enabled when the frontend sets feature-discard to 1, the discard-granularity to the device sector size, and the discard-alignment to 0. These values will be written to the xenstore.
Discard is enabled if the following conditions are true:
How tapdisk handles discard requests:
the discard request will be converted into a blkif_request_discard.
and the vbd request is queued using tapdisk_vbd_queue_request()
The portion of my patch explained above is a slightly modified version of a previous PR 1a51656. Credit goes to Rober Breker for implementing a lot of the discard request handling for tapdisk.
How the vhd block driver handles discard requests:
be equal to the block length.
deallocate the block.
I had to change the tapdisk-queue driver from using LIO to RWIO because currently linux AIO does not support discard requests. This change causes a 50% sequential write degradation. I've attempted to remedy this by using LIO when there are no discard requests on the queue and revert back to RWIO when a discard is queued. Sadly, the IO scheduler doesn't like when you mix LIO and RWIO.
Are there any other approaches I could take? Is discard request support something you guys are interested in having?