Skip to content

Commit

Permalink
MIPS: Replace smp_mb with release barrier function in unlocks.
Browse files Browse the repository at this point in the history
Repleace smp_mb() in arch_write_unlock() and __clear_bit_unlock() to
smp_mb__before_llsc() call which does "release" barrier functionality.

It seems like it was missed in commit f252ffd
during introduction of "acquire" and "release" semantics.

[ralf@linux-mips: The original patch submission was labelled a fix but
actually it replaces a barrier with another less restrictive type of
barrier so it doesn't fix any ill behaviour but rather squeezes out a
tad better performance.  Further improvments will be possible once
smp_release() has been merged.]

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: benh@kernel.crashing.org
Cc: will.deacon@arm.com
Cc: linux-kernel@vger.kernel.org
Cc: markos.chandras@imgtec.com
Cc: macro@linux-mips.org
Cc: Steven.Hill@imgtec.com
Cc: alexander.h.duyck@redhat.com
Cc: davem@davemloft.net
Patchwork: https://patchwork.linux-mips.org/patch/10507/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Leonid Yegoshin authored and Ralf Baechle committed Jun 21, 2015
1 parent 5f93ef5 commit 6f6ed48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ static inline int test_and_change_bit(unsigned long nr,
*/
static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *addr)
{
smp_mb();
smp_mb__before_llsc();
__clear_bit(nr, addr);
}

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/asm/spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static inline void arch_write_lock(arch_rwlock_t *rw)

static inline void arch_write_unlock(arch_rwlock_t *rw)
{
smp_mb();
smp_mb__before_llsc();

__asm__ __volatile__(
" # arch_write_unlock \n"
Expand Down

0 comments on commit 6f6ed48

Please sign in to comment.