1. 07 8月, 2018 38 次提交
  2. 03 8月, 2018 2 次提交
    • R
      powerpc/powernv: Fix concurrency issue with npu->mmio_atsd_usage · 9eab9901
      Reza Arbab 提交于
      We've encountered a performance issue when multiple processors stress
      {get,put}_mmio_atsd_reg(). These functions contend for
      mmio_atsd_usage, an unsigned long used as a bitmask.
      
      The accesses to mmio_atsd_usage are done using test_and_set_bit_lock()
      and clear_bit_unlock(). As implemented, both of these will require
      a (successful) stwcx to that same cache line.
      
      What we end up with is thread A, attempting to unlock, being slowed by
      other threads repeatedly attempting to lock. A's stwcx instructions
      fail and retry because the memory reservation is lost every time a
      different thread beats it to the punch.
      
      There may be a long-term way to fix this at a larger scale, but for
      now resolve the immediate problem by gating our call to
      test_and_set_bit_lock() with one to test_bit(), which is obviously
      implemented without using a store.
      
      Fixes: 1ab66d1f ("powerpc/powernv: Introduce address translation services for Nvlink2")
      Signed-off-by: NReza Arbab <arbab@linux.ibm.com>
      Acked-by: NAlistair Popple <alistair@popple.id.au>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      9eab9901
    • C
      powerpc: Do not redefine NEED_DMA_MAP_STATE · 06832fc0
      Christoph Hellwig 提交于
      kernel/dma/Kconfig already defines NEED_DMA_MAP_STATE, just select it
      from CONFIG_PPC using the same condition as an if guard.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      [mpe: Move it under PPC]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      06832fc0