1. 08 4月, 2008 2 次提交
  2. 07 4月, 2008 1 次提交
    • H
      scsi: fix sense_slab/bio swapping livelock · 164fc5dc
      Hugh Dickins 提交于
      Since 2.6.25-rc7, I've been seeing an occasional livelock on one x86_64
      machine, copying kernel trees to tmpfs, paging out to swap.
      
      Signature: 6000 pages under writeback but never getting written; most
      tasks of interest trying to reclaim, but each get_swap_bio waiting for a
      bio in mempool_alloc's io_schedule_timeout(5*HZ); every five seconds an
      atomic page allocation failure report from kblockd failing to allocate a
      sense_buffer in __scsi_get_command.
      
      __scsi_get_command has a (one item) free_list to protect against this,
      but rc1's [SCSI] use dynamically allocated sense buffer
      de25deb1 upset that slightly.  When it
      fails to allocate from the separate sense_slab, instead of giving up, it
      must fall back to the command free_list, which is sure to have a
      sense_buffer attached.
      
      Either my earlier -rc testing missed this, or there's some recent
      contributory factor.  One very significant factor is SLUB, which merges
      slab caches when it can, and on 64-bit happens to merge both bio cache
      and sense_slab cache into kmalloc's 128-byte cache: so that under this
      swapping load, bios above are liable to gobble up all the slots needed
      for scsi_cmnd sense_buffers below.
      
      That's disturbing behaviour, and I tried a few things to fix it.  Adding
      a no-op constructor to the sense_slab inhibits SLUB from merging it, and
      stops all the allocation failures I was seeing; but it's rather a hack,
      and perhaps in different configurations we have other caches on the
      swapout path which are ill-merged.
      
      Another alternative is to revert the separate sense_slab, using
      cache-line-aligned sense_buffer allocated beyond scsi_cmnd from the one
      kmem_cache; but that might waste more memory, and is only a way of
      diverting around the known problem.
      
      While I don't like seeing the allocation failures, and hate the idea of
      all those bios piled up above a scsi host working one by one, it does
      seem to emerge fairly soon with the livelock fix.  So lacking better
      ideas, stick with that one clear fix for now.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Cc: Peter Zijlstra <a.p.ziljstra@chello.nl>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      164fc5dc
  3. 05 3月, 2008 1 次提交
  4. 08 2月, 2008 1 次提交
  5. 31 1月, 2008 1 次提交
    • B
      [SCSI] implement scsi_data_buffer · 30b0c37b
      Boaz Harrosh 提交于
      In preparation for bidi we abstract all IO members of scsi_cmnd,
      that will need to duplicate, into a substructure.
      
      - Group all IO members of scsi_cmnd into a scsi_data_buffer
        structure.
      - Adjust accessors to new members.
      - scsi_{alloc,free}_sgtable receive a scsi_data_buffer instead of
        scsi_cmnd. And work on it.
      - Adjust scsi_init_io() and  scsi_release_buffers() for above
        change.
      - Fix other parts of scsi_lib/scsi.c to members migration. Use
        accessors where appropriate.
      
      - fix Documentation about scsi_cmnd in scsi_host.h
      
      - scsi_error.c
        * Changed needed members of struct scsi_eh_save.
        * Careful considerations in scsi_eh_prep/restore_cmnd.
      
      - sd.c and sr.c
        * sd and sr would adjust IO size to align on device's block
          size so code needs to change once we move to scsi_data_buff
          implementation.
        * Convert code to use scsi_for_each_sg
        * Use data accessors where appropriate.
      
      - tgt: convert libsrp to use scsi_data_buffer
      
      - isd200: This driver still bangs on scsi_cmnd IO members,
        so need changing
      
      [jejb: rebased on top of sg_table patches fixed up conflicts
      and used the synergy to eliminate use_sg and sg_count]
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      30b0c37b
  6. 24 1月, 2008 2 次提交
  7. 12 1月, 2008 3 次提交
  8. 07 1月, 2008 1 次提交
    • L
      Revert "scsi: revert "[SCSI] Get rid of scsi_cmnd->done"" · 7b3d9545
      Linus Torvalds 提交于
      This reverts commit ac40532e, which gets
      us back the original cleanup of 6f5391c2.
      
      It turns out that the bug that was triggered by that commit was
      apparently not actually triggered by that commit at all, and just the
      testing conditions had changed enough to make it appear to be due to it.
      
      The real problem seems to have been found by Peter Osterlund:
      
        "pktcdvd sets it [block device size] when opening the /dev/pktcdvd
         device, but when the drive is later opened as /dev/scd0, there is
         nothing that sets it back.  (Btw, 40944 is possible if the disk is a
         CDRW that was formatted with "cdrwtool -m 10236".)
      
         The problem is that pktcdvd opens the cd device in non-blocking mode
         when pktsetup is run, and doesn't close it again until pktsetup -d is
         run.  The effect is that if you meanwhile open the cd device,
         blkdev.c:do_open() doesn't call bd_set_size() because
         bdev->bd_openers is non-zero."
      
      In particular, to repeat the bug (regardless of whether commit
      6f5391c2 is applied or not):
      
        " 1. Start with an empty drive.
          2. pktsetup 0 /dev/scd0
          3. Insert a CD containing an isofs filesystem.
          4. mount /dev/pktcdvd/0 /mnt/tmp
          5. umount /mnt/tmp
          6. Press the eject button.
          7. Insert a DVD containing a non-writable filesystem.
          8. mount /dev/scd0 /mnt/tmp
          9. find /mnt/tmp -type f -print0 | xargs -0 sha1sum >/dev/null
          10. If the DVD contains data beyond the physical size of a CD, you
              get I/O errors in the terminal, and dmesg reports lots of
              "attempt to access beyond end of device" errors."
      
      which in turn is because the nested open after the media change won't
      cause the size to be set properly (because the original open still holds
      the block device, and we only do the bd_set_size() when we don't have
      other people holding the device open).
      
      The proper fix for that is probably to just do something like
      
      	bdev->bd_inode->i_size = (loff_t)get_capacity(disk)<<9;
      
      in fs/block_dev.c:do_open() even for the cases where we're not the
      original opener (but *not* call bd_set_size(), since that will also
      change the block size of the device).
      
      Cc: Peter Osterlund <petero2@telia.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7b3d9545
  9. 03 1月, 2008 1 次提交
  10. 11 12月, 2007 1 次提交
  11. 13 10月, 2007 2 次提交
  12. 20 7月, 2007 1 次提交
    • P
      mm: Remove slab destructors from kmem_cache_create(). · 20c2df83
      Paul Mundt 提交于
      Slab destructors were no longer supported after Christoph's
      c59def9f change. They've been
      BUGs for both slab and slub, and slob never supported them
      either.
      
      This rips out support for the dtor pointer from kmem_cache_create()
      completely and fixes up every single callsite in the kernel (there were
      about 224, not including the slab allocator definitions themselves,
      or the documentation references).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      20c2df83
  13. 15 7月, 2007 2 次提交
  14. 12 3月, 2007 1 次提交
  15. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  16. 14 1月, 2007 1 次提交
  17. 08 12月, 2006 1 次提交
  18. 26 11月, 2006 1 次提交
    • F
      [SCSI] export scsi-ml functions needed by tgt_scsi_lib and its LLDs · b58d9154
      FUJITA Tomonori 提交于
      This patch contains the needed changes to the scsi-ml for the target
      mode support.
      
      Note, per the last review we moved almost all the fields we added
      to the scsi_cmnd to our internal data structure which we are going
      to try and kill off when we can replace it with support from other
      parts of the kernel.
      
      The one field we left on was the offset variable. This is needed to handle
      the case where the target gets request that is so large that it cannot
      execute it in one dma operation. So max_secotors or a segment limit may
      limit the size of the transfer. In this case our tgt core code will
      break up the command into managable transfers and send them to the
      LLD one at a time. The offset is then used to tell the LLD where in
      the command we are at. Is there another field on the scsi_cmd for
      that?
      Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      b58d9154
  19. 16 11月, 2006 1 次提交
  20. 02 10月, 2006 1 次提交
  21. 01 10月, 2006 2 次提交
  22. 25 9月, 2006 1 次提交
  23. 12 9月, 2006 1 次提交
  24. 07 9月, 2006 1 次提交
  25. 03 9月, 2006 1 次提交
  26. 02 9月, 2006 1 次提交
  27. 07 8月, 2006 1 次提交
    • M
      [SCSI] Improve inquiry printing · 4ff36718
      Matthew Wilcox 提交于
       - Replace scsi_device_types array API with scsi_device_type function API.
         Gets rid of a lot of common code, as well as being easier to use.
       - Add the new device types in SPC4 r05a, and rename some of the older ones.
       - Reformat the printing of inquiry data; now fits on one line and
         includes PQ.
      
      I think I've addressed all the feedback from the previous versions.  My
      current test box prints:
      
      scsi 2:0:1:0: Direct access     HP 18.2G ATLAS10K3_18_SCA HP05 PQ: 0 ANSI: 2
      Signed-off-by: NMatthew Wilcox <matthew@wil.cx>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      4ff36718
  28. 10 7月, 2006 1 次提交
    • C
      [SCSI] hide EH backup data outside the scsi_cmnd · 631c228c
      Christoph Hellwig 提交于
      Currently struct scsi_cmnd has various fields that are used to backup
      original data after the corresponding fields have been overridden for
      EH commands.  This means drivers can easily get at it and misuse it.
      Due to the old_ naming this doesn't happen for most of them, but two
      that have different names have been used wrong a lot (see previous
      patch).  Another downside is that they unessecarily bloat the scsi_cmnd
      size.
      
      This patch moves them onstack in scsi_send_eh_cmnd to fix those two
      issues aswell as allowing future EH fixes like moving the EH command
      submissions to use SG lists like everything else.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
      631c228c
  29. 11 6月, 2006 1 次提交
  30. 15 5月, 2006 1 次提交
  31. 13 4月, 2006 2 次提交
  32. 28 2月, 2006 1 次提交