Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268162

Re: [RFC][PATCH] mips: Fix arch_spin_unlock()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH] mips: Fix arch_spin_unlock()
Date 2015-11-12 19:10 +0100
Message-ID <qu4tP-3RE-21@gated-at.bofh.it> (permalink)
References <qtZku-rS-25@gated-at.bofh.it> <qu4at-3v0-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 12, 2015 at 09:46:53AM -0800, David Daney wrote:

> For CONFIG_CPU_CAVIUM_OCTEON the proper thing would be:
> 
>     smp_wmb();
>     smp_rmb();
> 
> Which expands to exactly the same thing as wmb() because smp_rmb() expands
> to nothing.

OK, so the current code isn't broken because for Cavium wmb is suffient
because rmb is a no-op, and for !Cavium wmb expands to SYNC.

> You yourself seem to have added smp_store_release(), so we could even do:
> 
>      smp_store_release(&lock->h.serving_now, lock->h.serving_now + 1);
> 
> That would leave us to cook up a proper definition of smp_store_release().

That is indeed the better solution.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] mips: Fix arch_spin_unlock() Peter Zijlstra <peterz@infradead.org> - 2015-11-12 13:40 +0100
  Re: [RFC][PATCH] mips: Fix arch_spin_unlock() Peter Zijlstra <peterz@infradead.org> - 2015-11-12 13:40 +0100
  Re: [RFC][PATCH] mips: Fix arch_spin_unlock() Måns Rullgård <mans@mansr.com> - 2015-11-12 14:40 +0100
  Re: [RFC][PATCH] mips: Fix arch_spin_unlock() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-11-12 15:40 +0100
    Re: [RFC][PATCH] mips: Fix arch_spin_unlock() Måns Rullgård <mans@mansr.com> - 2015-11-12 16:00 +0100
      Re: [RFC][PATCH] mips: Fix arch_spin_unlock() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-11-12 16:10 +0100
  Re: [RFC][PATCH] mips: Fix arch_spin_unlock() David Daney <ddaney@caviumnetworks.com> - 2015-11-12 18:50 +0100
    Re: [RFC][PATCH] mips: Fix arch_spin_unlock() Peter Zijlstra <peterz@infradead.org> - 2015-11-12 19:10 +0100
    Re: [RFC][PATCH] mips: Fix arch_spin_unlock() Måns Rullgård <mans@mansr.com> - 2015-11-12 19:20 +0100
      Re: [RFC][PATCH] mips: Fix arch_spin_unlock() David Daney <ddaney@caviumnetworks.com> - 2015-11-12 19:20 +0100

csiph-web