[PATCH] Xen block fixes, secure discard, and barrier support for 3.2 (v1)

October 10th, 2011 - 11:30 am ET by Konrad Rzeszutek Wilk | Report spam
[PATCH 1/3] xen/blkback: Support 'feature-barrier' aka old-style

The BARRIER support is done by:
1) setting the drain value to one and waiting for the 'complete waitqueue' to be
complete. We also double-check the kthread status in case the interface is being
disconnected. Waiting means stalling processing of the queue.
2) By latching on the refcnt value which is incremented every time a 'struct request'
is used for a particular interface we can figure out outstanding I/Os.
The refcnt is decremented when all the bio's that were generated for the
'struct request' have been processed. When we detect that all outstanding
'struct request' and their bio's have been completed we notify the
'complete waitqueue' which halted processing of the ring.
3) When the 'complete waitqueue' is signaled, it submits a WRITE_FLUSH
operation.

That should take care of emulating the drain behavior properly. When I ran with SLES11
guests using the ext3/reiserfs using the 'fio tiobench-example;fio fsx' they ran fine.
Also killing the guest during runtime and then restarting showed no corruption.
If there are some better tests to check for proper operation of this - please advise.

[PATCH 2/3] xen/blkback: Fix the inhibition to map pages when

Obvious bugfix in the 'feature-discard' patchset.

[PATCH 3/3] xen/blk[front|back]: Enhance discard support with secure

We also provide the REQ_SECURE support to allow the user to now issue:
'blkdev_issue_discard(.., secure)' flag.

[NOTE: My SSD died on my - so I can't test this yet - going through the process
of RMA-ing it, so please consider the 3/3 patch more as an RFC as it has not been tested].

Please review.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
email Follow the discussionReplies 27 repliesReplies Make a reply

Replies

#1 Konrad Rzeszutek Wilk
October 10th, 2011 - 11:30 am ET | Report spam
The 'operation' parameters are the ones provided to the bio layer while
the req->operation are the ones passed in between the backend and
frontend. We used the wrong 'operation' value to squash the
call to map pages when processing the discard operation resulting
in mapping the pages unnecessarily.

CC: Li Dongyang
Signed-off-by: Konrad Rzeszutek Wilk

drivers/block/xen-blkback/blkback.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 184b133..3da9a40 100644
a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -707,7 +707,7 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
* the hypercall to unmap the grants - that is all done in
* xen_blkbk_unmap.
*/
- if (operation != BLKIF_OP_DISCARD &&
+ if (operation != REQ_DISCARD &&
xen_blkbk_map(req, pending_req, seg))
goto fail_flush;

1.7.5.4

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Similar topics