]> git.baikalelectronics.ru Git - kernel.git/commit
ARC: switch to generic bitops
authorVineet Gupta <vgupta@kernel.org>
Tue, 4 Sep 2018 23:11:29 +0000 (16:11 -0700)
committerVineet Gupta <vgupta@kernel.org>
Tue, 24 Aug 2021 21:25:47 +0000 (14:25 -0700)
commit9b57142fbfd68ae902167c1987698fb6610b1fcc
treedfbe07ea6a98e506ce05ad8138dff5b0f66e5f42
parent1786548d9c82831a2cc10d12f4e7018a3bdf8140
ARC: switch to generic bitops

 - !LLSC now only needs a single spinlock for atomics and bitops

 - Some codegen changes (slight bloat) with generic bitops

   1. code increase due to LD-check-atomic paradigm vs. unconditonal
      atomic (but dirty'ing the cache line even if set already).
      So despite increase, generic is right thing to do.

   2. code decrease (but use of costlier instructions such as DIV vs.
      shifts based math) due to signed arithmetic.
      This needs to be revisited seperately.

     arc:
     static inline int test_bit(unsigned int nr, const volatile unsigned long *addr)
                                ^^^^^^^^^^^^
     generic:
     static inline int test_bit(int nr, const volatile unsigned long *addr)
                                ^^^

Link: https://lore.kernel.org/r/20180830135749.GA13005@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
[vgupta: wrote patch based on Will's poc, analysed codegen diffs]
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
arch/arc/include/asm/bitops.h
arch/arc/include/asm/smp.h
arch/arc/kernel/smp.c