summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAsias He <asias@redhat.com>2012-05-25 08:03:27 (GMT)
committerRusty Russell <rusty@rustcorp.com.au>2012-07-30 04:00:51 (GMT)
commit2c95a3290919541b846bee3e0fbaa75860929f53 (patch)
tree749fca56cbcce3770871c6202567cfcc0903c67a /include
parent483001c765af6892b3fc3726576cb42f17d1d6b5 (diff)
downloadlinux-fsl-qoriq-2c95a3290919541b846bee3e0fbaa75860929f53.tar.xz
virtio-blk: Use block layer provided spinlock
Block layer will allocate a spinlock for the queue if the driver does not provide one in blk_init_queue(). The reason to use the internal spinlock is that blk_cleanup_queue() will switch to use the internal spinlock in the cleanup code path. if (q->queue_lock != &q->__queue_lock) q->queue_lock = &q->__queue_lock; However, processes which are in D state might have taken the driver provided spinlock, when the processes wake up, they would release the block provided spinlock. ===================================== [ BUG: bad unlock balance detected! ] 3.4.0-rc7+ #238 Not tainted ------------------------------------- fio/3587 is trying to release lock (&(&q->__queue_lock)->rlock) at: [<ffffffff813274d2>] blk_queue_bio+0x2a2/0x380 but there are no more locks to release! other info that might help us debug this: 1 lock held by fio/3587: #0: (&(&vblk->lock)->rlock){......}, at: [<ffffffff8132661a>] get_request_wait+0x19a/0x250 Other drivers use block layer provided spinlock as well, e.g. SCSI. Switching to the block layer provided spinlock saves a bit of memory and does not increase lock contention. Performance test shows no real difference is observed before and after this patch. Changes in v2: Improve commit log as Michael suggested. Cc: virtualization@lists.linux-foundation.org Cc: kvm@vger.kernel.org Cc: stable@kernel.org Signed-off-by: Asias He <asias@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions