1. 21 12月, 2009 2 次提交
  2. 09 12月, 2009 2 次提交
    • M
      block,xd: Delay allocation of DMA buffers until device is known · a3b8d92d
      Mel Gorman 提交于
      Loading the XD module triggers a warning like
      
       WARNING: at mm/page_alloc.c:1805
       __alloc_pages_nodemask+0x127/0x48f()
       Hardware name: System Product Name
       Modules linked in:
       Pid: 1, comm: swapper Not tainted 2.6.32-rc8-git5 #1
       Call Trace:
        [<c103d94b>] warn_slowpath_common+0x65/0x95
        [<c103d98d>] warn_slowpath_null+0x12/0x15
        [<c109550c>] __alloc_pages_nodemask+0x127/0x48f
        [<c10be964>] ? get_slab+0x8/0x50
        [<c10b8979>] alloc_page_interleave+0x2e/0x6e
        [<c10b8a10>] alloc_pages_current+0x57/0x99
        [<c2083a4a>] ? xd_init+0x0/0x482
        [<c1094c38>] __get_free_pages+0xd/0x1e
        [<c2083a94>] xd_init+0x4a/0x482
        [<c2082df0>] ? loop_init+0x104/0x16a
        [<c169162d>] ? loop_probe+0x0/0xaf
        [<c2083a4a>] ? xd_init+0x0/0x482
        [<c1001143>] do_one_initcall+0x51/0x13f
        [<c204a307>] kernel_init+0x10b/0x15f
        [<c204a1fc>] ? kernel_init+0x0/0x15f
        [<c1004347>] kernel_thread_helper+0x7/0x10
       ---[ end trace 686db6333ade6e7a ]---
       xd: Out of memory.
      
      The warning is because the alloc_pages is called with an
      order >= MAX_ORDER. The simplistic reason is that get_order(0) returns garbage
      values when given 0 as a size. The more complex reason is that the XD driver
      initialisation is broken.
      
      It's not clear why this ever worked. XD allocates a buffer for DMA based
      on the value of xd_maxsectors. This value is determined by the exact
      type of controller in use but the value is determined *after* an attempt
      has been made to allocate the buffer. i.e. the requested size of the DMA
      buffer will always be 0.
      
      This patch alters how XD is initialised slightly by allocating the
      buffer when and if a device has actually been detected. The error paths
      are updated to suit the new logic.
      Signed-off-by: NMel Gorman <mel@csn.ul.ie>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      a3b8d92d
    • P
  3. 04 12月, 2009 1 次提交
  4. 02 12月, 2009 1 次提交
  5. 25 11月, 2009 3 次提交
  6. 23 11月, 2009 2 次提交
    • A
      cciss: change Cmd_sg_list.sg_chain_dma type to dma_addr_t · 32a87c01
      Alex Chiang 提交于
      A recent commit broke the ia64 build:
      
      	Author: Don Brace <brace@beardog.cce.hp.com>
      	Date:   Thu Nov 12 12:50:01 2009 -0600
      
      	cciss: Add enhanced scatter-gather support.
      
      because of this hunk:
      
      	--- a/drivers/block/cciss.h
      	+++ b/drivers/block/cciss.h
      	+struct Cmd_sg_list {
      	+       SGDescriptor_struct     *sgchain;
      	+       dma64_addr_t            sg_chain_dma;
      	+       int                     chain_block_size;
      	+};
      
      The issue is that dma64_addr_t isn't #define'd on ia64.
      
      The way that we're using Cmd_sg_list.sg_chain_dma is to hold an
      address returned from pci_map_single().
      
      	+               temp64.val = pci_map_single(h->pdev,
      	+                                 h->cmd_sg_list[c->cmdindex]->sgchain,
      	+                                 len, dir);
      	+
      	+               h->cmd_sg_list[c->cmdindex]->sg_chain_dma = temp64.val;
      
      pci_map_single() returns a dma_addr_t too.
      
      This code will still work even on a 32-bit x86 build, where
      dma_addr_t is defined to be a u32 because it will simply be
      promoted to the __u64 that temp64.val is defined as.
      
      Thus, declaring Cmd_sg_list.sg_chain_dma as dma_addr_t is safe.
      
      Cc: Don Brace <brace@beardog.cce.hp.com>
      Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      32a87c01
    • S
      cciss: fix scatter gather cleanup problems · d61c4269
      Stephen M. Cameron 提交于
      On driver unload, only free up the extra scatter gather data if they were
      allocated in the first place (the controller supports it) and don't forget
      to free up the sg_cmd_list array of pointers.
      Signed-off-by: NDon Brace <brace@beardog.cce.hp.com>
      Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      d61c4269
  7. 13 11月, 2009 12 次提交
  8. 04 11月, 2009 6 次提交
  9. 29 10月, 2009 1 次提交
    • A
      loop: fix NULL dereference if mount fails · cf6e6932
      Alexey Dobriyan 提交于
      Commit bb214884 ("[PATCH] switch loop")
      started to pass NULL bdev to ioctl hook.
      
      Steps to reproduce:
      
      	[boot with loop.max_part=1]
      	[mount -o loop something so mount fails]
      
      BUG: unable to handle kernel NULL pointer dereference at 00000000000000b8
      IP: [<ffffffff811486ee>] blkdev_ioctl+0x2e/0xa30
      PGD 0
      Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      last sysfs file: /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:35/ACPI0003:00/power_supply/ACAD/online
      CPU 0
      Modules linked in: zfs nvidia(P) [last unloaded: zfs]
      Pid: 15177, comm: mount Tainted: P           2.6.32-rc4-zfs #2 Satellite X200
      RIP: 0010:[<ffffffff811486ee>]  [<ffffffff811486ee>] blkdev_ioctl+0x2e/0xa30
      RSP: 0018:ffff88003b3d5bb8  EFLAGS: 00010286
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: 000000000000125f RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffff88003b3d5ce8 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: 00007ffffffff000
      R13: 0000000000000000 R14: ffff880071cef280 R15: 00000000000200da
      FS:  00007fd77cfe7740(0000) GS:ffff880001600000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 00000000000000b8 CR3: 0000000001001000 CR4: 00000000000026f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process mount (pid: 15177, threadinfo ffff88003b3d4000, task ffff88007572f920)
      Stack:
       ffff88003b3d5c38 ffffffff812f95f5 ffff88007eeb6600 0000000000000000
      <0> 0000000000000000 ffff88003b3d5c18 ffffffff811547d9 ffff88001bf11ef0
      <0> 7fffffffffffffff ffff88001bf11ee8 ffff88001bf11ef0 0000000000000000
      Call Trace:
       [<ffffffff812f95f5>] ? schedule_timeout+0x1f5/0x250
       [<ffffffff811547d9>] ? rb_insert_color+0x109/0x140
       [<ffffffff812fb754>] ? _spin_unlock_irq+0x14/0x40
       [<ffffffff812f84c6>] ? wait_for_common+0x66/0x170
       [<ffffffff8105a280>] ? default_wake_function+0x0/0x10
       [<ffffffff810f8258>] ioctl_by_bdev+0x38/0x50
       [<ffffffff811d2481>] loop_clr_fd+0x1e1/0x210
       [<ffffffff811d2522>] lo_release+0x72/0x80
       [<ffffffff810f934c>] __blkdev_put+0x1ac/0x1d0
       [<ffffffff810f937b>] blkdev_put+0xb/0x10
       [<ffffffff810f93b9>] blkdev_close+0x39/0x60
       [<ffffffff810ccef3>] __fput+0xd3/0x230
       [<ffffffff810cd06d>] fput+0x1d/0x30
       [<ffffffff810c9680>] filp_close+0x50/0x80
       [<ffffffff81061f11>] put_files_struct+0x81/0x100
       [<ffffffff81061fde>] exit_files+0x4e/0x60
       [<ffffffff81063ec5>] do_exit+0x6b5/0x730
       [<ffffffff8107b279>] ? up_read+0x9/0x10
       [<ffffffff8104c86e>] ? do_page_fault+0x18e/0x2a0
       [<ffffffff81063f81>] do_group_exit+0x41/0xc0
       [<ffffffff81064012>] sys_exit_group+0x12/0x20
       [<ffffffff81030deb>] system_call_fastpath+0x16/0x1b
      Code: f8 48 89 e5 48 81 ec 30 01 00 00 48 89 5d d8 4c 89 6d e8 4c 89 65 e0 4c 89 75 f0 4c 89 7d f8 48 89 bd e8 fe ff ff 49 89 cd 89 f3 <49> 8b 88 b8 00 00 00 81 fa 68 12 00 00 0f 84 57 05 00 00 0f 86
      RIP  [<ffffffff811486ee>] blkdev_ioctl+0x2e/0xa30
       RSP <ffff88003b3d5bb8>
      CR2: 00000000000000b8
      ---[ end trace c0b4d3c3118d1427 ]---
      Fixing recursive fault but reboot is needed!
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cf6e6932
  10. 28 10月, 2009 1 次提交
  11. 22 10月, 2009 3 次提交
    • R
      virtio_blk: Revert serial number support · 3225beab
      Rusty Russell 提交于
      This reverts "Add serial number support for virtio_blk, V4a".
      
      Turns out that virtio_pci, lguest and s/390 all have an 8 bit limit
      on virtio config space, so noone could ever use this.
      
      This is coming back later in a cleaner form.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: john cooper <john.cooper@redhat.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      3225beab
    • C
      virtio: let header files include virtio_ids.h · e95646c3
      Christian Borntraeger 提交于
      Rusty,
      
      commit 3ca4f5ca
          virtio: add virtio IDs file
      moved all device IDs into a single file. While the change itself is
      a very good one, it can break userspace applications. For example
      if a userspace tool wanted to get the ID of virtio_net it used to
      include virtio_net.h. This does no longer work, since virtio_net.h
      does not include virtio_ids.h.
      This patch moves all "#include <linux/virtio_ids.h>" from the C
      files into the header files, making the header files compatible with
      the old ones.
      
      In addition, this patch exports virtio_ids.h to userspace.
      
      CC: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e95646c3
    • 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
  12. 13 10月, 2009 2 次提交
  13. 08 10月, 2009 1 次提交
  14. 06 10月, 2009 1 次提交
  15. 05 10月, 2009 1 次提交
  16. 02 10月, 2009 1 次提交