1. 22 10月, 2009 1 次提交
    • C
      virtio_blk: revert QUEUE_FLAG_VIRT addition · f8b12e51
      Christoph Hellwig 提交于
      It seems like the addition of QUEUE_FLAG_VIRT caueses major performance
      regressions for Fedora users:
      
      	https://bugzilla.redhat.com/show_bug.cgi?id=509383
      	https://bugzilla.redhat.com/show_bug.cgi?id=505695
      
      while I can't reproduce those extreme regressions myself I think the flag
      is wrong.
      
      Rationale:
      
        QUEUE_FLAG_VIRT expands to QUEUE_FLAG_NONROT which casus the queue
        unplugged immediately.  This is not a good behaviour for at least
        qemu and kvm where we do have significant overhead for every
        I/O operations.  Even with all the latested speeups (native AIO,
        MSI support, zero copy) we can only get native speed for up to 128kb
        I/O requests we already are down to 66% of native performance for 4kb
        requests even on my laptop running the Intel X25-M SSD for which the
        QUEUE_FLAG_NONROT was designed.
        If we ever get virtio-blk overhead low enough that this flag makes
        sense it should only be set based on a feature flag set by the host.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      f8b12e51
  2. 23 9月, 2009 3 次提交
  3. 22 9月, 2009 1 次提交
  4. 19 7月, 2009 1 次提交
    • R
      virtio_blk: mark virtio_blk with __refdata to kill spurious section mismatch · 4fbfff76
      Rakib Mullick 提交于
      The variable virtio_blk references the function virtblk_probe() (which
      is in .devinit section) and also references the function
      virtblk_remove() ( which is in .devexit section). So, virtio_blk
      simultaneously refers .devinit and .devexit section. To avoid this
      messup, we mark virtio_blk as __refdata.
      
      We were warned by the following warning:
      
        LD      drivers/block/built-in.o
        WARNING: drivers/block/built-in.o(.data+0xc8dc): Section mismatch in
        reference from the variable virtio_blk to the function
        .devinit.text:virtblk_probe()
        The variable virtio_blk references
        the function __devinit virtblk_probe()
        If the reference is valid then annotate the
        variable with __init* or __refdata (see linux/init.h) or name the variable:
        *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      
        WARNING: drivers/block/built-in.o(.data+0xc8e0): Section mismatch in
        reference from the variable virtio_blk to the function
        .devexit.text:virtblk_remove()
        The variable virtio_blk references
        the function __devexit virtblk_remove()
        If the reference is valid then annotate the
        variable with __exit* (see linux/init.h) or name the variable:
        *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console,
      Signed-off-by: NRakib Mullick <rakib.mullick@gmail.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      4fbfff76
  5. 17 7月, 2009 2 次提交
  6. 12 6月, 2009 3 次提交
  7. 09 6月, 2009 1 次提交
  8. 23 5月, 2009 1 次提交
  9. 18 5月, 2009 3 次提交
  10. 11 5月, 2009 2 次提交
    • T
      block: implement and enforce request peek/start/fetch · 9934c8c0
      Tejun Heo 提交于
      Till now block layer allowed two separate modes of request execution.
      A request is always acquired from the request queue via
      elv_next_request().  After that, drivers are free to either dequeue it
      or process it without dequeueing.  Dequeue allows elv_next_request()
      to return the next request so that multiple requests can be in flight.
      
      Executing requests without dequeueing has its merits mostly in
      allowing drivers for simpler devices which can't do sg to deal with
      segments only without considering request boundary.  However, the
      benefit this brings is dubious and declining while the cost of the API
      ambiguity is increasing.  Segment based drivers are usually for very
      old or limited devices and as converting to dequeueing model isn't
      difficult, it doesn't justify the API overhead it puts on block layer
      and its more modern users.
      
      Previous patches converted all block low level drivers to dequeueing
      model.  This patch completes the API transition by...
      
      * renaming elv_next_request() to blk_peek_request()
      
      * renaming blkdev_dequeue_request() to blk_start_request()
      
      * adding blk_fetch_request() which is combination of peek and start
      
      * disallowing completion of queued (not started) requests
      
      * applying new API to all LLDs
      
      Renamings are for consistency and to break out of tree code so that
      it's apparent that out of tree drivers need updating.
      
      [ Impact: block request issue API cleanup, no functional change ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: unsik Kim <donari75@gmail.com>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Laurent Vivier <Laurent@lvivier.info>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: Pierre Ossman <drzeus@drzeus.cx>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
      Cc: Stefan Weinhuber <wein@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      9934c8c0
    • T
      block: convert to pos and nr_sectors accessors · 83096ebf
      Tejun Heo 提交于
      With recent cleanups, there is no place where low level driver
      directly manipulates request fields.  This means that the 'hard'
      request fields always equal the !hard fields.  Convert all
      rq->sectors, nr_sectors and current_nr_sectors references to
      accessors.
      
      While at it, drop superflous blk_rq_pos() < 0 test in swim.c.
      
      [ Impact: use pos and nr_sectors accessors ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Tested-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NAdrian McMenamin <adrian@mcmen.demon.co.uk>
      Acked-by: NMike Miller <mike.miller@hp.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Cc: Borislav Petkov <petkovbb@googlemail.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Eric Moore <Eric.Moore@lsi.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Pete Zaitcev <zaitcev@redhat.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Paul Clements <paul.clements@steeleye.com>
      Cc: Tim Waugh <tim@cyberelk.net>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Dario Ballabio <ballabio_dario@emc.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: unsik Kim <donari75@gmail.com>
      Cc: Laurent Vivier <Laurent@lvivier.info>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      83096ebf
  11. 28 4月, 2009 1 次提交
    • T
      block: implement and use [__]blk_end_request_all() · 40cbbb78
      Tejun Heo 提交于
      There are many [__]blk_end_request() call sites which call it with
      full request length and expect full completion.  Many of them ensure
      that the request actually completes by doing BUG_ON() the return
      value, which is awkward and error-prone.
      
      This patch adds [__]blk_end_request_all() which takes @rq and @error
      and fully completes the request.  BUG_ON() is added to to ensure that
      this actually happens.
      
      Most conversions are simple but there are a few noteworthy ones.
      
      * cdrom/viocd: viocd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/block/dasd: dasd_end_request() replaced with direct calls to
        __blk_end_request_all().
      
      * s390/char/tape_block: tapeblock_end_request() replaced with direct
        calls to blk_end_request_all().
      
      [ Impact: cleanup ]
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Mike Miller <mike.miller@hp.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
      Cc: Alex Dubov <oakad@yahoo.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      40cbbb78
  12. 30 12月, 2008 3 次提交
  13. 29 12月, 2008 1 次提交
  14. 21 10月, 2008 3 次提交
    • A
      [PATCH] switch virtio_blk · 4e109852
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4e109852
    • A
      [PATCH] beginning of methods conversion · d4430d62
      Al Viro 提交于
      To keep the size of changesets sane we split the switch by drivers;
      to keep the damn thing bisectable we do the following:
      	1) rename the affected methods, add ones with correct
      prototypes, make (few) callers handle both.  That's this changeset.
      	2) for each driver convert to new methods.  *ALL* drivers
      are converted in this series.
      	3) kill the old (renamed) methods.
      
      Note that it _is_ a flagday; all in-tree drivers are converted and by the
      end of this series no trace of old methods remain.  The only reason why
      we do that this way is to keep the damn thing bisectable and allow per-driver
      debugging if anything goes wrong.
      
      New methods:
      	open(bdev, mode)
      	release(disk, mode)
      	ioctl(bdev, mode, cmd, arg)		/* Called without BKL */
      	compat_ioctl(bdev, mode, cmd, arg)
      	locked_ioctl(bdev, mode, cmd, arg)	/* Called with BKL, legacy */
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d4430d62
    • A
      [PATCH] switch scsi_cmd_ioctl() to passing fmode_t · 74f3c8af
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      74f3c8af
  15. 09 10月, 2008 2 次提交
  16. 25 7月, 2008 1 次提交
  17. 30 5月, 2008 2 次提交
  18. 02 5月, 2008 5 次提交
    • R
      virtio: add virtio disk geometry feature · 48e4043d
      Ryan Harper 提交于
      Rather than faking up some geometry, allow the backend to push the disk
      geometry via virtio pci config option.  Keep the old geo code around for
      compatibility.
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified to single struct)
      48e4043d
    • R
      virtio: explicit advertisement of driver features · c45a6816
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API: in particular, we assume that feature
      negotiation is complete once a driver's probe function returns.
      
      There is nothing in the API to require this, however, and even I
      didn't notice when it was violated.
      
      So instead, we require the driver to specify what features it supports
      in a table, we can then move the feature negotiation into the virtio
      core.  The intersection of device and driver features are presented in
      a new 'features' bitmap in the struct virtio_device.
      
      Note that this highlights the difference between Linux unsigned-long
      bitmaps where each unsigned long is in native endian, and a
      straight-forward little-endian array of bytes.
      
      Drivers can still remove feature bits in their probe routine if they
      really have to.
      
      API changes:
      - dev->config->feature() no longer gets and acks a feature.
      - drivers should advertise their features in the 'feature_table' field
      - use virtio_has_feature() for extra sanity when checking feature bits
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c45a6816
    • R
      virtio: change config to guest endian. · 72e61eb4
      Rusty Russell 提交于
      A recent proposed feature addition to the virtio block driver revealed
      some flaws in the API, in particular how easy it is to break big
      endian machines.
      
      The virtio config space was originally chosen to be little-endian,
      because we thought the config might be part of the PCI config space
      for virtio_pci.  It's actually a separate mmio region, so that
      argument holds little water; as only x86 is currently using the virtio
      mechanism, we can change this (but must do so now, before the
      impending s390 merge).
      
      API changes:
      - __virtio_config_val() just becomes a striaght vdev->config_get() call.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      72e61eb4
    • M
      virtio-blk: fix remove oops · 2e895e4c
      Marcelo Tosatti 提交于
      Do not unregister the major at device remove, since there might be
      another device instances around.
      
      (qemu) pci_del 0 11
      (qemu) ACPI: PCI interrupt for device 0000:00:0b.0 disabled
      (qemu) pci_del 0 10
      (qemu) ------------[ cut here ]------------
      WARNING: at block/genhd.c:126 unregister_blkdev+0x74/0x9e()
      ACPI: PCI interrupt for device 0000:00:0a.0 disabled
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      2e895e4c
    • R
      virtio: de-structify virtio_block status byte · cb38fa23
      Rusty Russell 提交于
      Ron Minnich points out that a struct containing a char is not always
      sizeof(char); simplest to remove the structure to avoid confusion.
      
      Cc: "ron minnich" <rminnich@gmail.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      cb38fa23
  19. 17 3月, 2008 1 次提交
  20. 04 2月, 2008 3 次提交