From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: linux-kernel@vger.kernel.org, linux@openrisc.net, jonas@southpole.se
Subject: Re: [PATCH 1/6] openrisc: add Kconfig for l.lwa and l.swa atomic instructions
Date: Thu, 24 Jul 2014 21:34:36 +0100 [thread overview]
Message-ID: <20140724213436.511e08ad@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <20140724195237.GA12313@chokladfabriken.org>
> I wasn't familiar with the alternatives logic before, so I had
> to look it up.
> Correct me if I'm wrong, but from what I gathered, the approach
> that takes is especially suitable to fixup instructions that
> are similar to each others but have slightly different properties
> (the lock prefix to cmpxchg being the canonical example).
You need some similarity or in some cases it makes sense to swap the
instruction with a call to a helper out of line, rather than taking the
hit on the traps and emulation.
> I guess it'd be *possible* to still use this method to implement
> alternatives that would work in the UP case by disabling
> context-switch and perform normal loads and stores in place
> of the l.lwa and l.swa instructions, but is it really a good approach?
We actually did that on the 386 when it was still supported as 386
lacked some of the more obscure atomic instructions. Some other platforms
use constructs of the form
do {
i = reschedule_count
do repeatable ops
}
while(reschedule_count != i)
for non irq safe locking ops rather than irq off/on. Another approach is
to use a section to gather all the out of line "atomic" operations - ie
all the helpers - and not reschedule if the return address is in the
"atomic" section.
Most of the other architectures we ask these questions and generate code
for "at least this feature set" but then also hide the detail, although I
imagine most openrisc users are smarter than the average.
Alan
next prev parent reply other threads:[~2014-07-24 20:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 21:18 [PATCH 0/6] openrisc: support " Stefan Kristiansson
2014-07-23 21:18 ` [PATCH 1/6] openrisc: add Kconfig " Stefan Kristiansson
2014-07-23 21:26 ` One Thousand Gnomes
2014-07-24 19:52 ` Stefan Kristiansson
2014-07-24 20:34 ` One Thousand Gnomes [this message]
2014-07-23 21:18 ` [PATCH 2/6] openrisc: add atomic bitops Stefan Kristiansson
2014-07-23 21:18 ` [PATCH 3/6] openrisc: add cmpxchg and xchg implementations Stefan Kristiansson
2014-07-23 21:18 ` [PATCH 4/6] openrisc: add atomic operations implementations Stefan Kristiansson
2014-07-23 21:18 ` [PATCH 5/6] openrisc: include l.swa in check for write data pagefault Stefan Kristiansson
2014-07-23 21:18 ` [PATCH 6/6] openrisc: add futex_atomic_* implementations Stefan Kristiansson
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=20140724213436.511e08ad@alan.etchedpixels.co.uk \
--to=gnomes@lxorguk.ukuu.org.uk \
--cc=jonas@southpole.se \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@openrisc.net \
--cc=stefan.kristiansson@saunalahti.fi \
/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®