From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>,
Andrew Morton <akpm@osdl.org>,
Arjan van de Ven <arjanv@infradead.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
David Howells <dhowells@redhat.com>,
Alexander Viro <viro@ftp.linux.org.uk>,
Oleg Nesterov <oleg@tv-sign.ru>, Paul Jackson <pj@sgi.com>
Subject: Re: [patch 10/15] Generic Mutex Subsystem, mutex-migration-helper-core.patch
Date: Mon, 19 Dec 2005 09:25:37 -0500 [thread overview]
Message-ID: <1135002337.13138.255.camel@localhost.localdomain> (raw)
In-Reply-To: <20051219013837.GF28038@elte.hu>
On Mon, 2005-12-19 at 02:38 +0100, Ingo Molnar wrote:
> Index: linux/include/linux/mutex.h
> ===================================================================
> --- linux.orig/include/linux/mutex.h
> +++ linux/include/linux/mutex.h
Maybe this should be in its own mutex-debug.h file with a:
#ifndef __LIUNX_MUTEX_H
# error Do not include this file directly, use mutex.h
#endif
> @@ -99,4 +99,120 @@ extern int FASTCALL(mutex_trylock(struct
> extern void FASTCALL(mutex_unlock(struct mutex *lock));
> extern int FASTCALL(mutex_is_locked(struct mutex *lock));
>
> +/*
> + * Debugging variant of mutexes. The only difference is that they
> accept
Also, add a comment here that mutex_debug should NOT be used directly.
This may seem obvious, but new Linux kernel programmers may just be
scanning the code for what they would like to use and add it. At least
let them know (although it may seem obvious) that this is just a
temporary structure that will go away soon, and if they want to use
mutexes, then use mutex, and don't be tempted to have a mutex up/down.
OK, I'm watching out for the idiots, but since I'm one every so often, I
hope someone watches out for me ;-)
-- Steve
> + * the semaphore APIs too:
> + */
> +struct mutex_debug {
> + struct mutex lock;
> +};
> +
> +#define DEFINE_MUTEX_DEBUG(mutexname) \
> + struct mutex_debug mutexname = \
> + { .lock = __MUTEX_INITIALIZER(mutexname.lock) }
> +
next prev parent reply other threads:[~2005-12-19 14:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-19 1:38 [patch 10/15] Generic Mutex Subsystem, mutex-migration-helper-core.patch Ingo Molnar
2005-12-19 14:12 ` Steven Rostedt
2005-12-19 16:38 ` Ingo Molnar
2005-12-19 14:16 ` Steven Rostedt
2005-12-19 16:39 ` Ingo Molnar
2005-12-19 14:25 ` Steven Rostedt [this message]
2005-12-19 16:41 ` Ingo Molnar
2005-12-19 15:00 ` Christoph Hellwig
2005-12-19 15:35 ` Steven Rostedt
2005-12-20 4:48 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1135002337.13138.255.camel@localhost.localdomain \
--to=rostedt@goodmis.org \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjanv@infradead.org \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=pj@sgi.com \
--cc=torvalds@osdl.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox