| To: | Francois Romieu <romieu@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: fealnx oopses |
| From: | Denis Vlasenko <vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> |
| Date: | Sat, 27 Mar 2004 02:03:40 +0200 |
| Cc: | Jeff Garzik <jgarzik@xxxxxxxxx>, Andreas Henriksson <andreas@xxxxxxxxxxxx>, netdev@xxxxxxxxxxx |
| In-reply-to: | <20040326233514.B26347@electric-eye.fr.zoreil.com> |
| References: | <200403261214.58127.vda@port.imtp.ilyichevsk.odessa.ua> <200403270014.23088.vda@port.imtp.ilyichevsk.odessa.ua> <20040326233514.B26347@electric-eye.fr.zoreil.com> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
| User-agent: | KMail/1.5.4 |
On Saturday 27 March 2004 00:35, Francois Romieu wrote:
> Denis Vlasenko <vda@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> :
> [...]
>
> > Yes. But on x86 a++ is atomic vs interrupts - it's a single instruction
> > and interrupts happen on instruction boundaries only.
>
> Do you realize that you are saying that the CPU can atomically increment an
> integer which sits _in memory_ ?
Not exactly. CPU does not atomically increment memory.
I am saying that x86 CPU can't be interrupted in the middle
of read-modify-write operation, like
incl (%eax)
because it is single machine instruction. Interrupt either
happens before it, and handler see 'old' value, or after it,
and handler see 'new' value. Interrupt cannot happen 'inside' it.
Some RISC processors lack such single-instruction RMW ops.
Bug can thrigger on those CPUs:
load (%r1),r2
inc v2
<-------- interrupt here. Ouch!
store v2,(%r1)
Not on x86.
--
vda
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2.6] Update MAINTAINERS with new e100/e1000/ixgb maintainers, Scott Feldman |
|---|---|
| Next by Date: | Re: fealnx oopses, Francois Romieu |
| Previous by Thread: | Re: fealnx oopses, Francois Romieu |
| Next by Thread: | Re: fealnx oopses, Francois Romieu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |