From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752448AbaESWjn (ORCPT ); Mon, 19 May 2014 18:39:43 -0400 Received: from g4t3427.houston.hp.com ([15.201.208.55]:27133 "EHLO g4t3427.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751801AbaESWjm (ORCPT ); Mon, 19 May 2014 18:39:42 -0400 Message-ID: <1400539179.6399.7.camel@buesod1.americas.hpqcorp.net> Subject: Re: [tip:locking/core] rwsem: Support optimistic spinning From: Davidlohr Bueso To: mingo@kernel.org Cc: torvalds@linux-foundation.org, peterz@infradead.org, peter@hurleysoftware.com, jason.low2@hp.com, alex.shi@linaro.org, riel@redhat.com, akpm@linux-foundation.org, aarcange@redhat.com, tglx@linutronix.de, scott.norton@hp.com, linux-kernel@vger.kernel.org, hpa@zytor.com, andi@firstfloor.org, tim.c.chen@linux.intel.com, paulmck@linux.vnet.ibm.com, walken@google.com, aswin@hp.com, linux-tip-commits@vger.kernel.org Date: Mon, 19 May 2014 15:39:39 -0700 In-Reply-To: <1400536056.6399.3.camel@buesod1.americas.hpqcorp.net> References: <1399055055.6275.15.camel@buesod1.americas.hpqcorp.net> <1400536056.6399.3.camel@buesod1.americas.hpqcorp.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4 (3.6.4-3.fc18) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2014-05-19 at 14:47 -0700, Davidlohr Bueso wrote: > Andrew had put this patch in -next for a while, and Stephen Rothwell was > able to trigger some warnings: https://lkml.org/lkml/2014/5/19/627 > > 8<---------------------------------------------------------------- > From: Davidlohr Bueso > Subject: [PATCH] rwsem: Fix warnings for CONFIG_RWSEM_GENERIC_SPINLOCK > > Optimistic spinning is only used by the xadd variant > of rw-semaphores. Make sure that we use the old version > of the __RWSEM_INITIALIZER macro for systems that rely > on the spinlock one, otherwise warnings can be triggered, > such as the following reported on an arm box: > > ipc/ipcns_notifier.c:22:8: warning: excess elements in struct initializer [enabled by default] > ipc/ipcns_notifier.c:22:8: warning: (near initialization for 'ipcns_chain.rwsem') [enabled by default] > ipc/ipcns_notifier.c:22:8: warning: excess elements in struct initializer [enabled by default] > ipc/ipcns_notifier.c:22:8: warning: (near initialization for 'ipcns_chain.rwsem') [enabled by default] > > Signed-off-by: Davidlohr Bueso > --- > include/linux/rwsem.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h > index 3e108f1..091d993 100644 > --- a/include/linux/rwsem.h > +++ b/include/linux/rwsem.h > @@ -64,7 +64,7 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) > # define __RWSEM_DEP_MAP_INIT(lockname) > #endif > > -#ifdef CONFIG_SMP > +#if defined(CONFIG_SMP) && defined(CONFIG_RWSEM_XCHGADD_ALGORITHM) Of course, we can also use the following. I have no preference. #if defined(CONFIG_SMP) && !defined(CONFIG_RWSEM_GENERIC_SPINLOCK)