1. 09 Feb, 2011 2 commits
    • Simon Arlott's avatar
      cdrom: support devices that have check_events but not media_changed · b8cf0e0e
      Simon Arlott authored
      Commit 93aae17a ("sr: implement
      sr_check_events()") replaced the media_changed op with the
      check_events op in drivers/scsi/sr.c
      
      All users that check for the CDC_MEDIA_CHANGED capbility try both
      the check_events op and the media_changed op, but register_cdrom()
      was requiring media_changed.
      
      This patch fixes the capability checking.
      
      The cdrom_select_disc ioctl is also using the two operations, so
      they should be required for CDC_SELECT_DISC too.
      Signed-off-by: default avatarSimon Arlott <simon@fire.lp0.eu>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Tested-by: default avatarChris Clayton <chris2553@googlemail.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      b8cf0e0e
    • Justin TerAvest's avatar
      cfq-iosched: Don't wait if queue already has requests. · 02a8f01b
      Justin TerAvest authored
      Commit 7667aa06 added logic to wait for
      the last queue of the group to become busy (have at least one request),
      so that the group does not lose out for not being continuously
      backlogged. The commit did not check for the condition that the last
      queue already has some requests. As a result, if the queue already has
      requests, wait_busy is set. Later on, cfq_select_queue() checks the
      flag, and decides that since the queue has a request now and wait_busy
      is set, the queue is expired.  This results in early expiration of the
      queue.
      
      This patch fixes the problem by adding a check to see if queue already
      has requests. If it does, wait_busy is not set. As a result, time slices
      do not expire early.
      
      The queues with more than one request are usually buffered writers.
      Testing shows improvement in isolation between buffered writers.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarJustin TerAvest <teravest@google.com>
      Reviewed-by: default avatarGui Jianfeng <guijianfeng@cn.fujitsu.com>
      Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      02a8f01b
  2. 19 Jan, 2011 7 commits
    • Vivek Goyal's avatar
      blkio-throttle: Avoid calling blkiocg_lookup_group() for root group · be2c6b19
      Vivek Goyal authored
      o Jeff Moyer was doing some testing on a RAM backed disk and
        blkiocg_lookup_group() showed up high overhead after memcpy(). Similarly
        somebody else reported that blkiocg_lookup_group() is eating 6% extra
        cpu. Though looking at the code I can't think why the overhead of
        this function is so high. One thing is that it is called with very high
        frequency (once for every IO).
      
      o For lot of folks blkio controller will be compiled in but they might
        not have actually created cgroups. Hence optimize the case of root
        cgroup where we can avoid calling blkiocg_lookup_group() if IO is happening
        in root group (common case).
      Reported-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Acked-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      be2c6b19
    • Vivek Goyal's avatar
      cfq: rename a function to give it more appropriate name · ba5bd520
      Vivek Goyal authored
      o Rename a function to give it more approprate name. We are calculating
        cfq queue slice and function name gives the impression as if cfq group
        slice length is being calculated.
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      ba5bd520
    • Stephen M. Cameron's avatar
    • Tracey Dent's avatar
      drivers/block/aoe/Makefile: replace the use of <module>-objs with <module>-y · a0700bdd
      Tracey Dent authored
      Change Makefile to use <modules>-y instead of <modules>-objs because -objs
      is deprecated and should now be switched.  According to
      (documentation/kbuild/makefiles.txt).
      Signed-off-by: default avatarTracey Dent <tdent48227@gmail.com>
      Cc: "Ed L. Cashin" <ecashin@coraid.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      a0700bdd
    • Sergey Senozhatsky's avatar
      loop: queue_lock NULL pointer derefence in blk_throtl_exit · ee71a968
      Sergey Senozhatsky authored
      Performing
      $ sudo mount -o loop -o umask=0 /dev/sdb1 /mnt/
      mount: wrong fs type, bad option, bad superblock on /dev/loop0,
             missing codepage or helper program, or other error
             In some cases useful info is found in syslog - try
             dmesg | tail  or so
      
      $ sudo modprobe -r loop
      
      results in oops:
      
       BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
       IP: [<ffffffff812479d4>] do_raw_spin_lock+0x14/0x122
       Process modprobe (pid: 6189, threadinfo ffff88009a898000, task ffff880154a88000)
       Call Trace:
        [<ffffffff81486788>] _raw_spin_lock_irq+0x4a/0x51
        [<ffffffff8123404b>] ? blk_throtl_exit+0x3b/0xa0
        [<ffffffff8105b120>] ? cancel_delayed_work_sync+0xd/0xf
        [<ffffffff8123404b>] blk_throtl_exit+0x3b/0xa0
        [<ffffffff81229bc8>] blk_release_queue+0x21/0x65
        [<ffffffff8123bb06>] kobject_release+0x51/0x66
        [<ffffffff8123bab5>] ? kobject_release+0x0/0x66
        [<ffffffff8123ce1e>] kref_put+0x43/0x4d
        [<ffffffff8123ba27>] kobject_put+0x47/0x4b
        [<ffffffff8122717c>] blk_cleanup_queue+0x56/0x5b
        [<ffffffffa01c3824>] loop_exit+0x68/0x844 [loop]
        [<ffffffff8107cccc>] sys_delete_module+0x1e8/0x25b
        [<ffffffff814864c9>] ? trace_hardirqs_on_thunk+0x3a/0x3f
        [<ffffffff81002112>] system_call_fastpath+0x16/0x1b
      
      because of an attempt to acquire NULL queue_lock.
      I added the same lines as in blk_queue_make_request -
      index 44e18c0..49e6a54 100644`fall back to embedded per-queue lock'.
      Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      ee71a968
    • Tracey Dent's avatar
      drivers/block/Makefile: replace the use of <module>-objs with <module>-y · 04de96c9
      Tracey Dent authored
      Change Makefile to use <modules>-y instead of <modules>-objs because -objs
      is deprecated and should now be switched.  According to
      (documentation/kbuild/makefiles.txt).
      Signed-off-by: default avatarTracey Dent <tdent48227@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      04de96c9
    • Tao Ma's avatar
      blktrace: Don't output messages if NOTIFY isn't set. · 490da40d
      Tao Ma authored
      Now if we enable blktrace, cfq has too many messages output to the
      trace buffer. It is fine if we don't specify any action mask.
      But if I do like this:
      blktrace /dev/sdb -a issue -a complete -o - | blkparse -i -
      I only want to see 'D' and 'C', while with the following command
      dd if=/mnt/ocfs2/test of=/dev/null bs=4k count=1 iflag=direct
      
      I will get(with a 2.6.37 vanilla kernel):
        8,16   0        0     0.000000000     0  m   N cfq3805 alloced
        8,16   0        0     0.000004126     0  m   N cfq3805 insert_request
        8,16   0        0     0.000004884     0  m   N cfq3805 add_to_rr
        8,16   0        0     0.000008417     0  m   N cfq workload slice:300
        8,16   0        0     0.000009557     0  m   N cfq3805 set_active wl_prio:0 wl_type:2
        8,16   0        0     0.000010640     0  m   N cfq3805 fifo=          (null)
        8,16   0        0     0.000011193     0  m   N cfq3805 dispatch_insert
        8,16   0        0     0.000012221     0  m   N cfq3805 dispatched a request
        8,16   0        0     0.000012802     0  m   N cfq3805 activate rq, drv=1
        8,16   0        1     0.000013181  3805  D   R 114759 + 8 [dd]
        8,16   0        2     0.000164244     0  C   R 114759 + 8 [0]
        8,16   0        0     0.000167997     0  m   N cfq3805 complete rqnoidle 0
        8,16   0        0     0.000168782     0  m   N cfq3805 set_slice=100
        8,16   0        0     0.000169874     0  m   N cfq3805 arm_idle: 8 group_idle: 0
        8,16   0        0     0.000170189     0  m   N cfq schedule dispatch
        8,16   0        0     0.000397938     0  m   N cfq3805 slice expired t=0
        8,16   0        0     0.000399763     0  m   N cfq3805 sl_used=1 disp=1 charge=1 iops=0 sect=8
        8,16   0        0     0.000400227     0  m   N cfq3805 del_from_rr
        8,16   0        0     0.000400882     0  m   N cfq3805 put_queue
      
      See, there are 19 lines while I only need 2. I don't think it is
      appropriate for a user.
      
      So this patch will disable any messages if the BLK_TC_NOTIFY isn't set.
      Now the output for the same command will look like:
        8,16   0        1     0.000000000  4908  D   R 114759 + 8 [dd]
        8,16   0        2     0.000146827     0  C   R 114759 + 8 [0]
      
      Yes, it is what I want to see.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarTao Ma <boyu.mt@taobao.com>
      Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
      490da40d
  3. 18 Jan, 2011 31 commits