mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT pull] Preparatory patch for semaphore cleanup
@ 2010-09-08 13:11 Thomas Gleixner
  2010-09-08 14:54 ` Linus Torvalds
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2010-09-08 13:11 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, Ingo Molnar, Peter Zijlstra

Linus,

Please pull the semaphore-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git semaphore-for-linus

This patch just provides the DEFINE_SEMAPHORE macro which is required
for the various subsystem cleanups I sent out, so we can finally get
rid of init_MUTEX[_LOCKED] in 2.6.37.

Thanks,

	tglx

------------------>
Thomas Gleixner (1):
      semaphore: Add DEFINE_SEMAPHORE


 include/linux/semaphore.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 7415839..5310d27 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -26,6 +26,9 @@ struct semaphore {
 	.wait_list	= LIST_HEAD_INIT((name).wait_list),		\
 }
 
+#define DEFINE_SEMAPHORE(name)	\
+	struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
+
 #define DECLARE_MUTEX(name)	\
 	struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 13:11 [GIT pull] Preparatory patch for semaphore cleanup Thomas Gleixner
@ 2010-09-08 14:54 ` Linus Torvalds
  2010-09-08 14:59   ` Peter Zijlstra
  2010-09-08 15:05   ` Thomas Gleixner
  0 siblings, 2 replies; 7+ messages in thread
From: Linus Torvalds @ 2010-09-08 14:54 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: Andrew Morton, LKML, Ingo Molnar, Peter Zijlstra

On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>
> This patch just provides the DEFINE_SEMAPHORE macro which is required
> for the various subsystem cleanups I sent out, so we can finally get
> rid of init_MUTEX[_LOCKED] in 2.6.37.

Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
DECLARE_MUTEX()?

IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
one is better than the other (maybe "define" is), but the mixing of
names is worse than either, I feel..

                     Linus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 14:54 ` Linus Torvalds
@ 2010-09-08 14:59   ` Peter Zijlstra
  2010-09-08 15:56     ` Ingo Molnar
  2010-09-08 15:05   ` Thomas Gleixner
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2010-09-08 14:59 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Thomas Gleixner, Andrew Morton, LKML, Ingo Molnar

On Wed, 2010-09-08 at 07:54 -0700, Linus Torvalds wrote:
> On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > This patch just provides the DEFINE_SEMAPHORE macro which is required
> > for the various subsystem cleanups I sent out, so we can finally get
> > rid of init_MUTEX[_LOCKED] in 2.6.37.
> 
> Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
> DECLARE_MUTEX()?
> 
> IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
> one is better than the other (maybe "define" is), but the mixing of
> names is worse than either, I feel..

The rest of the series, that Thomas didn't include in this pull, removes
all the DECLARE_MUTEX() users. So its temporary awkward-ness.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 14:54 ` Linus Torvalds
  2010-09-08 14:59   ` Peter Zijlstra
@ 2010-09-08 15:05   ` Thomas Gleixner
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2010-09-08 15:05 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, LKML, Ingo Molnar, Peter Zijlstra

On Wed, 8 Sep 2010, Linus Torvalds wrote:

> On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >
> > This patch just provides the DEFINE_SEMAPHORE macro which is required
> > for the various subsystem cleanups I sent out, so we can finally get
> > rid of init_MUTEX[_LOCKED] in 2.6.37.
> 
> Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
> DECLARE_MUTEX()?

DECLARE_MUTEX is what we want to get rid of. 

It's a misnomer as the semaphores are not longer used as mutexes and
the instantiation of a variable is not the declaration.
 
> IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
> one is better than the other (maybe "define" is), but the mixing of
> names is worse than either, I feel..

That's a temporary situaton until all users are gone, which will be in
the 37 merge window.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 14:59   ` Peter Zijlstra
@ 2010-09-08 15:56     ` Ingo Molnar
  2010-09-08 15:58       ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Ingo Molnar @ 2010-09-08 15:56 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Linus Torvalds, Thomas Gleixner, Andrew Morton, LKML


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, 2010-09-08 at 07:54 -0700, Linus Torvalds wrote:
> > On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > >
> > > This patch just provides the DEFINE_SEMAPHORE macro which is required
> > > for the various subsystem cleanups I sent out, so we can finally get
> > > rid of init_MUTEX[_LOCKED] in 2.6.37.
> > 
> > Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
> > DECLARE_MUTEX()?
> > 
> > IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
> > one is better than the other (maybe "define" is), but the mixing of
> > names is worse than either, I feel..
> 
> The rest of the series, that Thomas didn't include in this pull, removes
> all the DECLARE_MUTEX() users. So its temporary awkward-ness.

and DEFINE_MUTEX() is needed upstream so that we can spread those 
patches into a dozen maintainer trees. Once those flow upstream 
DECLARE_MUTEX() will be removed.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 15:56     ` Ingo Molnar
@ 2010-09-08 15:58       ` Peter Zijlstra
  2010-09-08 16:03         ` Ingo Molnar
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Zijlstra @ 2010-09-08 15:58 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, Thomas Gleixner, Andrew Morton, LKML

On Wed, 2010-09-08 at 17:56 +0200, Ingo Molnar wrote:
> * Peter Zijlstra <peterz@infradead.org> wrote:
> 
> > On Wed, 2010-09-08 at 07:54 -0700, Linus Torvalds wrote:
> > > On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > > >
> > > > This patch just provides the DEFINE_SEMAPHORE macro which is required
> > > > for the various subsystem cleanups I sent out, so we can finally get
> > > > rid of init_MUTEX[_LOCKED] in 2.6.37.
> > > 
> > > Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
> > > DECLARE_MUTEX()?
> > > 
> > > IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
> > > one is better than the other (maybe "define" is), but the mixing of
> > > names is worse than either, I feel..
> > 
> > The rest of the series, that Thomas didn't include in this pull, removes
> > all the DECLARE_MUTEX() users. So its temporary awkward-ness.
> 
> and DEFINE_MUTEX() is needed upstream so that we can spread those 

s/DEFINE_MUTEX/DEFINE_SEMAPHORE/

> patches into a dozen maintainer trees. Once those flow upstream 
> DECLARE_MUTEX() will be removed.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [GIT pull] Preparatory patch for semaphore cleanup
  2010-09-08 15:58       ` Peter Zijlstra
@ 2010-09-08 16:03         ` Ingo Molnar
  0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2010-09-08 16:03 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Linus Torvalds, Thomas Gleixner, Andrew Morton, LKML


* Peter Zijlstra <peterz@infradead.org> wrote:

> On Wed, 2010-09-08 at 17:56 +0200, Ingo Molnar wrote:
> > * Peter Zijlstra <peterz@infradead.org> wrote:
> > 
> > > On Wed, 2010-09-08 at 07:54 -0700, Linus Torvalds wrote:
> > > > On Wed, Sep 8, 2010 at 6:11 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > > > >
> > > > > This patch just provides the DEFINE_SEMAPHORE macro which is required
> > > > > for the various subsystem cleanups I sent out, so we can finally get
> > > > > rid of init_MUTEX[_LOCKED] in 2.6.37.
> > > > 
> > > > Why is it called DEFINE_SEMAPHORE(), when two lines later the we have
> > > > DECLARE_MUTEX()?
> > > > 
> > > > IOW, the whole DEFINE vs DECLARE thing seems confused. I'm not saying
> > > > one is better than the other (maybe "define" is), but the mixing of
> > > > names is worse than either, I feel..
> > > 
> > > The rest of the series, that Thomas didn't include in this pull, removes
> > > all the DECLARE_MUTEX() users. So its temporary awkward-ness.
> > 
> > and DEFINE_MUTEX() is needed upstream so that we can spread those 
> 
> s/DEFINE_MUTEX/DEFINE_SEMAPHORE/

Heh, i was demonstrating Linus's point ;-)

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-08 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 13:11 [GIT pull] Preparatory patch for semaphore cleanup Thomas Gleixner
2010-09-08 14:54 ` Linus Torvalds
2010-09-08 14:59   ` Peter Zijlstra
2010-09-08 15:56     ` Ingo Molnar
2010-09-08 15:58       ` Peter Zijlstra
2010-09-08 16:03         ` Ingo Molnar
2010-09-08 15:05   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®