Re: [patch] Re: using long instead of atomic_t when only set/read is required

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rafael J. Wysocki <rjw@...>
Cc: Pavel Machek <pavel@...>, Alan Cox <alan@...>, Alan Stern <stern@...>, Linus Torvalds <torvalds@...>, Andrew Morton <akpm@...>, Zdenek Kabelac <zdenek.kabelac@...>, <davem@...>, Pierre Ossman <drzeus-mmc@...>, Kernel development list <linux-kernel@...>, pm list <linux-pm@...>
Date: Monday, March 3, 2008 - 5:12 pm

On Mon, Mar 03, 2008 at 09:27:29PM +0100, Rafael J. Wysocki wrote:

Most rcu_assign_pointer() calls are protected by locks, but there might
be a few that are not.  However, the case that concerns me most would be
the following:

o	Task 0 writes the lower 16 bits of the pointer.

o	Task 1 reads the lower 16 bits of the pointer.

o	Task 1 reads the upper 16 bits of the pointer.

o	Task 0 writes the upper 16 bits of the pointer.

This would result in task 1 getting a mish-mash of the old and new
versions of the pointer.  Very bad!!!  RCU heavily relies on the reader
seeing either the initial value of the pointer or on the value written
by some single write.

But doesn't this require a -multi-CPU- system with a 16-bit data path
from the ALU to the L0 cache?  This seems a bit unlikely.  Or am I being
naive about embedded CPUs?

On the other hand, if you have a 32-bit single-CPU system with a 16-bit
path to memory, all we need is that interrupts be restricted to happening
at instruction boundaries rather than in the middle of instructions.

							Thanx, Paul
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Wed Feb 20, 6:15 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Wed Feb 20, 8:02 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Thu Feb 21, 12:38 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Thu Feb 21, 6:47 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Fri Feb 22, 9:30 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sat Feb 23, 4:16 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sat Feb 23, 8:19 pm)
Re: [linux-pm] [Bug 10030] Suspend doesn't work when SD card..., Rafael J. Wysocki, (Sun Feb 24, 10:00 am)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Mon Feb 25, 7:40 am)
Re: [patch] Re: using long instead of atomic_t when only set..., Paul E. McKenney, (Mon Mar 3, 5:12 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 6:21 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Mon Feb 25, 7:41 am)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 9:51 am)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 4:09 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 9:33 am)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 4:25 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 4:56 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Sun Feb 24, 6:18 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Wed Feb 20, 6:41 pm)
Re: [Bug 10030] Suspend doesn't work when SD card is inserted, Rafael J. Wysocki, (Wed Feb 20, 4:58 pm)