From: Grant Grundler <grundler@parisc-linux.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>,
parisc-linux@parisc-linux.org
Subject: Re: [parisc-linux] coherent ops and mb() revisited
Date: Tue, 7 Sep 2004 09:17:22 -0600 [thread overview]
Message-ID: <20040907151722.GC18849@colo.lackof.org> (raw)
In-Reply-To: <1094480131.2037.6.camel@mulgrave>
On Mon, Sep 06, 2004 at 10:15:29AM -0400, James Bottomley wrote:
> On Mon, 2004-09-06 at 00:19, Grant Grundler wrote:
> > Actaully, I don't think it's irrelevant. If a lock is contended for,
> > re-ordering by gcc could excerbate the problem by adding additional
> > instructions (good for the instruction pipeline) to the "critical
> > section" (the period we actually hold the lock).
>
> But that's what placing the mb() after the spinlock code does: confines
> the critical section and prevents gcc reordering around it.
Maybe I'm just confused again. I was thinking gcc could move instructions
between the asm("ldcw") and mb(). And the same thing between
mb() and "lock = 1".
In other words, I'm worried about the "distance" bewteen lock/unlock
ops is greater than the "distance" between two mb() that contain
the critical section of code.
> > This is why I'm asking about use of "memory" in the actual
> > asm instruction that either acquire or release the lock
> > instead of using mb().
>
> You probably get slightly more confinement by using mb() instead of the
> "memory" clobber in __ldcw().
Erm, how?
Our mb() definition uses asm(:::"memory").
Is that different from using "memory" in the actual bit of assembly?
I just noticed set_eiem(), mtsp() and IRQ support in our system.h
do exactly what I proposed.
> What appeals to me is that the barrier in the spinlocks is explicit.
Yes, me tool.
But I'm suggesting those are superfluous when using "memory" in
the core asm() lock operations.
thanks,
grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next prev parent reply other threads:[~2004-09-07 15:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-05 1:38 [parisc-linux] coherent ops and mb() revisited Grant Grundler
2004-09-05 2:56 ` James Bottomley
2004-09-05 6:27 ` John David Anglin
2004-09-05 14:36 ` James Bottomley
2004-09-06 4:19 ` Grant Grundler
2004-09-06 9:24 ` John David Anglin
2004-09-06 14:15 ` James Bottomley
2004-09-07 15:17 ` Grant Grundler [this message]
2004-09-07 15:30 ` James Bottomley
2004-09-08 16:52 ` Grant Grundler
2004-09-08 17:11 ` James Bottomley
2004-09-10 16:11 ` Grant Grundler
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=20040907151722.GC18849@colo.lackof.org \
--to=grundler@parisc-linux.org \
--cc=James.Bottomley@SteelEye.com \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=parisc-linux@parisc-linux.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