qemu-traditional/xendisk: properly update stats in ioreq_release()
PATCH 1/1 qemu-traditional/xendisk: properly update stats in ioreq_release()
While for the "normal" case (called from blk_send_response_all()) decrementing requests_finished is correct, doing so in the parse error case is wrong; requests_inflight needs to be decremented instead.
upstream-commit: ed5477664369c1e9de23b0e7e8f16a418573bd2a
hw/xen_disk.c +8 -4
@@ -151,7 +151,7 @@ static void ioreq_finish(struct ioreq *i blkdev->requests_finished++; } -static void ioreq_release (struct ioreq *ioreq) +static void ioreq_release (struct ioreq *ioreq,bool finish) {struct XenBlkDev *blkdev = ioreq->blkdev;
@@ -159,7 +159,11 @@ static void ioreq_release(struct ioreq *memset (ioreq,0 ,sizeof (*ioreq)); ioreq->blkdev = blkdev;LIST_INSERT_HEAD (&blkdev->freelist, ioreq, list); - blkdev->requests_finished--; +if (finish) { + blkdev->requests_finished--; + }else { + blkdev->requests_inflight--; + } }/*
@@ -487,7 +491,7 @@ static void blk_send_response_all(structwhile (!LIST_EMPTY (&blkdev->finished)) { ioreq =LIST_FIRST (&blkdev->finished); send_notify +=blk_send_response_one (ioreq); -ioreq_release (ioreq); +ioreq_release (ioreq, true); }if (send_notify)xen_be_send_notify (&blkdev->xendev);
@@ -539,7 +543,7 @@ static void blk_handle_requests(struct Xif (ioreq_parse (ioreq) !=0 ) {if (blk_send_response_one (ioreq))xen_be_send_notify (&blkdev->xendev); -ioreq_release (ioreq); +ioreq_release (ioreq, false);continue ; }
qemu-traditional/xendisk: properly update stats in ioreq_release()
While for the "normal" case (called from blk_send_response_all()) decrementing requests_finished is correct, doing so in the parse error case is wrong; requests_inflight needs to be decremented instead.
upstream-commit: ed5477664369c1e9de23b0e7e8f16a418573bd2a
hw/xen_disk.c +8 -4
@@ -151,7 +151,7 @@ static void ioreq_finish(struct ioreq *i blkdev->requests_finished++; } -static void ioreq_release (struct ioreq *ioreq) +static void ioreq_release (struct ioreq *ioreq,bool finish) {struct XenBlkDev *blkdev = ioreq->blkdev;
@@ -159,7 +159,11 @@ static void ioreq_release(struct ioreq *memset (ioreq,0 ,sizeof (*ioreq)); ioreq->blkdev = blkdev;LIST_INSERT_HEAD (&blkdev->freelist, ioreq, list); - blkdev->requests_finished--; +if (finish) { + blkdev->requests_finished--; + }else { + blkdev->requests_inflight--; + } }/*
@@ -487,7 +491,7 @@ static void blk_send_response_all(structwhile (!LIST_EMPTY (&blkdev->finished)) { ioreq =LIST_FIRST (&blkdev->finished); send_notify +=blk_send_response_one (ioreq); -ioreq_release (ioreq); +ioreq_release (ioreq, true); }if (send_notify)xen_be_send_notify (&blkdev->xendev);
@@ -539,7 +543,7 @@ static void blk_handle_requests(struct Xif (ioreq_parse (ioreq) !=0 ) {if (blk_send_response_one (ioreq))xen_be_send_notify (&blkdev->xendev); -ioreq_release (ioreq); +ioreq_release (ioreq, false);continue ; }
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Jan Beulich writes ("[Xen-devel] [PATCH] qemu-traditional/xendisk: properly update stats in ioreq_release()"):
Quoted 5 lines
While for the "normal" case (called from
blk_send_response_all()) decrementingrequests_finishedis correct, doing so in the parse error case is wrong;requests_inflightneeds to be decremented instead.upstream-commit:
ed5477664369c1e9de23b0e7e8f16a418573bd2a
Thanks, committed to qemu-xen-traditional.
Ian.