1. 01 3月, 2018 1 次提交
    • O
      sbitmap: use test_and_set_bit_lock()/clear_bit_unlock() · 4ace53f1
      Omar Sandoval 提交于
      sbitmap_queue_get()/sbitmap_queue_clear() are used for
      allocating/freeing a resource, so they should provide acquire/release
      barrier semantics, respectively. sbitmap_get() currently contains a full
      barrier, which is unnecessary, so use test_and_set_bit_lock() instead of
      test_and_set_bit() (these are equivalent on x86_64). sbitmap_clear_bit()
      does not imply any barriers, which is incorrect, as accesses of the
      resource (e.g., request) could potentially get reordered to after the
      clear_bit(). Introduce sbitmap_clear_bit_unlock() and use it for
      sbitmap_queue_clear() (this only adds a compiler barrier on x86_64). The
      other existing user of sbitmap_clear_bit() (the blk-mq software queue
      pending map) is serialized through a spinlock and does not need this.
      Reported-by: NTejun Heo <tj@kernel.org>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4ace53f1
  2. 23 12月, 2017 1 次提交
    • J
      blk-mq: improve heavily contended tag case · 4e5dff41
      Jens Axboe 提交于
      Even with a number of waitqueues, we can get into a situation where we
      are heavily contended on the waitqueue lock. I got a report on spc1
      where we're spending seconds doing this. Arguably the use case is nasty,
      I reproduce it with one device and 1000 threads banging on the device.
      But that doesn't mean we shouldn't be handling it better.
      
      What ends up happening is that a thread will fail to get a tag, add
      itself to the waitqueue, and subsequently get woken up when a tag is
      freed - only to find itself going back to sleep on the waitqueue.
      
      Instead of waking all threads, use an exclusive wait and wake up our
      sbitmap batch count instead. This seems to work well for me (massive
      improvement for this use case), and it survives basic testing. But I
      haven't fully verified it yet.
      
      An additional improvement is running the queue and checking for a new
      tag BEFORE needing to add ourselves to the waitqueue.
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      4e5dff41
  3. 15 4月, 2017 1 次提交
    • O
      sbitmap: add sbitmap_get_shallow() operation · c05e6673
      Omar Sandoval 提交于
      This operation supports the use case of limiting the number of bits that
      can be allocated for a given operation. Rather than setting aside some
      bits at the end of the bitmap, we can set aside bits in each word of the
      bitmap. This means we can keep the allocation hints spread out and
      support sbitmap_resize() nicely at the cost of lower granularity for the
      allowed depth.
      Signed-off-by: NOmar Sandoval <osandov@fb.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      c05e6673
  4. 02 3月, 2017 1 次提交
    • I
      kasan, sched/headers: Uninline kasan_enable/disable_current() · af8601ad
      Ingo Molnar 提交于
      <linux/kasan.h> is a low level header that is included early
      in affected kernel headers. But it includes <linux/sched.h>
      which complicates the cleanup of sched.h dependencies.
      
      But kasan.h has almost no need for sched.h: its only use of
      scheduler functionality is in two inline functions which are
      not used very frequently - so uninline kasan_enable_current()
      and kasan_disable_current().
      
      Also add a <linux/sched.h> dependency to a .c file that depended
      on kasan.h including it.
      
      This paves the way to remove the <linux/sched.h> include from kasan.h.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      af8601ad
  5. 27 1月, 2017 1 次提交
  6. 19 1月, 2017 2 次提交
  7. 19 9月, 2016 1 次提交
  8. 18 9月, 2016 1 次提交
  9. 17 9月, 2016 6 次提交