From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Oliver Neukum <oliver@neukum.org>
Cc: Arjan van de Ven <arjan@infradead.org>,
Alan Stern <stern@rowland.harvard.edu>,
linux-usb-devel@lists.sourceforge.net,
Eduardo Pereira Habkost <ehabkost@mandriva.com>,
Greg KH <gregkh@suse.de>,
Luiz Fernando Capitulino <lcapitulino@mandriva.com.br>,
linux-kernel@vger.kernel.org
Subject: Re: [linux-usb-devel] Re: [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t.
Date: Wed, 07 Dec 2005 16:02:07 +0000 [thread overview]
Message-ID: <1133971327.544.75.camel@localhost.localdomain> (raw)
In-Reply-To: <200512071650.01439.oliver@neukum.org>
On Mer, 2005-12-07 at 16:50 +0100, Oliver Neukum wrote:
> But the atomic variant has to guard against interrupts, at least on
> architectures that do load/store only, hasn't it?
Yes. And you will see at least four different approaches
1. ll/sc where if the sequence was interrupted and may be stale it gets
retried
2. locked operations where the IRQ cannot split the sequence and use of
3. spin locks to provide atomic operations where there are architecture
limits
4. Use of instructions acting on memory where the CPU in question has
them and (as is usual in processors) does not permit an IRQ mid
instruction.
Thus on x86
*foo++
might be atomic, might not on uniprocessor v interrupt solely because
the compiler chooses the operations. Atomic_inc however merely has to
use asm to force an inc of a memory location target. That instruction
cannot be split part way by an interrupt so is sufficient.
Relative efficiency of spin_lock versus atomic_foo is very platform
dependant.
next prev parent reply other threads:[~2005-12-07 16:03 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-06 11:56 [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t Luiz Fernando Capitulino
2005-12-06 19:40 ` Greg KH
2005-12-06 20:13 ` Eduardo Pereira Habkost
2005-12-06 22:48 ` [linux-usb-devel] " Oliver Neukum
2005-12-07 12:24 ` Luiz Fernando Capitulino
2005-12-07 12:27 ` Arjan van de Ven
2005-12-07 12:30 ` Luiz Fernando Capitulino
2005-12-07 12:34 ` Arjan van de Ven
2005-12-07 12:41 ` Luiz Fernando Capitulino
2005-12-07 12:54 ` Luiz Fernando Capitulino
2005-12-07 15:07 ` Alan Stern
2005-12-07 15:22 ` Arjan van de Ven
2005-12-07 15:37 ` Oliver Neukum
2005-12-07 15:40 ` Arjan van de Ven
2005-12-07 15:50 ` Oliver Neukum
2005-12-07 16:02 ` Alan Cox [this message]
2005-12-07 16:00 ` Eduardo Pereira Habkost
2005-12-07 16:02 ` Arjan van de Ven
2005-12-07 16:23 ` Eduardo Pereira Habkost
2005-12-07 16:01 ` Alan Stern
2005-12-07 16:04 ` Arjan van de Ven
2005-12-07 15:32 ` linux-os (Dick Johnson)
2005-12-07 16:08 ` Alan Stern
2005-12-06 20:14 ` Luiz Fernando Capitulino
2005-12-06 21:02 ` Pete Zaitcev
2005-12-06 21:18 ` Luiz Fernando Capitulino
2005-12-06 22:36 ` [linux-usb-devel] " Oliver Neukum
2005-12-07 12:25 ` Luiz Fernando Capitulino
2005-12-07 13:01 ` Oliver Neukum
2005-12-07 13:17 ` Luiz Fernando Capitulino
2005-12-07 16:41 ` Greg KH
2005-12-07 16:51 ` Luiz Fernando Capitulino
2005-12-07 17:13 ` Eduardo Pereira Habkost
2005-12-07 17:56 ` Greg KH
2005-12-07 19:10 ` Eduardo Pereira Habkost
2005-12-07 16:55 ` Otavio Salvador
2005-12-07 16:59 ` Greg KH
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=1133971327.544.75.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=ehabkost@mandriva.com \
--cc=gregkh@suse.de \
--cc=lcapitulino@mandriva.com.br \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=oliver@neukum.org \
--cc=stern@rowland.harvard.edu \
/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