From: Linus Torvalds <torvalds@linux-foundation.org>
To: Will Deacon <will.deacon@arm.com>
Cc: Jason Wessel <jason.wessel@windriver.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
kgdb-bugreport@lists.sourceforge.net,
Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: RE: [PATCH 4/5] kgdb: Use atomic operators which use barriers
Date: Thu, 8 Apr 2010 07:55:12 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.00.1004080746330.3586@i5.linux-foundation.org> (raw)
In-Reply-To: <000501cad70a$26ca7e10$745f7a30$@deacon@arm.com>
On Thu, 8 Apr 2010, Will Deacon wrote:
>
> I simply used smp_mb() as a way to solve this ARM-specific problem. I think
> Russell objects to this largely because this problem affects a particular
> scenario of busy-wait loops and changing the definition of cpu_relax() adds
> barriers to code that doesn't necessarily require them.
How expensive is a smp_mb() on arm?
And by "expensive" I don't mean so much performance of the instruction
itself (after all, we _are_ just busy-looping), but more about things like
power and perhaps secondary effects (does it cause memory traffic, for
example?).
Also, I have to say that _usually_ the problem with non-timely cache
updates in not on the reading side, but on the writing side - ie the other
CPU may be buffering writes indefinitely and the writes will go out only
as a response to bus cycles or the write buffers filling up. In which case
the reader can't really do much about it.
But your comment for the "smp_mb()" patch seems to imply that it's
literally a matter of cache access priorities:
"On the ARM11MPCore processor [where loads are prioritised over stores],
spinning in such a loop will prevent the write buffer from draining."
and in that case I would say that the correct thing _definitely_ is to
make sure that the loop simply is never so tight that. Maybe you can do
that without an smp_mb(), by just making whatever "cpu_relax()" does slow
enough (something that stalls the pipeline or whatever?)
But if smp_mb() is cheap, then that sounds like the right solution.
Linus
prev parent reply other threads:[~2010-04-08 14:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 18:32 [GIT PULL] kgdb fixes for 2.6.34-rc3 Jason Wessel
2010-04-02 18:32 ` [PATCH 1/5] kgdb: have ebin2mem call probe_kernel_write once Jason Wessel
2010-04-02 18:32 ` [PATCH 2/5] kgdbts,sh: Add in breakpoint pc offset for superh Jason Wessel
2010-04-02 18:32 ` [PATCH 3/5] kgdb: eliminate kgdb_wait(), all cpus enter the same way Jason Wessel
2010-04-02 18:32 ` [PATCH 4/5] kgdb: Use atomic operators which use barriers Jason Wessel
2010-04-02 18:32 ` [PATCH 5/5] kgdb: Turn off tracing while in the debugger Jason Wessel
2010-04-02 19:12 ` [PATCH 4/5] kgdb: Use atomic operators which use barriers Linus Torvalds
2010-04-02 19:37 ` Jason Wessel
2010-04-02 19:43 ` Linus Torvalds
2010-04-02 19:46 ` Linus Torvalds
2010-04-02 20:07 ` Linus Torvalds
2010-04-02 22:25 ` Russell King - ARM Linux
2010-04-02 23:24 ` Linus Torvalds
2010-04-03 16:08 ` Russell King - ARM Linux
2010-04-05 9:21 ` Pavel Machek
2010-04-05 14:56 ` Linus Torvalds
2010-04-02 19:47 ` [Kgdb-bugreport] [PATCH 4/5] kgdb: Use atomic operators whichuse barriers Jason Wessel
2010-04-02 19:47 ` Linus Torvalds
2010-04-02 20:00 ` Jason Wessel
2010-04-08 16:27 ` Dmitry Adamushko
2010-04-19 15:21 ` Will Deacon
[not found] ` <000501cad70a$26ca7e10$745f7a30$@deacon@arm.com>
2010-04-08 14:55 ` Linus Torvalds [this message]
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=alpine.LFD.2.00.1004080746330.3586@i5.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=will.deacon@arm.com \
/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®