[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGQ1y=6KSQaSfv4yHp4S1vbDHR2Osa+XpCyk7w9-SbPMpnae6Q@mail.gmail.com>
Date: Mon, 19 May 2014 16:14:22 -0700
From: Jason Low <jason.low2@...com>
To: Davidlohr Bueso <davidlohr@...com>
Cc: Ingo Molnar <mingo@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Peter Hurley <peter@...leysoftware.com>,
Jason Low <jason.low2@...com>, Alex Shi <alex.shi@...aro.org>,
Rik van Riel <riel@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Norton, Scott J" <scott.norton@...com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>, Andi Kleen <andi@...stfloor.org>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Paul McKenney <paulmck@...ux.vnet.ibm.com>,
Michel Lespinasse <walken@...gle.com>,
"Chandramouleeswaran, Aswin" <aswin@...com>,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:locking/core] rwsem: Support optimistic spinning
On Mon, May 19, 2014 at 3:39 PM, Davidlohr Bueso <davidlohr@...com> wrote:
> 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 <davidlohr@...com>
>> 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 <davidlohr@...com>
>> ---
>> 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)
So if given the choice between the 2, I think checking
!CONFIG_RWSEM_GENERIC_SPINLOCK is better just because we use that to
decide the implementation/structure layout.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists