Re: [PATCH 11/12] Generic semaphore implementation

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Matthew Wilcox <matthew@...>
Cc: <linux-kernel@...>, Matthew Wilcox <willy@...>, <linux-arch@...>
Date: Thursday, February 28, 2008 - 9:57 pm

On Thu, 28 Feb 2008 01:34:00 -0500 Matthew Wilcox <matthew@wil.cx> wrote:


This make all architectures use the lib/semaphore-sleepers.c
implementation.  The major difference is that down() and up() will now
unconditionally do a spin_lock_irq[save]() on the not-contended fastpath,
whereas the hand-optimised arch-specific implementations would avoid that.

Yes, hopefully not many sempahores are used on fastpaths any more, and a
suitable fix for any which _are_ so used is usually convert-to-mutex.

And spin_lock_irqsave() probably isn't hugely slower than an atomic-dec
anyway.



A few nits, most or all of which pertain to the old code:


We conventionally do `static inline void' rather than `static void inline',
so I guess we should do `static noinline void' too.


Some functions leave no blank line between end-of-locals and start-of-code...


whereas some others do leave a blank line.

I think the 51% consensus is that the latter form is preferred.


hm.  Do we need a barrier here?


That is one huuuuuuuge inline.  Are we sure it's justified?

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCHES] semaphore rewrite, Matthew Wilcox, (Tue Feb 26, 8:36 pm)
[PATCH 01/12] Fix quota.h includes, Matthew Wilcox, (Thu Feb 28, 2:33 am)
[PATCH 02/12] Add semaphore.h to kernel_lock.c, Matthew Wilcox, (Thu Feb 28, 2:33 am)
[PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Thu Feb 28, 2:34 am)
Re: [PATCH 11/12] Generic semaphore implementation, Harvey Harrison, (Thu Feb 28, 10:37 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Mon Mar 3, 10:54 am)
[PATCH] semaphore: remove likely/unlikely annotations, Harvey Harrison, (Thu Feb 28, 10:47 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Andrew Morton, (Thu Feb 28, 9:57 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Fri Feb 29, 1:43 am)
Re: [PATCH 11/12] Generic semaphore implementation, Ingo Molnar, (Thu Feb 28, 3:18 am)
Re: [PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Thu Feb 28, 8:39 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Stephen Rothwell, (Thu Feb 28, 10:00 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Linus Torvalds, (Fri Feb 29, 12:14 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Andrew Morton, (Thu Feb 28, 10:10 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Stephen Rothwell, (Fri Feb 29, 2:43 am)
Re: [PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Fri Feb 29, 1:32 am)
Re: [PATCH 11/12] Generic semaphore implementation, Andrew Morton, (Thu Feb 28, 9:43 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Ingo Molnar, (Fri Feb 29, 3:21 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Haavard Skinnemoen, (Fri Feb 29, 1:42 pm)
Re: [PATCH 11/12] Generic semaphore implementation, Matthew Wilcox, (Fri Feb 29, 1:30 am)
Re: [PATCH 11/12] Generic semaphore implementation, Harvey Harrison, (Thu Feb 28, 8:50 pm)