1. 25 Oct, 2013 9 commits
    • Jens Axboe's avatar
      blk-mq: new multi-queue block IO queueing mechanism · 320ae51f
      Jens Axboe authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      320ae51f
    • Shaohua Li's avatar
      percpu_ida: add an API to return free tags · 1dddc01a
      Shaohua Li authored
      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: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1dddc01a
    • Shaohua Li's avatar
      percpu_ida: add percpu_ida_for_each_free · 7fc2ba17
      Shaohua Li authored
      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: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      7fc2ba17
    • Shaohua Li's avatar
      percpu_ida: make percpu_ida percpu size/batch configurable · e26b53d0
      Shaohua Li authored
      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: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      e26b53d0
    • Shaohua Li's avatar
      percpu_counter: make APIs irq safe · 098faf58
      Shaohua Li authored
      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: default avatarShaohua Li <shli@fusionio.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      098faf58
    • Christoph Hellwig's avatar
      block: remove request ref_count · 71fe07d0
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      71fe07d0
    • Jens Axboe's avatar
      block: make rq->cmd_flags be 64-bit · 5953316d
      Jens Axboe authored
      We have officially run out of flags in a 32-bit space. Extend it
      to 64-bit even on 32-bit archs.
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      5953316d
    • Jens Axboe's avatar
      smp: don't warn about csd->flags having CSD_FLAG_LOCK cleared for !wait · c84a83e2
      Jens Axboe authored
      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: default avatarJens Axboe <axboe@kernel.dk>
      c84a83e2
    • Jens Axboe's avatar
      smp: export __smp_call_function_single() · e3daab6c
      Jens Axboe authored
      The blk-mq core and the blk-mq null driver uses it.
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Acked-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      e3daab6c
  2. 13 Oct, 2013 17 commits
  3. 12 Oct, 2013 10 commits
  4. 11 Oct, 2013 4 commits
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 46f37519
      Linus Torvalds authored
      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
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · cd4edf7a
      Linus Torvalds authored
      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
    • David Henningsson's avatar
    • David Henningsson's avatar
      ALSA: hda - Add a headset mic model for ALC269 and friends · 7c478f03
      David Henningsson authored
      Using the headset mic model will cause the headset mic to be labeled
      "headset mic" instead of just "mic".
      Signed-off-by: default avatarDavid Henningsson <david.henningsson@canonical.com>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7c478f03