From: Joel Schopp <jschopp@austin.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: lkml <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
Arjan van de Ven <arjan@infradead.org>,
Nicolas Pitre <nico@cam.org>,
Jes Sorensen <jes@trained-monkey.org>,
Al Viro <viro@ftp.linux.org.uk>, Oleg Nesterov <oleg@tv-sign.ru>,
David Howells <dhowells@redhat.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
Russell King <rmk+lkml@arm.linux.org.uk>,
Anton Blanchard <anton@samba.org>
Subject: Re: [patch 00/21] mutex subsystem, -V14
Date: Wed, 04 Jan 2006 17:45:25 -0600 [thread overview]
Message-ID: <43BC5E15.207@austin.ibm.com> (raw)
In-Reply-To: <20060104144151.GA27646@elte.hu>
> this is version 14 of the generic mutex subsystem, against v2.6.15.
>
> The patch-queue consists of 21 patches, which can also be downloaded
> from:
>
> http://redhat.com/~mingo/generic-mutex-subsystem/
>
Took a glance at this on ppc64. Would it be useful if I contributed an arch
specific version like arm has? We'll either need an arch specific version or
have the generic changed.
Anyway, here is some disassembly of some of the code generated with my comments:
c00000000049bf9c <.mutex_lock>:
c00000000049bf9c: 7c 00 06 ac eieio
c00000000049bfa0: 7d 20 18 28 lwarx r9,r0,r3
c00000000049bfa4: 31 29 ff ff addic r9,r9,-1
c00000000049bfa8: 7d 20 19 2d stwcx. r9,r0,r3
c00000000049bfac: 40 c2 ff f4 bne+ c00000000049bfa0 <.mutex_lock+0x4>
c00000000049bfb0: 4c 00 01 2c isync
c00000000049bfb4: 7d 20 4b 78 mr r0,r9
c00000000049bfb8: 78 09 0f e3 rldicl. r9,r0,33,63
c00000000049bfbc: 4d 82 00 20 beqlr
c00000000049bfc0: 4b ff ff 58 b c00000000049bf18
<.__mutex_lock_noinline>
The eieio is completly unnecessary, it got picked up from atomic_dec_return
(Anton, why is there an eieio at the start of atomic_dec_return in the first
place?).
Ignore the + on the bne, the disassembler is wrong, it is really a -
c00000000049bfc4 <.mutex_unlock>:
c00000000049bfc4: 7c 00 06 ac eieio
c00000000049bfc8: 7d 20 18 28 lwarx r9,r0,r3
c00000000049bfcc: 31 29 00 01 addic r9,r9,1
c00000000049bfd0: 7d 20 19 2d stwcx. r9,r0,r3
c00000000049bfd4: 40 c2 ff f4 bne+ c00000000049bfc8 <.mutex_unlock+0x4>
c00000000049bfd8: 4c 00 01 2c isync
c00000000049bfdc: 7d 20 07 b4 extsw r0,r9
c00000000049bfe0: 2c 00 00 00 cmpwi r0,0
c00000000049bfe4: 4d 81 00 20 bgtlr
c00000000049bfe8: 4b ff ff 40 b c00000000049bf28
<.__mutex_unlock_noinline>
That eieio should be an lwsync to avoid data corruption. And I think the isync
is superfluous.
Ditto the disassembler being wrong about the + vs -.
next prev parent reply other threads:[~2006-01-04 23:45 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 14:41 [patch 00/21] mutex subsystem, -V14 Ingo Molnar
2006-01-04 23:45 ` Joel Schopp [this message]
2006-01-05 2:38 ` Nicolas Pitre
2006-01-05 2:51 ` Linus Torvalds
2006-01-05 3:21 ` Nick Piggin
2006-01-05 3:39 ` Anton Blanchard
2006-01-05 18:04 ` Jesse Barnes
2006-01-05 14:40 ` Ingo Molnar
2006-01-05 16:21 ` Linus Torvalds
2006-01-05 22:03 ` Ingo Molnar
2006-01-05 22:17 ` Linus Torvalds
2006-01-05 22:43 ` Ingo Molnar
2006-01-06 3:49 ` Keith Owens
2006-01-06 7:34 ` Denis Vlasenko
2006-01-05 14:35 ` Ingo Molnar
2006-01-05 16:42 ` Joel Schopp
2006-01-05 22:21 ` Ingo Molnar
2006-01-05 23:06 ` Joel Schopp
2006-01-05 23:26 ` Linus Torvalds
2006-01-05 23:36 ` Joel Schopp
2006-01-05 23:42 ` Ingo Molnar
2006-01-06 0:29 ` Olof Johansson
2006-01-07 17:49 ` PowerPC fastpaths for mutex subsystem Joel Schopp
2006-01-07 22:37 ` Andrew Morton
2006-01-08 7:43 ` Anton Blanchard
2006-01-08 8:00 ` Andrew Morton
2006-01-08 8:23 ` Anton Blanchard
2006-01-09 11:13 ` David Howells
2006-01-08 9:48 ` Ingo Molnar
2006-01-10 22:31 ` Joel Schopp
2006-01-10 23:09 ` Ingo Molnar
2006-01-11 10:52 ` Ingo Molnar
2006-01-11 17:44 ` Joel Schopp
2006-01-08 10:43 ` 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=43BC5E15.207@austin.ibm.com \
--to=jschopp@austin.ibm.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=anton@samba.org \
--cc=arjan@infradead.org \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=jes@trained-monkey.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nico@cam.org \
--cc=oleg@tv-sign.ru \
--cc=rmk+lkml@arm.linux.org.uk \
--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