All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/10] Chaining sg lists for big IO commands v2
@ 2007-05-09  7:59 Jens Axboe
  2007-05-09  7:59 ` [PATCH 1/10] crypto: don't pollute the global namespace with sg_next() Jens Axboe
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Jens Axboe @ 2007-05-09  7:59 UTC (permalink / raw)
  To: linux-kernel

Hi,

Ok, got this cleaned up and split a bit. Should be more reviewable
now. A rough overview of what this does:

Some people complain that Linux doesn't support really large IO
commands. The main reason why we do not support infinitely sized IO
is that we need to allocate a scatterlist to fill these elements
into for dma mapping. The Linux scatterlist is an array of scatterlist
elements, so we need to allocate a contig piece of memory to hold them
all. On i386, we can at most fit 256 scatterlist elements into a page,
and on x86-64 we are stuck with 128. So that puts us somewhere
between 512kb and 1024kb for a single IO.

To get around that limitation, this patchset introduces an sg
chaining concept. The way it works is that the last element of an
sg table can point to a new sgtable, thus extending the size of the
total IO scatterlist greatly.

The first parts of the patch are preparatory stuff, abstracting out
sg browsing/lookup and converting libata/SCSI/block to using those.
The latter part is enabling sg chaining on i386 and SCSI (and thus
libata as well).

The patch set defaults to being safe and doesn't enable large commands,
you must actively do so yourself. If you want to test eg sda with
large commands, you would do:

# cd /sys/block/sda/queue
# echo 1024 > max_segments
# cat max_hw_sectors_kb > max_sectors_kb

which would limit you to 1024 segments (effectively 8 scatterlists
chained), and should give you IO's of at least 4mb. You can go larger
than 1024, there's no real limit.

Changes since last time:

- Hopefully get the libata atapi/pio bits fixed.

- Clear __GFP_WAIT on second (and on) rounds of scatterlist allocation.

- Cleanups/fixes/etc.

It works for me, but you can't enable large commands on anything but
i386 right now. I still need to go over the x86-64 iommu bits to enable
it there as well.

 block/ll_rw_blk.c              |   41 +++++-
 crypto/digest.c                |    2 
 crypto/scatterwalk.c           |    2 
 crypto/scatterwalk.h           |    2 
 drivers/ata/libata-core.c      |   30 ++--
 drivers/scsi/scsi_lib.c        |  212 ++++++++++++++++++++++++---------
 drivers/scsi/scsi_tgt_lib.c    |    4 
 include/asm-i386/dma-mapping.h |   13 +-
 include/asm-i386/scatterlist.h |    4 
 include/linux/libata.h         |   16 +-
 include/linux/scatterlist.h    |   40 ++++++
 include/scsi/scsi.h            |    7 -
 include/scsi/scsi_cmnd.h       |    3 
 13 files changed, 275 insertions(+), 101 deletions(-)



^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH 0/19] Chaining sg lists for big IO commands v6
@ 2007-05-16  8:31 Jens Axboe
  2007-05-16  8:31 ` [PATCH 7/10] i386 sg: add support for chaining scatterlists Jens Axboe
  0 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2007-05-16  8:31 UTC (permalink / raw)
  To: linux-kernel

Hi,

Round 6 of the sg chaining patch set. Changes since v5:

- Support for more architectures. It should now run and work on
  i386, x86-64, sparc, sparc64, ia64, and ppc (32 and 64-bit).
  I have only tested i386/x86-64/ppc64 myself.

- Large command support is now automatically enabled by the
  SCSI mid layer, if the arch supports sg chaining. The debug
  queue entry in /sys/block/<dev>/queue/max_segments still exists
  if you want to tweak it further. The default limit is now
  2048 entries, or at least 8mb ios. Remember that you still need
  to tweak the soft limit to allow the block layer to build large
  commands, that is the max_sectors_kb variable in the same directory.

- Add kerneldoc documentation to scatterlist.h

It's solid here, so please give it a spin. I'd like to get some
performance results as well, if someone feels inclined to do so.


 arch/ia64/hp/common/sba_iommu.c           |   14 -
 arch/ia64/hp/sim/simscsi.c                |   23 +-
 arch/ia64/sn/pci/pci_dma.c                |   11 -
 arch/powerpc/kernel/dma_64.c              |    5 
 arch/powerpc/kernel/ibmebus.c             |   11 -
 arch/powerpc/kernel/iommu.c               |   18 +
 arch/powerpc/platforms/ps3/system-bus.c   |    5 
 arch/sparc/kernel/ioport.c                |   25 +-
 arch/sparc/mm/io-unit.c                   |   12 -
 arch/sparc/mm/iommu.c                     |   10 
 arch/sparc/mm/sun4c.c                     |   10 
 arch/sparc64/kernel/pci_iommu.c           |   39 ++-
 arch/sparc64/kernel/pci_sun4v.c           |   32 +-
 arch/sparc64/kernel/sbus.c                |   44 ++--
 arch/x86_64/kernel/pci-calgary.c          |   25 +-
 arch/x86_64/kernel/pci-gart.c             |   60 ++---
 arch/x86_64/kernel/pci-nommu.c            |    5 
 block/ll_rw_blk.c                         |   42 +++
 crypto/digest.c                           |    2 
 crypto/scatterwalk.c                      |    2 
 crypto/scatterwalk.h                      |    2 
 drivers/ata/libata-core.c                 |   30 +-
 drivers/ide/cris/ide-cris.c               |    3 
 drivers/ide/ide-dma.c                     |    2 
 drivers/ide/ide-taskfile.c                |   17 +
 drivers/ide/mips/au1xxx-ide.c             |    2 
 drivers/ide/pci/sgiioc4.c                 |    2 
 drivers/ide/ppc/pmac.c                    |    2 
 drivers/infiniband/hw/ipath/ipath_dma.c   |    9 
 drivers/infiniband/ulp/iser/iser_memory.c |   75 +++---
 drivers/infiniband/ulp/srp/ib_srp.c       |   22 +-
 drivers/message/fusion/mptscsih.c         |    4 
 drivers/scsi/3w-9xxx.c                    |    8 
 drivers/scsi/3w-xxxx.c                    |    8 
 drivers/scsi/53c700.c                     |   16 -
 drivers/scsi/BusLogic.c                   |    7 
 drivers/scsi/NCR53c406a.c                 |   18 -
 drivers/scsi/a100u2w.c                    |    9 
 drivers/scsi/aacraid/aachba.c             |   29 +-
 drivers/scsi/advansys.c                   |   21 -
 drivers/scsi/aha1542.c                    |   21 -
 drivers/scsi/aha1740.c                    |    8 
 drivers/scsi/aic7xxx/aic79xx_osm.c        |    3 
 drivers/scsi/aic7xxx/aic7xxx_osm.c        |   12 -
 drivers/scsi/aic94xx/aic94xx_task.c       |    6 
 drivers/scsi/arcmsr/arcmsr_hba.c          |   11 -
 drivers/scsi/dc395x.c                     |    7 
 drivers/scsi/dpt_i2o.c                    |   13 -
 drivers/scsi/eata.c                       |    8 
 drivers/scsi/esp_scsi.c                   |    5 
 drivers/scsi/gdth.c                       |   45 ++--
 drivers/scsi/hptiop.c                     |    8 
 drivers/scsi/ibmmca.c                     |   11 -
 drivers/scsi/ibmvscsi/ibmvscsi.c          |    4 
 drivers/scsi/ide-scsi.c                   |   31 +-
 drivers/scsi/initio.c                     |   12 -
 drivers/scsi/ipr.c                        |    9 
 drivers/scsi/ips.c                        |   74 +++---
 drivers/scsi/iscsi_tcp.c                  |   43 ++-
 drivers/scsi/jazz_esp.c                   |   27 +-
 drivers/scsi/lpfc/lpfc_scsi.c             |    9 
 drivers/scsi/mac53c94.c                   |    9 
 drivers/scsi/megaraid.c                   |   13 -
 drivers/scsi/megaraid/megaraid_mbox.c     |    7 
 drivers/scsi/megaraid/megaraid_sas.c      |   16 -
 drivers/scsi/mesh.c                       |   12 -
 drivers/scsi/ncr53c8xx.c                  |    7 
 drivers/scsi/nsp32.c                      |    9 
 drivers/scsi/pcmcia/sym53c500_cs.c        |   18 -
 drivers/scsi/qla1280.c                    |   66 +++---
 drivers/scsi/qla2xxx/qla_iocb.c           |    9 
 drivers/scsi/qla4xxx/ql4_iocb.c           |    8 
 drivers/scsi/qlogicfas408.c               |    9 
 drivers/scsi/qlogicpti.c                  |   15 -
 drivers/scsi/scsi_debug.c                 |   29 +-
 drivers/scsi/scsi_lib.c                   |  239 ++++++++++++++++------
 drivers/scsi/scsi_tgt_lib.c               |    4 
 drivers/scsi/sg.c                         |   16 -
 drivers/scsi/sym53c416.c                  |    9 
 drivers/scsi/sym53c8xx_2/sym_glue.c       |    7 
 drivers/scsi/u14-34f.c                    |   10 
 drivers/scsi/ultrastor.c                  |   10 
 drivers/scsi/wd7000.c                     |    7 
 drivers/usb/storage/alauda.c              |   16 -
 drivers/usb/storage/datafab.c             |   10 
 drivers/usb/storage/jumpshot.c            |   10 
 drivers/usb/storage/protocol.c            |   20 +
 drivers/usb/storage/protocol.h            |    2 
 drivers/usb/storage/sddr09.c              |   16 -
 drivers/usb/storage/sddr55.c              |   16 -
 drivers/usb/storage/shuttle_usbat.c       |   17 -
 include/asm-i386/dma-mapping.h            |   13 -
 include/asm-i386/scatterlist.h            |    2 
 include/asm-ia64/dma-mapping.h            |    1 
 include/asm-ia64/scatterlist.h            |    2 
 include/asm-powerpc/dma-mapping.h         |    2 
 include/asm-powerpc/scatterlist.h         |    2 
 include/asm-sparc/scatterlist.h           |    2 
 include/asm-sparc64/scatterlist.h         |    2 
 include/asm-x86_64/dma-mapping.h          |    3 
 include/asm-x86_64/scatterlist.h          |    2 
 include/linux/i2o.h                       |    2 
 include/linux/ide.h                       |    2 
 include/linux/libata.h                    |   16 -
 include/linux/scatterlist.h               |   84 +++++++
 include/scsi/scsi.h                       |    7 
 include/scsi/scsi_cmnd.h                  |    3 
 lib/swiotlb.c                             |   19 +
 108 files changed, 1104 insertions(+), 744 deletions(-)




^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-05-16  8:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-09  7:59 [PATCH 0/10] Chaining sg lists for big IO commands v2 Jens Axboe
2007-05-09  7:59 ` [PATCH 1/10] crypto: don't pollute the global namespace with sg_next() Jens Axboe
2007-05-09  7:59 ` [PATCH 2/10] Add sg helpers for iterating over a scatterlist table Jens Axboe
2007-05-09  7:59 ` [PATCH 3/10] libata: convert to using sg helpers Jens Axboe
2007-05-09  7:59 ` [PATCH 4/10] block: " Jens Axboe
2007-05-09  7:59 ` [PATCH 5/10] scsi: " Jens Axboe
2007-05-09  7:59 ` [PATCH 6/10] i386 dma_map_sg: " Jens Axboe
2007-05-09  7:59 ` [PATCH 7/10] i386 sg: add support for chaining scatterlists Jens Axboe
2007-05-09 10:03   ` Herbert Xu
2007-05-09 10:19     ` Andrew Morton
2007-05-09 10:21       ` Herbert Xu
2007-05-09 10:30       ` Jens Axboe
2007-05-09 10:28     ` Jens Axboe
2007-05-09  7:59 ` [PATCH 8/10] scsi: simplify scsi_free_sgtable() Jens Axboe
2007-05-09  7:59 ` [PATCH 9/10] SCSI: support for allocating large scatterlists Jens Axboe
2007-05-09  7:59 ` [PATCH 10/10] ll_rw_blk: temporarily enable max_segments tweaking Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2007-05-16  8:31 [PATCH 0/19] Chaining sg lists for big IO commands v6 Jens Axboe
2007-05-16  8:31 ` [PATCH 7/10] i386 sg: add support for chaining scatterlists Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.