1. 26 Feb, 2009 5 commits
    • Jens Axboe's avatar
      xen/blkfront: use blk_rq_map_sg to generate ring entries · 9e973e64
      Jens Axboe authored
      On occasion, the request will apparently have more segments than we
      fit into the ring. Jens says:
      
      > The second problem is that the block layer then appears to create one
      > too many segments, but from the dump it has rq->nr_phys_segments ==
      > BLKIF_MAX_SEGMENTS_PER_REQUEST. I suspect the latter is due to
      > xen-blkfront not handling the merging on its own. It should check that
      > the new page doesn't form part of the previous page. The
      > rq_for_each_segment() iterates all single bits in the request, not dma
      > segments. The "easiest" way to do this is to call blk_rq_map_sg() and
      > then iterate the mapped sg list. That will give you what you are
      > looking for.
      
      > Here's a test patch, compiles but otherwise untested. I spent more
      > time figuring out how to enable XEN than to code it up, so YMMV!
      > Probably the sg list wants to be put inside the ring and only
      > initialized on allocation, then you can get rid of the sg on stack and
      > sg_init_table() loop call in the function. I'll leave that, and the
      > testing, to you.
      
      [Moved sg array into info structure, and initialize once. -J]
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
      9e973e64
    • Jens Axboe's avatar
      block: reduce stack footprint of blk_recount_segments() · 1e428079
      Jens Axboe authored
      blk_recalc_rq_segments() requires a request structure passed in, which
      we don't have from blk_recount_segments(). So the latter allocates one on
      the stack, using > 400 bytes of stack for that. This can cause us to spill
      over one page of stack from ext4 at least:
      
       0)     4560     400   blk_recount_segments+0x43/0x62
       1)     4160      32   bio_phys_segments+0x1c/0x24
       2)     4128      32   blk_rq_bio_prep+0x2a/0xf9
       3)     4096      32   init_request_from_bio+0xf9/0xfe
       4)     4064     112   __make_request+0x33c/0x3f6
       5)     3952     144   generic_make_request+0x2d1/0x321
       6)     3808      64   submit_bio+0xb9/0xc3
       7)     3744      48   submit_bh+0xea/0x10e
       8)     3696     368   ext4_mb_init_cache+0x257/0xa6a [ext4]
       9)     3328     288   ext4_mb_regular_allocator+0x421/0xcd9 [ext4]
      10)     3040     160   ext4_mb_new_blocks+0x211/0x4b4 [ext4]
      11)     2880     336   ext4_ext_get_blocks+0xb61/0xd45 [ext4]
      12)     2544      96   ext4_get_blocks_wrap+0xf2/0x200 [ext4]
      13)     2448      80   ext4_da_get_block_write+0x6e/0x16b [ext4]
      14)     2368     352   mpage_da_map_blocks+0x7e/0x4b3 [ext4]
      15)     2016     352   ext4_da_writepages+0x2ce/0x43c [ext4]
      16)     1664      32   do_writepages+0x2d/0x3c
      17)     1632     144   __writeback_single_inode+0x162/0x2cd
      18)     1488      96   generic_sync_sb_inodes+0x1e3/0x32b
      19)     1392      16   sync_sb_inodes+0xe/0x10
      20)     1376      48   writeback_inodes+0x69/0xb3
      21)     1328     208   balance_dirty_pages_ratelimited_nr+0x187/0x2f9
      22)     1120     224   generic_file_buffered_write+0x1d4/0x2c4
      23)      896     176   __generic_file_aio_write_nolock+0x35f/0x393
      24)      720      80   generic_file_aio_write+0x6c/0xc8
      25)      640      80   ext4_file_write+0xa9/0x137 [ext4]
      26)      560     320   do_sync_write+0xf0/0x137
      27)      240      48   vfs_write+0xb3/0x13c
      28)      192      64   sys_write+0x4c/0x74
      29)      128     128   system_call_fastpath+0x16/0x1b
      
      Split the segment counting out into a __blk_recalc_rq_segments() helper
      to avoid allocating an onstack request just for checking the physical
      segment count.
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      1e428079
    • Jens Axboe's avatar
      cciss: shorten 30s timeout on controller reset · 5e4c91c8
      Jens Axboe authored
      If reset_devices is set for kexec, then cciss will delay 30 seconds
      since the old 5i controller _may_ need that long to recover. Replace
      the long sleep with incremental sleep and tests to reduce the 30 seconds
      to worst case for 5i, so that other controllers will proceed quickly.
      Reviewed-by: default avatarMike Miller <mike.miller@hp.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      5e4c91c8
    • Márton Németh's avatar
      block: add documentation for register_blkdev() · 9e8c0bcc
      Márton Németh authored
      Add documentation for register_blkdev() function and for the parameters.
      Signed-off-by: default avatarMárton Németh <nm127@freemail.hu>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      9e8c0bcc
    • Jens Axboe's avatar
      block: fix bogus gcc warning for uninitialized var usage · b2bf9683
      Jens Axboe authored
      Newer gcc throw this warning:
      
              fs/bio.c: In function ?bio_alloc_bioset?:
              fs/bio.c:305: warning: ?p? may be used uninitialized in this function
      
      since it cannot figure out that 'p' is only ever used if 'bs' is non-NULL.
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      b2bf9683
  2. 25 Feb, 2009 35 commits