From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbdGATXL (ORCPT ); Sat, 1 Jul 2017 15:23:11 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35701 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751911AbdGATXI (ORCPT ); Sat, 1 Jul 2017 15:23:08 -0400 Subject: Re: [PATCH RFC 06/26] ipc: Replace spin_unlock_wait() with lock/unlock pair To: "Paul E. McKenney" , linux-kernel@vger.kernel.org Cc: netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, oleg@redhat.com, akpm@linux-foundation.org, mingo@redhat.com, dave@stgolabs.net, tj@kernel.org, arnd@arndb.de, linux-arch@vger.kernel.org, will.deacon@arm.com, peterz@infradead.org, stern@rowland.harvard.edu, parri.andrea@gmail.com, torvalds@linux-foundation.org References: <20170629235918.GA6445@linux.vnet.ibm.com> <1498780894-8253-6-git-send-email-paulmck@linux.vnet.ibm.com> From: Manfred Spraul Message-ID: Date: Sat, 1 Jul 2017 21:23:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1498780894-8253-6-git-send-email-paulmck@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/30/2017 02:01 AM, Paul E. McKenney wrote: > There is no agreed-upon definition of spin_unlock_wait()'s semantics, > and it appears that all callers could do just as well with a lock/unlock > pair. This commit therefore replaces the spin_unlock_wait() call in > exit_sem() with spin_lock() followed immediately by spin_unlock(). > This should be safe from a performance perspective because exit_sem() > is rarely invoked in production. > > Signed-off-by: Paul E. McKenney > Cc: Andrew Morton > Cc: Davidlohr Bueso > Cc: Manfred Spraul > Cc: Will Deacon > Cc: Peter Zijlstra > Cc: Alan Stern > Cc: Andrea Parri > Cc: Linus Torvalds Acked-by: Manfred Spraul > --- > ipc/sem.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/ipc/sem.c b/ipc/sem.c > index 947dc2348271..e88d0749a929 100644 > --- a/ipc/sem.c > +++ b/ipc/sem.c > @@ -2096,7 +2096,8 @@ void exit_sem(struct task_struct *tsk) > * possibility where we exit while freeary() didn't > * finish unlocking sem_undo_list. > */ > - spin_unlock_wait(&ulp->lock); > + spin_lock(&ulp->lock); > + spin_unlock(&ulp->lock); > rcu_read_unlock(); > break; > }