Skip to content

Commit

Permalink
xen/blkback: don't use xen_blkif_get() in xen-blkback kthread
Browse files Browse the repository at this point in the history
There is no need to use xen_blkif_get()/xen_blkif_put() in the kthread
of xen-blkback. Thread stopping is synchronous and using the blkif
reference counting in the kthread will avoid to ever let the reference
count drop to zero at the end of an I/O running concurrent to
disconnecting and multiple rings.

Setting ring->xenblkd to NULL after stopping the kthread isn't needed
as the kthread does this already.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Steven Haigh <netwiz@crc.id.au>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Juergen Gross authored and Konrad Rzeszutek Wilk committed Jun 13, 2017
1 parent 71df1d7 commit a24fa22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions drivers/block/xen-blkback/blkback.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,6 @@ int xen_blkif_schedule(void *arg)
unsigned long timeout;
int ret;

xen_blkif_get(blkif);

set_freezable();
while (!kthread_should_stop()) {
if (try_to_freeze())
Expand Down Expand Up @@ -665,7 +663,6 @@ int xen_blkif_schedule(void *arg)
print_stats(ring);

ring->xenblkd = NULL;
xen_blkif_put(blkif);

return 0;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/block/xen-blkback/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
if (ring->xenblkd) {
kthread_stop(ring->xenblkd);
wake_up(&ring->shutdown_wq);
ring->xenblkd = NULL;
}

/* The above kthread_stop() guarantees that at this point we
Expand Down

0 comments on commit a24fa22

Please sign in to comment.