1. 16 6月, 2016 2 次提交
    • P
      locking/atomic: Remove linux/atomic.h:atomic_fetch_or() · b53d6bed
      Peter Zijlstra 提交于
      Since all architectures have this implemented now natively, remove this
      dead code.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      b53d6bed
    • P
      locking/atomic, arch/mips: Implement atomic{,64}_fetch_{add,sub,and,or,xor}() · 4edac529
      Peter Zijlstra 提交于
      Implement FETCH-OP atomic primitives, these are very similar to the
      existing OP-RETURN primitives we already have, except they return the
      value of the atomic variable _before_ modification.
      
      This is especially useful for irreversible operations -- such as
      bitops (because it becomes impossible to reconstruct the state prior
      to modification).
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      4edac529
  2. 26 10月, 2015 1 次提交
  3. 23 9月, 2015 1 次提交
    • P
      atomic, arch: Audit atomic_{read,set}() · 62e8a325
      Peter Zijlstra 提交于
      This patch makes sure that atomic_{read,set}() are at least
      {READ,WRITE}_ONCE().
      
      We already had the 'requirement' that atomic_read() should use
      ACCESS_ONCE(), and most archs had this, but a few were lacking.
      All are now converted to use READ_ONCE().
      
      And, by a symmetry and general paranoia argument, upgrade atomic_set()
      to use WRITE_ONCE().
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: james.hogan@imgtec.com
      Cc: linux-kernel@vger.kernel.org
      Cc: oleg@redhat.com
      Cc: will.deacon@arm.com
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      62e8a325
  4. 27 7月, 2015 2 次提交
  5. 17 2月, 2015 2 次提交
  6. 24 11月, 2014 2 次提交
    • M
      MIPS: atomic.h: Reformat to fit in 79 columns · ddb3108e
      Maciej W. Rozycki 提交于
      Signed-off-by: NMaciej W. Rozycki <macro@codesourcery.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8484/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ddb3108e
    • M
      MIPS: Fix microMIPS LL/SC immediate offsets · b0984c43
      Maciej W. Rozycki 提交于
      In the microMIPS encoding some memory access instructions have their
      immediate offset reduced to 12 bits only.  That does not match the GCC
      `R' constraint we use in some places to satisfy the requirement,
      resulting in build failures like this:
      
      {standard input}: Assembler messages:
      {standard input}:720: Error: macro used $at after ".set noat"
      {standard input}:720: Warning: macro instruction expanded into multiple instructions
      
      Fix the problem by defining a macro, `GCC_OFF12_ASM', that expands to
      the right constraint depending on whether microMIPS or standard MIPS
      code is produced.  Also apply the fix to where `m' is used as in the
      worst case this change does nothing, e.g. where the pointer was already
      in a register such as a function argument and no further offset was
      requested, and in the best case it avoids an extraneous sequence of up
      to two instructions to load the high 20 bits of the address in the LL/SC
      loop.  This reduces the risk of lock contention that is the higher the
      more instructions there are in the critical section between LL and SC.
      
      Strictly speaking we could just bulk-replace `R' with `ZC' as the latter
      constraint adjusts automatically depending on the ISA selected.
      However it was only introduced with GCC 4.9 and we keep supporing older
      compilers for the standard MIPS configuration, hence the slightly more
      complicated approach I chose.
      
      The choice of a zero-argument function-like rather than an object-like
      macro was made so that it does not look like a function call taking the
      C expression used for the constraint as an argument.  This is so as not
      to confuse the reader or formatting checkers like `checkpatch.pl' and
      follows previous practice.
      Signed-off-by: NMaciej W. Rozycki <macro@codesourcery.com>
      Signed-off-by: NSteven J. Hill <Steven.Hill@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/8482/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b0984c43
  7. 03 10月, 2014 1 次提交
  8. 10 9月, 2014 1 次提交
  9. 14 8月, 2014 1 次提交
  10. 18 4月, 2014 1 次提交
  11. 01 4月, 2014 1 次提交
    • R
      MIPS: Fix gigaton of warning building with microMIPS. · a809d460
      Ralf Baechle 提交于
      With binutils 2.24 the attempt to switch with microMIPS mode to MIPS III
      mode through .set mips3 results in *lots* of warnings like
      
      {standard input}: Assembler messages:
      {standard input}:397: Warning: the 64-bit MIPS architecture does not support the `smartmips' extension
      
      during a kernel build.  Fixed by using .set arch=r4000 instead.
      
      This breaks support for building the kernel with binutils 2.13 which
      was supported for 32 bit kernels only anyway and 2.14 which was a bad
      vintage for MIPS anyway.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a809d460
  12. 05 11月, 2013 1 次提交
  13. 01 2月, 2013 1 次提交
  14. 11 10月, 2012 1 次提交
    • J
      Improve atomic.h robustness · b4f2a17b
      Joshua Kinard 提交于
      I've maintained this patch, originally from Thiemo Seufer in 2004, for a
      really long time, but I think it's time for it to get a look at for
      possible inclusion.  I have had no problems with it across various SGI
      systems over the years.
      
      To quote the post here:
      http://www.linux-mips.org/archives/linux-mips/2004-12/msg00000.html
      
      "the atomic functions use so far memory references for the inline
      assembler to access the semaphore. This can lead to additional
      instructions in the ll/sc loop, because newer compilers don't
      expand the memory reference any more but leave it to the assembler.
      
      The appended patch uses registers instead, and makes the ll/sc
      arguments more explicit. In some cases it will lead also to better
      register scheduling because the register isn't bound to an output
      any more."
      Signed-off-by: NJoshua Kinard <kumba@gentoo.org>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/4029/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      b4f2a17b
  15. 29 3月, 2012 1 次提交
  16. 27 7月, 2011 3 次提交
  17. 30 10月, 2010 1 次提交
    • R
      MIPS: Get rid of branches to .subsections. · 7837314d
      Ralf Baechle 提交于
      It was a nice optimization - on paper at least.  In practice it results in
      branches that may exceed the maximum legal range for a branch.  We can
      fight that problem with -ffunction-sections but -ffunction-sections again
      is incompatible with -pg used by the function tracer.
      
      By rewriting the loop around all simple LL/SC blocks to C we reduce the
      amount of inline assembler and at the same time allow GCC to often fill
      the branch delay slots with something sensible or whatever else clever
      optimization it may have up in its sleeve.
      
      With this optimization gone we also no longer need -ffunction-sections,
      so drop it.
      
      This optimization was originally introduced in 2.6.21, commit
      5999eca25c1fd4b9b9aca7833b04d10fe4bc877d (linux-mips.org) rsp.
      f65e4fa8 (kernel.org).
      
      Original fix for the issues which caused me to pull this optimization by
      Paul Gortmaker <paul.gortmaker@windriver.com>.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7837314d
  18. 05 10月, 2010 1 次提交
  19. 27 7月, 2010 1 次提交
  20. 17 5月, 2010 1 次提交
  21. 27 2月, 2010 1 次提交
  22. 18 9月, 2009 1 次提交
  23. 12 6月, 2009 1 次提交
  24. 31 1月, 2009 1 次提交
  25. 07 1月, 2009 1 次提交
  26. 11 10月, 2008 1 次提交
  27. 04 7月, 2008 1 次提交
    • R
      [MIPS] Fix bug in atomic_sub_if_positive. · 50952026
      Ralf Baechle 提交于
      The branch optimization fixes in 2.6.21 introduced a bug in
      atomic_sub_if_positive that causes it to return even when the sc
      instruction fails. The result is that e.g. down_trylock becomes unreliable
      as the semaphore counter is not always decremented.
      
      Original MUA-shredded patch from Morten Larsen <mlarsen@broadcom.com>.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      50952026
  28. 12 10月, 2007 1 次提交
  29. 21 7月, 2007 1 次提交
  30. 11 5月, 2007 1 次提交
  31. 09 5月, 2007 2 次提交
  32. 17 3月, 2007 1 次提交
  33. 14 2月, 2007 1 次提交
    • R
      [MIPS] Improve branch prediction in ll/sc atomic operations. · f65e4fa8
      Ralf Baechle 提交于
      Now that finally all supported versions of binutils have functioning
      support for .subsection use .subsection to tweak the branch prediction
      
      I did not modify the R10000 errata variants because it seems unclear if
      this will invalidate the workaround which actually relies on the cheesy
      prediction of branch likely to cause a misspredict if the sc was
      successful.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      f65e4fa8