From: Arjan van de Ven <arjan@infradead.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Ingo Molnar <mingo@elte.hu>, Ingo Oeser <ioe-lkml@rameria.de>,
linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Linus Torvalds <torvalds@osdl.org>,
Jes Sorensen <jes@trained-monkey.org>, Greg KH <greg@kroah.com>,
chaosite@gmail.com
Subject: Re: [patch 00/62] sem2mutex: -V1
Date: Fri, 13 Jan 2006 23:13:24 +0100 [thread overview]
Message-ID: <1137190404.2975.17.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <7v64on3hlb.fsf@assigned-by-dhcp.cox.net>
On Fri, 2006-01-13 at 14:09 -0800, Junio C Hamano wrote:
> Arjan van de Ven <arjan@infradead.org> writes:
>
> > On Fri, 2006-01-13 at 23:04 +0200, Matan Peled wrote:
> >> Ingo Molnar wrote:
> >> > Ingo Oeser wrote:
> >> >> Could we get for each of these and a mutex:
> >> >>
> >> >> - description
> >> >> - common use case
> >> >> - small argument why this and nothing else should be used there
> >> >
> >> > like ... Documentation/mutex-design.txt?
> >>
> >> I think what he wanted was an explanation for the change of each and every
> >> sem... Which is kind of hard with automated tools.
> > `
> > it's also HIGHLY repetitive.
> > 1) The process is : Look at semaphore and it's uses.
> > 2) Decide it's a mutex
> > 3) Run script to convert to mutex
> > 4) Run script to validate the conversion
> > 5) build+boot test
> >
> > I can't think of a way to describe that uniquely different for each
> > one ;0
>
> I do not read Ingo Oeser's request as such, but if somebody does
> 1) and 2), ideally, the knowledge obtained during that process,
> i.e. what is being protected and what the invariants are, and
> the reasoning why it is a mutex, could serve as a good
> documentation for people who want to further work on that code
> being converted to use mutex.
Again that is almost a generic answer, the *vast* majority of
mutex-semaphores is used in such a way that the down() and up() are
always in the same function, eg the pattern is
down(semaphore);
do_stuff();
up(semaphore);
all the time. That's then a mutex... and the most basic use pattern.
Sure this isn't always the case but it's very common.
(there have been 2 cases that accidentally did
up(semaphore);
do_stuff();
down(semaphore);
.. which is legal with semaphores but not what was intended ;)
next prev parent reply other threads:[~2006-01-13 22:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-13 12:44 Ingo Molnar
2006-01-13 12:59 ` Duncan Sands
2006-01-13 13:06 ` Arjan van de Ven
2006-01-13 13:44 ` Ingo Molnar
2006-01-13 18:25 ` Ingo Oeser
2006-01-13 19:56 ` Ingo Molnar
2006-01-13 21:04 ` Matan Peled
2006-01-13 21:25 ` Arjan van de Ven
2006-01-13 22:09 ` Junio C Hamano
2006-01-13 22:13 ` Arjan van de Ven [this message]
2006-01-14 13:22 ` Ingo Oeser
2006-01-14 13:49 ` Thomas Gleixner
2006-01-14 13:16 ` Ingo Oeser
2006-01-14 13:31 ` Arjan van de Ven
2006-01-14 13:38 ` Ingo Molnar
2006-01-13 13:23 ` 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=1137190404.2975.17.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=akpm@osdl.org \
--cc=chaosite@gmail.com \
--cc=greg@kroah.com \
--cc=ioe-lkml@rameria.de \
--cc=jes@trained-monkey.org \
--cc=junkio@cox.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@osdl.org \
/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
all inboxes | Powered by JetHome®