Snoop cache AMANO, Hideharu, Keio University . ics . keio . ac . jp Textbook pp.40-60.

Slides:



Advertisements
Similar presentations
SPSSによるHosmer-Lemeshow検定について
Advertisements

レポート書き方. おしいレポート よく調べてある それぞれの、1文の言っていることは正 しい しかし、全体として、何が言いた いのかわからない 内容の重要だが、全体の構成も重 要である.
7.n次の行列式   一般的な(n次の)行列式の定義には、数学的な概念がいろいろ必要である。まずそれらを順に見ていく。
9.線形写像.
神戸大学 大学院 理学研究科 地球惑星科学専攻 地球および惑星大気科学研究室 M 2 島津 通. Index ITPASSとは 目的 目標 活動内容 勉強会 計算機管理 その他の活動 環境 まとめ.
学生の携帯電話選択理由 岡田隆太.
時間的に変化する信号. 普通の正弦波 は豊富な情報を含んでいません これだけではラジオのような複雑な情報 を送れない 振幅 a あるいは角速度 ω を時間的に変化 させて情報を送る.
九州大学 岡村研究室 久保 貴哉 1. 利用中のAPの数の推移 2 横軸:時刻 縦軸:接続要求数 ・深夜では一分間で平均一台、 昼間では平均14台程度の接続 要求をAPが受けている。 ・急にAPの利用者数が増えてく るのは7~8時あたり.
5.連立一次方程式.
相関.
つくばだいがくについて 芸術専門学群のこと. 筑波大学ってこんなところ 東京教育大学を前身とする大学で、その 創立は日本で最も古い大学のひとつ。 大学の敷地面積は日本で二番目に広い大 学で、やたら坂が多い。移動時間が15分 しかないのに上り坂を三つ超えることがよ くある。
論理回路 第2回 今日の内容 前回の課題の説明 数の体系 – 数の表現 – 代表的な数 – 基数の変換 – 補数.
広告付き価格サービ ス 小園一正. はじめに 世の中には様々な表現方法の広告があり ます。その中でも私たち学生にとって身 近にあるものを広告媒体として取り入れ られている。 価格サービス(無料配布のルーズリー フ)を体験したことにより興味を惹かれ るきっかけとなった。主な目的は、これ.
素数判定法 2011/6/20.
フーリエ係数の性質. どこまで足す? 理想的には無限大であるが、実際に はそれは出来ない これをフーリエ解析してみる.
公開鍵暗号系 2011/05/09.
1章 行列と行列式.
本宮市立白岩小学校. 1 はじめに 2 家庭学習プログラム開発の視点 ① 先行学習(予習)を生かした 確かな学力を形成する授業づく り ② 家庭との連携を図った家庭学習の習慣化.
フーリエ級数. 一般的な波はこのように表せる a,b をフーリエ級数とい う 比率:
3.エントロピーの性質と各種情報量.
Excelによる積分.
1 6.低次の行列式とその応用. 2 行列式とは 行列式とは、正方行列の特徴を表す一つのスカ ラーである。すなわち、行列式は正方行列からスカ ラーに写す写像の一種とみなすこともできる。 正方行列 スカラー(実数) の行列に対する行列式を、 次の行列式という。 行列 の行列式を とも表す。 行列式と行列の記号.
計算のスピードアップ コンピュータでも、sin、cosの計算は大変です 足し算、引き算、掛け算、割り算は早いです
1 0章 数学基礎. 2 ( 定義)集合 集合については、 3セメスタ開講の「離散数学」で詳しく扱う。 集合 大学では、高校より厳密に議論を行う。そのために、議論の 対象を明確にする必要がある。 ある “ もの ” (基本的な対象、概念)の集まりを、 集合という。 集合に含まれる “ もの ” を、集合の要素または元という。
複素数.
4.プッシュダウンオートマトンと 文脈自由文法の等価性
1 0章 数学基礎. 2 ( 定義)集合 集合については、 3セメスタ開講の「離散数学」で詳しく扱う。 集合 大学では、高校より厳密に議論を行う。そのために、議論の 対象を明確にする必要がある。 ある “ もの ” (基本的な対象、概念)の集まりを、 集合という。 集合に含まれる “ もの ” を、集合の要素または元という。
システムプログラム論 課題 大村 廉. 課題 Java を用いて Producer / Consumer 問題を解決する MyBuffer クラスを –Synchronized キーワード –Semaphore クラス (java.util.concurrent.Semaphore) を用いてそれぞれ作りなさい.
信号測定. 正弦波 多くの場合正弦波は 0V の上下で振動する しかし、これでは AD 変換器に入れら れないので、オフ セットを調整して データを取った.
1 9.線形写像. 2 ここでは、行列の積によって、写像を 定義できることをみていく。 また、行列の積によって定義される写 像の性質を調べていく。
通信路(7章).
3.プッシュダウンオートマトンと 文脈自由文法
ビット. 十進数と二進数 十進数  0から9までの数字を使って 0、1、2、3、4、5、6、7、8、9、 10、11、12 と数える 二進数  0と1を使って 0、1、10、11、100、101、11 0、111 と数える.
人工知能特論 II 第 4 回 二宮 崇 1. CCG (COMBINATORY CATEGORIAL GRAMMAR) 組合せ範疇文法 2 今日の講義の予定.
正弦波.
3.正方行列(単位行列、逆行列、対称行列、交代行列)
JPN 312 (Fall 2007): Conversation and Composition Contraction (2); 意見を言う (to express your opinion)
Three-Year Course Orientation International Course.
JPN 311: Conversation and Composition 勧誘 (invitation)
7班 加地 健太郎 (MadaiPage 担当) 熊谷 勇人( MapPage 担当) 田原春 勝太 (TopPage 担当) 森 健樹(パワーポイント、 photo 担当)
JPN 311: Conversation and Composition 許可 (permission)
地図に親しむ 「しゅくしゃくのちがう 地図を 使ってきょりを調べよ う1」 小学4年 社会. 山口駅裁判所 県立 美術館 サビエル 記念聖堂 山口市役所 地図で探そう 市民会館 県立 図書館.
方程式を「算木」で 解いてみよう! 愛媛大学 教育学部 平田 浩一.
C言語応用 構造体.
3.多項式計算アルゴリズム べき乗の計算 多項式の計算.
JPN 312 (Fall 2007): Conversation and Composition 文句 ( もんく ) を言う.
HKS Analysis Log Jul 2006 Part1 D.Kawama. 第壱部 HKS Sieve Slit Analysis.
言語とジェンダー. 目的 言語には、性的な存在である人間の自己認識や 世界認識を決定する力が潜んでいる。 – 言語構造の面(言語的カテゴリー ) – 言語運用の面 日常に潜む無意識の言語の力を、記述し、意識 化することが本講義の目的である。 同時に、さまざまな言語、さまざまな文化には、 それぞれに特徴的な問題があり、ジェンダーの.
1 プログラミング言語論 第13回 プログラムの意味論と検証 (2) 表示的意味論 担当:犬塚. 2 表示的意味論 denotational semantics  表示的意味論では、プログラムの要素とそれが 意味するものを対応付ける。 変数 式 文 A B … A+2 2B+C A:=A+2 if.
Elementary Japanese ‐in twenty hours- Chapter 9
プログラミングⅠ( 2 組) 第 1 回 / pLB1.pptx.
「ネット社会の歩き方」レッスンキット プレゼンテーション資料集 15. チャットで個人情報は 言わない プレゼンテーション資料 著作権は独立行政法人情報処理推進機構( IPA )及び経済産業省に帰属します。
8.任意のデータ構造 (グラフの表現とアルゴリズム)
プログラミング入門2 第3回 複合文、繰り返し 情報工学科 篠埜 功.
NODA Ken, KAJITA Satoshi and SASA Yoshinobu Truss Contest 2004 idea 男がこう言っ た。 「デザインにこだわろう。」 現場が一瞬凍りついた。 男はこう続けた。 「記録に残るだけではだめだ、記憶に残さなくて は。」 現場がひとつになった。
ことばとコンピュータ 2007 年度 1 学期 第 1 回. 2 ことばとコンピュータ 授業科目名:言語情報処理論 授業題目名:ことばとコンピュータ 履修コード: 5067 教室: 323 一学期開講 授業の進め方 – 基本的に講義中心ですすめ,時々コンピュー タを使う.
LANG3910 Japanese Ⅲ Lesson 14 依頼・現在進行形. 学習項目 1. 「て -form 」 2. 依頼表現 An expression of request 3. 相手の意向を尋ねる Ask someone’s mind 4. 現在進行形 Actions in Progress.
携帯電話でのコミュニ ケーションについて 1班真田 出水 佐伯 堺. 仮説  女性のほうが携帯電話を使ったコミュニ ケーションを重要視する。
Exercise IV-A p.164. What did they say? 何と言ってましたか。 1.I’m busy this month. 2.I’m busy next month, too. 3.I’m going shopping tomorrow. 4.I live in Kyoto.
小島 肇  Windows ではアンチウイルスソフトウェアは 必須だが、「入れれば安心」というものでは ない  Mac, Linux における費用対効果はかなり低い  現時点ではマルウェアは流行っていないから  Windows を併用している場合は別.
音の変化を視覚化する サウンドプレイヤーの作成
HCC Hair Color Change. メンバー ソ 渋谷麻美 ソ 渋谷麻美 ソ 清野理衣子 ソ 清野理衣子 ソ 三上貴大 ソ 三上貴大.
Self-efficacy(自己効力感)について
本文. 考えながら読みましょ う 「いろいろなこと」( 3 行目)は何で すか 「①電話料金はコンビニで支払いをしていま す。いつでも払えますから、便利です。」 「②夕食はコンビニで買います。お弁当やお かずがいろいろありますから。」今、若者に 人気のあるコンビニは、いろいろなことをす るのに非常に便利な場所になった。
Relaxed Consistency models and software distributed memory Computer Architecture Textbook pp. 79-83.
たくさんの人がいっしょに乗れる乗り物を 「公共交通」といいます バスや電車 と 自動車 の よいところ と よくない ところ よいところ と よくない ところ を考えてみよう!
日本語1 2月12日 愛 あい. みっきーは みにーを あいしてい ます。 ほーまーは まーじを あいしてい ます。
今日の内容 高階関数  関数を値として扱う 関数を引数にとる 関数を返す関数 プログラミングの例題  クイックソート.
英語勉強会 名手⇒詫間 2015/10/22. 原文 This study says acquiring motor skills support system. There is how to acquire moor skills that coach advises learner. Motor.
心臓および肝臓移植会社. 心臓移植は非常に複雑な 手技であり、 zoukiishoku119 は候補者の 評価から手技後のケアま で、各患者の治療に協力 チームアプローチをとっ ています。私たちの多分 野の移植グループには、 心臓専門医、心臓外科医、 看護師、心臓リハビリ専 門家、ソーシャルワー カーが含まれます。これ.
Presentation transcript:

Snoop cache AMANO, Hideharu, Keio University . ics . keio . ac . jp Textbook pp.40-60

Cache memory A small high speed memory for storing frequently accessed data/instructions. Essential for recent microprocessors. Basis knowledge for uni-processor’s cache is reviewed first.

Direct Map … … = Yes : Hit Cache Directory (Tag Memory) 8 entries X (4bit ) Data 010 Cache (64B=8Lines) Main Memory (1KB=128Lines) From CPU Simple Directory structure

Direct Map (Conflict Miss) … … = No: Miss Hit Cache Directory (Tag Memory) 010 Cache Main Memory From CPU Conflict Miss occurs between two lines with the same index 0000

2-way set associative Map … … = Yes: Hit Cache Directory (Tag Memory) 4 entries X 5bit X 2 Data Cache (64B=8Lines) Main Memory (1KB=128Lines) From CPU = No

2-way set associative Map … … = Yes: Hit Cache Directory (Tag Memory) 4 entries X 5bit X 2 10 Cache (64B=8Lines) Main Memory (1KB=128Lines) From CPU = Data No Conflict Miss is reduced

Write Through ( Hit ) 0011 … … Cache Directory (Tag Memory) 8 entries X (4bit ) Hit Cache (64B=8Lines) Main Memory (1KB=128Lines) Write Data The main memory is updated From CPU

Write Through ( Miss : Direct Write ) 0011 … … Cache Directory (Tag Memory) 8 entries X (4bit ) Miss Cache (64B=8Lines) Main Memory (1KB=128Lines) Write Data Only main memory is updated From CPU

Write Through ( Miss : Fetch on Write ) 0011 … … Cache Directory (Tag Memory) 8 entries X (4bit ) Miss Cache (64B=8Lines) Main Memory (1KB=128Lines) Write Data From CPU

Write Back ( Hit ) 0011 … … Cache Directory (Tag Memory) 8 entries X (4bit+1bit ) Hit Cache (64B=8Lines) Main Memory (1KB=128Lines) Write Data From CPU Dirty

Write Back ( Replace ) … … Cache Directory (Tag Memory) 8 entries X (4bit+1bit ) Miss Cache (64B=8Lines) Main Memory (1KB=128Lines) From CPU Write Back Dirty 00000

Shared memory connected to the bus Cache is required  Shared cache Often difficult to implement even in on-chip multiprocessors  Private cache Consistency problem → Snoop cache

Shared Cache 1 port shared cache  Severe access conflict 4-port shared cache  A large multi-port memory is hard to implement PE Bus Interface Shared Cache PE Main Memory Shared cache is often used for L2 cache of on-chip multiprocessors

Private( Snoop ) Cache PU Snoop Cache PU Snoop Cache PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus Each PU provides its own private cache

Bus as a broadcast media A single module can send (write) data to the media All modules can receive (read) the same data → Broadcasting Tree Crossbar + Bus Network on Chip (NoC) Here, I show as a shape of classic bus but remember that it is just a logical image.

Cache coherence (consistency) problem PU Main Memory A large bandwidth shared bus Data of each cache is not the same A A A’

Coherence vs. Consistency Coherence and consistency are complementary : Coherence defines the behavior of reads and writes to the same memory location, while Consistency defines the behavior of reads and writes with respect to accesses to other memory location. Hennessy & Patterson “Computer Architecture the 5 th edition” pp.353

Cache Coherence Protocol Each cache keeps coherence by monitoring (snooping) bus transactions. Write Through : Every written data updates the shared memory. Write Back: Invalidate Update (Broadcast) Basis ( Synapse) Ilinois Berkeley Firefly Dragon Frequent access of bus will degrade performance

Glossary 1 Shared Cache: 共有キャッシュ Private Cache: 占有キャッシュ Snoop Cache: スヌープキャッシュ、バスを監視することによって内 容の一致を取るキャッシュ。今回のメインテーマ、ちなみに Snoop は 「こそこそかぎまわる」という意味で、チャーリーブラウンに出てく る犬の名前と語源は ( 多分)同じ。 Coherent ( Consistency) Problem: マルチプロセッサで各 PE がキャッ シュを持つ場合にその内容の一致が取れなくなる問題。一致を取る機 構を持つ場合、 Coherent Cache と呼ぶ。 Conherence と Consistency の 違いは同じアドレスに対するものか違うアドレスに対するものか。 Direct map: ダイレクトマップ、キャッシュのマッピング方式の一つ n-way set associative: セットアソシアティブ、同じくマッピング方式 Write through, Write back: ライトスルー、ライトバック、書き込みポリ シーの名前。 Write through は二つに分かれ、 Direct Write は直接主記憶 を書き込む方法、 Fetch on Write は、一度取ってきてから書き換える方 法 Dirty/Clean: ここでは主記憶と内容が一致しない / すること。 この辺のキャッシュの用語はうまく翻訳できないので、カタカナで呼 ばれているため、よくわかると思う。

Write Through Cache ( Invalidation : Data read out ) PU Main Memory A large bandwidth shared bus I: Invalidated V: Valid V Read V

Write Through Cache ( Invalidate : Data write into ) PU Main Memory A large bandwidth shared bus I: Invalidate V: Valid V Write Monitoring (Snooping) V I

Write Through Cache ( Invalidate Direct Write) PU Main Memory A large bandwidth shared bus I: Invalidated V: Valid The target cache line is not existing in the cache VI Write Monitoring (Snooping)

Write Through Cache ( Invalidate : Fetch On Write ) PU Main Memory A large bandwidth shared bus I: Invalidated V: Valid Write Monitoring (Snoop) I V First, Fetch Fetch and write Cache line is not existing in the target cache V

Write Through Cache ( Update ) PU Main Memory A large bandwidth shared bus I: Invalidated V: Valid V Write V Monitoring (Snoop) Data is updated

The structure of Snoop cache Cache Memory Entity Directory The same Directory (Dual Port) CPU Shared bus Directory can be accessed simultaneously from both sides. The bus transaction can be checked without caring the access from CPU.

Quiz Following accesses are done sequentially into the same cache line of Write through Direct Write and Fetch-on Write protocol. How the state of each cache line is changed ?  PU A: Read  PU B: Read  PU A: Write  PU B: Read  PU B: Write  PU A: Write

The Problem of Write Through Cache In uniprocessors, the performance of the write through cache with well designed write buffers is comparable to that of write back cache. However, in bus connected multiprocessors, the write through cache has a problem of bus congestion.

Basic Protocol PU Main Memory A large bandwidth shared bus States attached to each line C : Clean (Consistent to shared memory) D: Dirty I : Invalidate C C Read

Basic Protocol ( A PU writes the data ) PU Main Memory A large bandwidth shared bus I Invalidation signal CC Write D Invalidation signal: address only transaction

Basic Protocol (A PU reads out) PU Main Memory A large bandwidth shared bus CC Read ID

Basic Protocol (A PU writes into again) PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus I W D ID

I C D read Replace write hit Invalidate write miss Replace read miss Replace read miss Write back & Replace write miss Write back & Replace write Replace CPU request I C D write miss for the block Invalidate read miss for the block Bus snoop request State Transition Diagram of the Basic Protocol

Illinois ’ s Protocol PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus States for each line CE : Clean Exclusive CS : Clean Sharable DE : Dirty Exclusive I : Invalidate CS CE

Illinois ’ s Protocol (The role of CE) PU Snoop Cache PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus CE : Clean Exclusive CS : Clean Sharable DE : Dirty Exclusive I : Invalidate →DE W CE

Berkeley ’ s protocol Ownership→responsibility of write back OS:Owned Sharable OE:Owned Exclusive US:Unowned Sharable I : Invalidated PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus US RR

Berkeley ’ s protocol (A PU writes into) PU US PU US PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W →OE →I Invalidation is done like the basic protocol

Berkeley ’ s protocol PU OE PU I Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus R →OS The line with US is not required to be written back Inter-cache transfer occurs! In this case, the line with US is not consistent with the shared memory. → US

Firefly protocol PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus →CS CE : Clean Exclusive CS:Clean Sharable DE:Dirty Exclusive CE CS I : Invalidate is not used!

Firefly protocol (Writes into the CS line) PU CS PU CS PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W All caches and shared memory are updated → Like update type Write Through Cache

Firefly protocol (The role of CE) PU Snoop Cache PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus →DE W Like Illinoi’s, writing CE does not require bus transactions CE

Dragon protocol Ownership→Resposibility of write back OS:Owned Sharable OE:Owned Exclusive US:Unowned Sharable UE:Unowned Exclusive PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus →US UE US RR

Dragon protocol PU US PU US PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus →OS W Only corresponding cache line is updated. The line with US is not required to be written back.

Dragon protocol PU OE PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus Direct inter-cache data transfer like Berkeley’s protocol R →OS → US

Dragon protocol (The role of the UE) PU UE PU Snoop Cache PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus →OE W No bus transaction is needed like CE is Illinois’

MOESI Protocol class Owned Exclusive O : Owned M: Modified E : Exclusive Valid S : Sharable I : Invalid

MOESI protocol class Basic : MSI Illinois : MESI Berkeley:MOSI Firefly : MES Dragon:MOES Theoretically well defined model. Detail of cache is not characterized in the model.

Invalidate vs. Update The drawback of Invalidate protocol  Frequent data writing to shared data makes bus congestion → ping-pong effect The drawback of Update protocol  Once a line shared, every writing data must use shared bus. Improvement  Competitive Snooping  Variable Protocol Cache

Ping-pong effect ( A PU writes into ) PU C C Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W →D → I→ I Invalidation

Ping-pong effect ( The other reads out ) PU I D Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus R →C

Ping-pong effect ( The other writes again ) PU C C Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W →D → I→ I Invalidation

Ping-pong effect ( A PU reads again ) PU D I Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus R →C A cache line goes and returns iteratively →Ping-pong effect

The drawback of update protocol ( Firefly protocol ) PU CS PU CS PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W Once a line becomes CS, a line is sent even if B the line is not used any more. False Sharing causes unnecessary bus transaction. B

Competitive Snooping PU CS PU CS PU Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W Update n times, and then invalidates →I The performance is degraded in some cases.

Write Once (Goodman Protocol ) PU C C Snoop Cache PU Snoop Cache Main Memory A large bandwidth shared bus W →D → I→ I Invalidation →CE Main memory is updated with invalidation. Only the first written data is transferred to the main memory.

Read Broadcast ( Berkeley) PU US PU US PU Snoop Cache PU US Main Memory A large bandwidth shared bus W →OE Invalidation is the same as the basic protocol. →I

Read Broadcast PU OE PU I Snoop Cache PU I Main Memory A large bandwidth shared bus Read data is broadcast to other invalidated cache. R →OS →US

Cache injection PU I I Snoop Cache PU I Main Memory A large bandwidth shared bus The same line is injected. R →US

MPCore (ARM+NEC) CPU interface Timer Wdog CPU interface Timer Wdog CPU interface Timer Wdog CPU interface Timer Wdog CPU/VFP L1 Memory CPU/VFP L1 Memory CPU/VFP L1 Memory CPU/VFP L1 Memory Interrupt Distributor Snoop Control Unit (SCU) Coherence Control Bus Duplicated L1 Tag … IRQ Private FIQ Lines Private Peripheral Bus L2 Cache Private AXI R/W 64bit Bus It uses MESI Protocol

Glossary 2 Invalidation: 無効化、 Update: 更新 Consistency Protocol: キャッシュの一致性を維持するための取 り決め Illinois, Berkeley, Dragon, Firefly: プロトコルの名前。 Illinois と Berkeley は提案した大学名、 Dragon,Firefly はそれぞれ Xerox と DEC のマシン名 Exclusive :排他的、つまり他にコピーが存在しないこと Modify: 変更したこと Owner :オーナ、所持者だが実は主記憶との一致に責任を持つ 責任者である。 Ownership は所有権 Competitive: 競合的、この場合は二つの方法を切り替える意に 使っている。 Injection: 注入、つまり取ってくるというよりは押し込んでしま う意

Summary Snoop Cache is the most successful technique for parallel architectures. In order to use multiple buses, a single line for sending control signals is used. Sophisticated techniques do not improve the performance so much. Variable structures can be considerable for on-chip multiprocessors. Recently, snoop protocols using NoC(Network-on- chip) are researched.

Exercise Following accesses are done sequentially into the same cache line of Illinois protocol and Firefly protocol. How the state of each cache line is changed ?  PU A: Read  PU B: Read  PU A: Write  PU B: Read  PU B: Write  PU A: Write