作者roylee17 (把我id还我阿......)
看板LinuxDev
标题Re: [问题] Linux SMP 是否需要 cache coherency ꨠ…
时间Tue Feb 23 03:21:13 2010
※ 引述《jeunder ()》之铭言:
: : → richliu:那只是你没有碰到 non-coherence platfrom 02/22 20:07
: : → richliu:如果是 SMP 又是 non hw-coherence platform, 那很麻烦 02/22 20:08
: Linux source code 里不知道有没有 SMP + non hw-coherence 的例子可参考 ?
: 目前正在弄一颗 MIPS SoC,
: 有三个 processor (CPU 复制贴上三份),
: 经由单一 bus 共享 memory,
: processor 之间没有 hw cache coherence protocol,
: 而且为了 performance 考量, 使用 write-back cache, 想到就头大.
: 看了一下 linux mips architecture 的 source code,
: 发现应该几乎不可能做到 SMP (在我的 hw 条件下),
: 或者需要改非常大, 难度颇高.
: 我怀疑在这样的条件下, 根本没有人做到 Linux SMP.
: 不知道有没有人有相关经验或资讯可供参考 ?
LL/SC 是 mips 中,实做RMW(read-modify-write) sequece
最底层(也是唯一的)基础建设
节录自 MIPS32 ARCHITECTURE Spec
-----------------
Store Conditional Word:
Atomic RMW is provided only for synchronizable memory
locations. A synchronizable memory location is one that
is associated with the state and logic necessary to
implement the LL/SC semantics. Whether a memory location
is synchronizable depends on the processor and system
confgurations, and on the memory access type used for the
location:
Uniprocessor atomicity:
...
MP atomicity:
To provide atomic RMW among multiple processors,
all accesses to the location must be made with a
memory access type of cached coherent.
I/O System:
...
----------------
即使只有特定的一小块 coherent memory
(ex: shared cache),也会需要大改特改
完全没有的话... 光靠软体应该是没办法的
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.60.246