Re: atomic RAM ?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Schnell
Date: Tuesday, April 13, 2010 - 3:11 am

On 04/12/2010 05:02 PM, Arnd Bergmann wrote:
That is not the point. Custom instructions easily can implement
thread-safe and SMP safe atomic read-modify-write user-land-enabled
operations such as "test-and-set", "exchange" or "inc" (I don't think
that "store conditional" would be necessary). But they can't work if the
same data can be accessed by other (non-custom) CPU instructions, as the
custom-instructions would necessarily bypass the cache and the MMU while
the normal CPU instructions would use both (and as all this is done with
performance in mind disabling or invalidating the cache is out of
question and in user-land such operations are impossible, anyway. This
is why the idea of a dedicated "atomic RAM" has been developed (which
requires the arch-independent Kernel and Library code to access all
would-be "atomic" locations _only_ through arch-depending macros
<including allocating and freeing these memory locations>, even though
for "standard" archs, the resulting ASM code would (hopefully, nearly
everywhere) stay the same as it is).
Right., I already mentioned this "Atomic Region" way to implement an
"atomic operation" workaround for non-SMP systems in the first message
of this thread.

Of course it would be advantageous to have this method for NIOS, as
well, as it can be implemented without "hardware" support and without
modifications of the arch-independent Kernel and library code. But it
will not work with SMP and it will introduces an (even if supposedly not
huge) overhead with any interrupt.

A hardware implementation would avoid this overhead, would allow for
atomic SMP user-land operations and could be the base of implementing an
SMP Kernel (even though with NIOS/SMP other issues <like
cache-synchronization> might need to be solved additionally).

-Michael
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
atomic RAM ?, Michael Schnell, (Thu Apr 8, 12:32 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 2:52 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 3:12 am)
Re: atomic RAM ?, Alan Cox, (Thu Apr 8, 3:45 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 5:11 am)
Re: atomic RAM ?, David Miller, (Thu Apr 8, 5:14 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 5:30 am)
Re: atomic RAM ?, Alan Cox, (Thu Apr 8, 6:37 am)
Re: atomic RAM ?, Arnd Bergmann, (Thu Apr 8, 7:15 am)
Re: atomic RAM ?, Mike Frysinger, (Thu Apr 8, 6:36 pm)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 2:23 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 3:54 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 3:55 am)
Re: atomic RAM ?, Alan Cox, (Fri Apr 9, 4:54 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 5:53 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 6:14 am)
Re: atomic RAM ?, Alan Cox, (Fri Apr 9, 6:15 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 6:32 am)
Re: atomic RAM ?, Michael Schnell, (Mon Apr 12, 2:58 am)
Re: atomic RAM ?, Pavel Machek, (Mon Apr 12, 5:54 am)
Re: atomic RAM ?, Arnd Bergmann, (Mon Apr 12, 8:02 am)
Re: [Nios2-dev] atomic RAM ?, Michael Schnell, (Tue Apr 13, 1:39 am)
Re: atomic RAM ?, Michael Schnell, (Tue Apr 13, 3:11 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 1:42 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 5:46 am)
Re: atomic RAM ?, Alan Cox, (Wed Apr 14, 5:57 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 7:38 am)