1. 30 5月, 2014 1 次提交
    • M
      block: virtio_blk: don't hold spin lock during world switch · e8edca6f
      Ming Lei 提交于
      Firstly, it isn't necessary to hold lock of vblk->vq_lock
      when notifying hypervisor about queued I/O.
      
      Secondly, virtqueue_notify() will cause world switch and
      it may take long time on some hypervisors(such as, qemu-arm),
      so it isn't good to hold the lock and block other vCPUs.
      
      On arm64 quad core VM(qemu-kvm), the patch can increase I/O
      performance a lot with VIRTIO_RING_F_EVENT_IDX enabled:
      	- without the patch: 14K IOPS
      	- with the patch: 34K IOPS
      
      fio script:
      	[global]
      	direct=1
      	bsrange=4k-4k
      	timeout=10
      	numjobs=4
      	ioengine=libaio
      	iodepth=64
      
      	filename=/dev/vdc
      	group_reporting=1
      
      	[f1]
      	rw=randread
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: virtualization@lists.linux-foundation.org
      Signed-off-by: NMing Lei <ming.lei@canonical.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: stable@kernel.org # 3.13+
      Signed-off-by: NJens Axboe <axboe@fb.com>
      e8edca6f
  2. 29 5月, 2014 4 次提交
    • V
      xen-blkback: defer freeing blkif to avoid blocking xenwatch · 814d04e7
      Valentin Priescu 提交于
      Currently xenwatch blocks in VBD disconnect, waiting for all pending I/O
      requests to finish. If the VBD is attached to a hot-swappable disk, then
      xenwatch can hang for a long period of time, stalling other watches.
      
       INFO: task xenwatch:39 blocked for more than 120 seconds.
       "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
       ffff880057f01bd0 0000000000000246 ffff880057f01ac0 ffffffff810b0782
       ffff880057f01ad0 00000000000131c0 0000000000000004 ffff880057edb040
       ffff8800344c6080 0000000000000000 ffff880058c00ba0 ffff880057edb040
       Call Trace:
       [<ffffffff810b0782>] ? irq_to_desc+0x12/0x20
       [<ffffffff8128f761>] ? list_del+0x11/0x40
       [<ffffffff8147a080>] ? wait_for_common+0x60/0x160
       [<ffffffff8147bcef>] ? _raw_spin_lock_irqsave+0x2f/0x50
       [<ffffffff8147bd49>] ? _raw_spin_unlock_irqrestore+0x19/0x20
       [<ffffffff8147a26a>] schedule+0x3a/0x60
       [<ffffffffa018fe6a>] xen_blkif_disconnect+0x8a/0x100 [xen_blkback]
       [<ffffffff81079f70>] ? wake_up_bit+0x40/0x40
       [<ffffffffa018ffce>] xen_blkbk_remove+0xae/0x1e0 [xen_blkback]
       [<ffffffff8130b254>] xenbus_dev_remove+0x44/0x90
       [<ffffffff81345cb7>] __device_release_driver+0x77/0xd0
       [<ffffffff81346488>] device_release_driver+0x28/0x40
       [<ffffffff813456e8>] bus_remove_device+0x78/0xe0
       [<ffffffff81342c9f>] device_del+0x12f/0x1a0
       [<ffffffff81342d2d>] device_unregister+0x1d/0x60
       [<ffffffffa0190826>] frontend_changed+0xa6/0x4d0 [xen_blkback]
       [<ffffffffa019c252>] ? frontend_changed+0x192/0x650 [xen_netback]
       [<ffffffff8130ae50>] ? cmp_dev+0x60/0x60
       [<ffffffff81344fe4>] ? bus_for_each_dev+0x94/0xa0
       [<ffffffff8130b06e>] xenbus_otherend_changed+0xbe/0x120
       [<ffffffff8130b4cb>] frontend_changed+0xb/0x10
       [<ffffffff81309c82>] xenwatch_thread+0xf2/0x130
       [<ffffffff81079f70>] ? wake_up_bit+0x40/0x40
       [<ffffffff81309b90>] ? xenbus_directory+0x80/0x80
       [<ffffffff810799d6>] kthread+0x96/0xa0
       [<ffffffff81485934>] kernel_thread_helper+0x4/0x10
       [<ffffffff814839f3>] ? int_ret_from_sys_call+0x7/0x1b
       [<ffffffff8147c17c>] ? retint_restore_args+0x5/0x6
       [<ffffffff81485930>] ? gs_change+0x13/0x13
      
      With this patch, when there is still pending I/O, the actual disconnect
      is done by the last reference holder (last pending I/O request). In this
      case, xenwatch doesn't block indefinitely.
      Signed-off-by: NValentin Priescu <priescuv@amazon.com>
      Reviewed-by: NSteven Kady <stevkady@amazon.com>
      Reviewed-by: NSteven Noonan <snoonan@amazon.com>
      Reviewed-by: NDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      814d04e7
    • O
      xen/blkback: disable discard feature if requested by toolstack · c926b701
      Olaf Hering 提交于
      Newer toolstacks may provide a boolean property "discard-enable" in the
      backend node. Its purpose is to disable discard for file backed storage
      to avoid fragmentation. Recognize this setting also for physical
      storage.  If that property exists and is false, do not advertise
      "feature-discard" to the frontend.
      Signed-off-by: NOlaf Hering <olaf@aepfle.de>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      c926b701
    • O
      xen-blkfront: remove type check from blkfront_setup_discard · 1c8cad6c
      Olaf Hering 提交于
      In its initial implementation a check for "type" was added, but only phy
      and file are handled. This breaks advertised discard support for other
      type values such as qdisk.
      
      Fix and simplify this function: If the backend advertises discard
      support it is supposed to implement it properly, so enable
      feature_discard unconditionally. If the backend advertises the need for
      a certain granularity and alignment then propagate both properties to
      the blocklayer. The discard-secure property is a boolean, update the code
      to reflect that.
      Signed-off-by: NOlaf Hering <olaf@aepfle.de>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      1c8cad6c
    • C
      blk-mq: remove alloc_hctx and free_hctx methods · cdef54dd
      Christoph Hellwig 提交于
      There is no need for drivers to control hardware context allocation
      now that we do the context to node mapping in common code.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      cdef54dd
  3. 28 5月, 2014 2 次提交
    • J
      floppy: do not corrupt bio.bi_flags when reading block 0 · 6314a108
      Jiri Kosina 提交于
      Commit 41a55b4d ("floppy: silence warning during disk test") caused
      bio.bi_flags being overwritten, and its initialization to BIO_UPTODATE
      in bio_init() to be lost.
      
      This was unnoticed until 7b7b68bb ("floppy: bail out in open() if
      drive is not responding to block0 read"), because the error value wasn't
      checked for in the bio completion callback.
      
      Now we are actually looking at the error, and the loss of BIO_UPTODATE
      causes EIO to be wrongly passed to the callback, which confuses the
      FD_OPEN_SHOULD_FAIL_BIT logic.
      
      Fix this by not destroying previous value of bi_flags when setting
      BIO_QUIET.
      
      Cc: Stephen Hemminger <shemminger@vyatta.com>
      Reported-by: NTakashi Iwai <tiwai@suse.de>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      6314a108
    • J
      blk-mq: pass in suggested NUMA node to ->alloc_hctx() · f14bbe77
      Jens Axboe 提交于
      Drivers currently have to figure this out on their own, and they
      are missing information to do it properly. The ones that did
      attempt to do it, do it wrong.
      
      So just pass in the suggested node directly to the alloc
      function.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f14bbe77
  4. 21 5月, 2014 1 次提交
  5. 16 5月, 2014 1 次提交
    • M
      virtio_blk: fix race between start and stop queue · 0c29e93e
      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 though lots of descriptors
      are completed and freed in the interrupt handler. The worst
      case is that all pending descriptors are freed in the
      interrupt handler, and the queue is kept as stopped forever.
      
      This patch fixes the problem by starting/stopping blk-mq
      with holding vq_lock.
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0c29e93e
  6. 14 5月, 2014 3 次提交
  7. 06 5月, 2014 12 次提交
  8. 01 5月, 2014 16 次提交