1. 25 10月, 2013 11 次提交
    • C
      blk-mq: add blk_mq_stop_hw_queues · 280d45f6
      Christoph Hellwig 提交于
      Add a helper to iterate over all hw queues and stop them.  This is useful
      for driver that implement PM suspend functionality.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      
      Modified to just call blk_mq_stop_hw_queue() by Jens.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      280d45f6
    • J
      null_blk: multi queue aware block test driver · f2298c04
      Jens Axboe 提交于
      A driver that simply completes IO it receives, it does no
      transfers. Written to fascilitate testing of the blk-mq code.
      It supports various module options to use either bio queueing,
      rq queueing, or mq mode.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f2298c04
    • J
      blk-mq: new multi-queue block IO queueing mechanism · 320ae51f
      Jens Axboe 提交于
      Linux currently has two models for block devices:
      
      - The classic request_fn based approach, where drivers use struct
        request units for IO. The block layer provides various helper
        functionalities to let drivers share code, things like tag
        management, timeout handling, queueing, etc.
      
      - The "stacked" approach, where a driver squeezes in between the
        block layer and IO submitter. Since this bypasses the IO stack,
        driver generally have to manage everything themselves.
      
      With drivers being written for new high IOPS devices, the classic
      request_fn based driver doesn't work well enough. The design dates
      back to when both SMP and high IOPS was rare. It has problems with
      scaling to bigger machines, and runs into scaling issues even on
      smaller machines when you have IOPS in the hundreds of thousands
      per device.
      
      The stacked approach is then most often selected as the model
      for the driver. But this means that everybody has to re-invent
      everything, and along with that we get all the problems again
      that the shared approach solved.
      
      This commit introduces blk-mq, block multi queue support. The
      design is centered around per-cpu queues for queueing IO, which
      then funnel down into x number of hardware submission queues.
      We might have a 1:1 mapping between the two, or it might be
      an N:M mapping. That all depends on what the hardware supports.
      
      blk-mq provides various helper functions, which include:
      
      - Scalable support for request tagging. Most devices need to
        be able to uniquely identify a request both in the driver and
        to the hardware. The tagging uses per-cpu caches for freed
        tags, to enable cache hot reuse.
      
      - Timeout handling without tracking request on a per-device
        basis. Basically the driver should be able to get a notification,
        if a request happens to fail.
      
      - Optional support for non 1:1 mappings between issue and
        submission queues. blk-mq can redirect IO completions to the
        desired location.
      
      - Support for per-request payloads. Drivers almost always need
        to associate a request structure with some driver private
        command structure. Drivers can tell blk-mq this at init time,
        and then any request handed to the driver will have the
        required size of memory associated with it.
      
      - Support for merging of IO, and plugging. The stacked model
        gets neither of these. Even for high IOPS devices, merging
        sequential IO reduces per-command overhead and thus
        increases bandwidth.
      
      For now, this is provided as a potential 3rd queueing model, with
      the hope being that, as it matures, it can replace both the classic
      and stacked model. That would get us back to having just 1 real
      model for block devices, leaving the stacked approach to dm/md
      devices (as it was originally intended).
      
      Contributions in this patch from the following people:
      
      Shaohua Li <shli@fusionio.com>
      Alexander Gordeev <agordeev@redhat.com>
      Christoph Hellwig <hch@infradead.org>
      Mike Christie <michaelc@cs.wisc.edu>
      Matias Bjorling <m@bjorling.me>
      Jeff Moyer <jmoyer@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      320ae51f
    • S
      percpu_ida: add an API to return free tags · 1dddc01a
      Shaohua Li 提交于
      Add an API to return free tags, blk-mq-tag will use it.
      
      Note, this just returns a snapshot of free tags number. blk-mq-tag has
      two usages of it. One is for info output for diagnosis. The other is to
      quickly check if there are free tags for request dispatch checking.
      Neither requires very precise.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      1dddc01a
    • S
      percpu_ida: add percpu_ida_for_each_free · 7fc2ba17
      Shaohua Li 提交于
      Add a new API to iterate free ids. blk-mq-tag will use it.
      
      Note, this doesn't guarantee to iterate all free ids restrictly. Caller
      should be aware of this. blk-mq uses it to do sanity check for request
      timedout, so can tolerate the limitation.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7fc2ba17
    • S
      percpu_ida: make percpu_ida percpu size/batch configurable · e26b53d0
      Shaohua Li 提交于
      Make percpu_ida percpu size/batch configurable. The block-mq-tag will
      use it.
      
      After block-mq uses percpu_ida to manage tags, performance is improved.
      My test is done in a 2 sockets machine, 12 process cross the 2 sockets.
      So if there is lock contention or ipi, should be stressed heavily.
      Testing is done for null-blk.
      
      hw_queue_depth	nopatch iops	patch iops
      64		~800k/s		~1470k/s
      2048		~4470k/s	~4340k/s
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e26b53d0
    • S
      percpu_counter: make APIs irq safe · 098faf58
      Shaohua Li 提交于
      In my usage, sometimes the percpu APIs are called with irq locked,
      sometimes not. lockdep complains there is potential deadlock. Let's
      always use percpucounter lock in irq safe way. There should be no
      performance penality, as all those are slow code path.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NShaohua Li <shli@fusionio.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      098faf58
    • C
      block: remove request ref_count · 71fe07d0
      Christoph Hellwig 提交于
      This reference count has been around since before git history, but the only
      place where it's used is in blk_execute_rq, and ther it is entirely useless
      as it is incremented before submitting the request and decremented in the
      end_io handler before waking up the submitter thread.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      71fe07d0
    • J
      block: make rq->cmd_flags be 64-bit · 5953316d
      Jens Axboe 提交于
      We have officially run out of flags in a 32-bit space. Extend it
      to 64-bit even on 32-bit archs.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      5953316d
    • J
      smp: don't warn about csd->flags having CSD_FLAG_LOCK cleared for !wait · c84a83e2
      Jens Axboe 提交于
      blk-mq reuses the request potentially immediately, since the most
      cache hot is always given out first. This means that rq->csd could
      be reused between csd->func() being called and csd_unlock() being
      called. This isn't a problem, since we never use wait == 1 for
      the smp call function. Add CSD_FLAG_WAIT to be able to tell the
      difference, retaining the warning for other cases.
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      c84a83e2
    • J
      smp: export __smp_call_function_single() · e3daab6c
      Jens Axboe 提交于
      The blk-mq core and the blk-mq null driver uses it.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      e3daab6c
  2. 14 10月, 2013 10 次提交
  3. 13 10月, 2013 16 次提交
  4. 12 10月, 2013 3 次提交
    • V
      ARC: Ignore ptrace SETREGSET request for synthetic register "stop_pc" · 5b242828
      Vineet Gupta 提交于
      ARCompact TRAP_S insn used for breakpoints, commits before exception is
      taken (updating architectural PC). So ptregs->ret contains next-PC and
      not the breakpoint PC itself. This is different from other restartable
      exceptions such as TLB Miss where ptregs->ret has exact faulting PC.
      gdb needs to know exact-PC hence ARC ptrace GETREGSET provides for
      @stop_pc which returns ptregs->ret vs. EFA depending on the
      situation.
      
      However, writing stop_pc (SETREGSET request), which updates ptregs->ret
      doesn't makes sense stop_pc doesn't always correspond to that reg as
      described above.
      
      This was not an issue so far since user_regs->ret / user_regs->stop_pc
      had same value and both writing to ptregs->ret was OK, needless, but NOT
      broken, hence not observed.
      
      With gdb "jump", they diverge, and user_regs->ret updating ptregs is
      overwritten immediately with stop_pc, which this patch fixes.
      Reported-by: NAnton Kolesov <akolesov@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      5b242828
    • L
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 46f37519
      Linus Torvalds 提交于
      Pull MIPS fix from Ralf Baechle:
       "Just one fix.  The stack protector was loading the value of the canary
        instead of its address"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: stack protector: Fix per-task canary switch
      46f37519
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · cd4edf7a
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
       "All over the map..
      
         - nouveau:
           disable MSI, needs more work, will try again next merge window
         - radeon:
            audio + uvd regression fixes, dpm fixes, reset fixes
         - i915:
           the dpms fix might fix your haswell
      
        And one pain in the ass revert, so we have VGA arbitration that when
        implemented 4-5 years ago really hoped that GPUs could remove
        themselves from arbitration completely once they had a kernel driver.
      
        It seems Intel hw designers decided that was too nice a facility to
        allow us to have so they removed it when they went on-die (so since
        Ironlake at least).  Now Alex Williamson added support for VGA
        arbitration for newer GPUs however this now exposes itself to
        userspace as requireing arbitration of GPU VGA regions and the X
        server gets involved and disables things that it can't handle when VGA
        access is possibly required around every operation.
      
        So in order to not break userspace we just reverted things back to the
        old known broken status so maybe we can try and design out way out.
      
        Ville also had a patch to use stop machine for the two times Intel
        needs to access VGA space, that might be acceptable with some rework,
        but for now myself and Daniel agreed to just go back"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (23 commits)
        Revert "i915: Update VGA arbiter support for newer devices"
        Revert "drm/i915: Delay disabling of VGA memory until vgacon->fbcon handoff is done"
        drm/radeon: re-enable sw ACR support on pre-DCE4
        drm/radeon/dpm: disable bapm on TN asics
        drm/radeon: improve soft reset on CIK
        drm/radeon: improve soft reset on SI
        drm/radeon/dpm: off by one in si_set_mc_special_registers()
        drm/radeon/dpm/btc: off by one in btc_set_mc_special_registers()
        drm/radeon: forever loop on error in radeon_do_test_moves()
        drm/radeon: fix hw contexts for SUMO2 asics
        drm/radeon: fix typo in CP DMA register headers
        drm/radeon/dpm: disable multiple UVD states
        drm/radeon: use hw generated CTS/N values for audio
        drm/radeon: fix N/CTS clock matching for audio
        drm/radeon: use 64-bit math to calculate CTS values for audio (v2)
        drm/edid: catch kmalloc failure in drm_edid_to_speaker_allocation
        Revert "drm/fb-helper: don't sleep for screen unblank when an oops is in progress"
        drm/gma500: fix things after get/put page helpers
        drm/nouveau/mc: disable msi support by default, it's busted in tons of places
        drm/i915: Only apply DPMS to the encoder if enabled
        ...
      cd4edf7a