Re: [PATCH v1] virtio_blk: fix race between start and stop queue

2014-05-16 Thread Jens Axboe
On 2014-05-16 09:43, Ming Lei wrote: On Fri, May 16, 2014 at 11:32 PM, Jens Axboe wrote: On 2014-05-16 09:31, Ming Lei wrote: When there isn't enough vring descriptor for adding to vq, blk-mq will be put as stopped state until some of pending descriptors are completed & freed. Unfortunately,

Re: [PATCH v1] virtio_blk: fix race between start and stop queue

2014-05-16 Thread Ming Lei
On Fri, May 16, 2014 at 11:32 PM, Jens Axboe wrote: > On 2014-05-16 09:31, Ming Lei wrote: >> >> When there isn't enough vring descriptor for adding to vq, >> blk-mq will be put as stopped state until some of pending >> descriptors are completed & freed. >> >> Unfortunately, the vq's interrupt may

[PATCH v1] virtio_blk: fix race between start and stop queue

2014-05-16 Thread Ming Lei
When there isn't enough vring descriptor for adding to vq, blk-mq will be put as stopped state until some of pending descriptors are completed & freed. Unfortunately, the vq's interrupt may come just before blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq will still be kept as stopped even tho

Re: [PATCH v1] virtio_blk: fix race between start and stop queue

2014-05-16 Thread Jens Axboe
On 2014-05-16 09:31, Ming Lei wrote: When there isn't enough vring descriptor for adding to vq, blk-mq will be put as stopped state until some of pending descriptors are completed & freed. Unfortunately, the vq's interrupt may come just before blk-mq's BLK_MQ_S_STOPPED flag is set, so the blk-mq