Rev 47 | Rev 62 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 47 | Rev 54 | ||
|---|---|---|---|
| Line 192... | Line 192... | ||
| 192 | left have more paging implementations, for example B-Tree page |
192 | left have more paging implementations, for example B-Tree page |
| 193 | tables.</para> |
193 | tables.</para> |
| 194 | </section> |
194 | </section> |
| 195 | 195 | ||
| 196 | <section id="tlb"> |
196 | <section id="tlb"> |
| 197 | <title>Translation Lookaside Buffer</title> |
197 | <title>Translation Lookaside buffer</title> |
| 198 | 198 | ||
| 199 | <para>- TLB cachuji informace ve strankovacich tabulkach; alternativne |
199 | <para>Due to the extensive overhead during the page mapping lookup in |
| 200 | se lze na strankovaci tabulky (ci ruzne hw rozsireni [e.g. VHPT, ppc32 |
- | |
| 201 | hw hash table]) divat jako na velke TLB</para> |
- | |
| 202 | - | ||
| 203 | <para>- pri modifikaci mapovani nebo odstraneni mapovani ze |
- | |
| 204 | strankovacich tabulek je potreba zajistit konsistenci TLB a techto |
200 | the page tables, all architectures has fast assotiative cache memory |
| 205 | tabulek; nutne delat na vsech CPU; na to mame zjednodusenou verzi TLB |
- | |
| 206 | shootdown mechanismu; je to variace na algoritmus popsany zde: D. |
201 | built-in CPU. This memory called TLB stores recently used page table |
| 207 | Black et al., "Translation Lookaside Buffer Consistency: A Software |
- | |
| 208 | Approach," Proc. Third Int'l Conf. Architectural Support for |
- | |
| 209 | Programming Languages and Operating Systems, 1989, pp. 113-122.</para> |
202 | entries.</para> |
| 210 | 203 | ||
| - | 204 | <section id="tlb_shootdown"> |
|
| - | 205 | <title>TLB consistency. TLB shootdown algorithm.</title> |
|
| - | 206 | ||
| - | 207 | <para>Operating system is responsible for keeping TLB consistent by |
|
| - | 208 | invalidating the contents of TLB, whenever there is some change in |
|
| - | 209 | page tables. Those changes may occur when page or group of pages |
|
| - | 210 | were unmapped, mapping is changed or system switching active address |
|
| - | 211 | space to schedule a new system task (which is a batch unmap of all |
|
| - | 212 | address space mappings). Moreover, this invalidation operation must |
|
| - | 213 | be done an all system CPUs because each CPU has its own independent |
|
| - | 214 | TLB cache. Thus maintaining TLB consistency on SMP configuration as |
|
| - | 215 | not as trivial task as it looks at the first glance. Naive solution |
|
| - | 216 | would assume remote TLB invalidatation, which is not possible on the |
|
| - | 217 | most of the architectures, because of the simple fact - flushing TLB |
|
| - | 218 | is allowed only on the local CPU and there is no possibility to |
|
| - | 219 | access other CPUs' TLB caches.</para> |
|
| - | 220 | ||
| 211 | <para>- nutno poznamenat, ze existuji odlehcenejsi verze TLB shootdown |
221 | <para>Technique of remote invalidation of TLB entries is called "TLB |
| - | 222 | shootdown". HelenOS uses a variation of the algorithm described by |
|
| - | 223 | D. Black et al., "Translation Lookaside Buffer Consistency: A |
|
| - | 224 | Software Approach," Proc. Third Int'l Conf. Architectural Support |
|
| - | 225 | for Programming Languages and Operating Systems, 1989, pp. |
|
| 212 | algoritm</para> |
226 | 113-122.</para> |
| - | 227 | ||
| - | 228 | <para>As the situation demands, you will want partitial invalidation |
|
| - | 229 | of TLB caches. In case of simple memory mapping change it is |
|
| - | 230 | necessary to invalidate only one or more adjacent pages. In case if |
|
| - | 231 | the architecture is aware of ASIDs, during the address space |
|
| - | 232 | switching, kernel invalidates only entries from this particular |
|
| - | 233 | address space. Final option of the TLB invalidation is the complete |
|
| - | 234 | TLB cache invalidation, which is the operation that flushes all |
|
| - | 235 | entries in TLB.</para> |
|
| - | 236 | ||
| - | 237 | <para>TLB shootdown is performed in two phases. First, the initiator |
|
| - | 238 | process sends an IPI message indicating the TLB shootdown request to |
|
| - | 239 | the rest of the CPUs. Then, it waits until all CPUs confirm TLB |
|
| - | 240 | invalidating action execution.</para> |
|
| - | 241 | </section> |
|
| 213 | </section> |
242 | </section> |
| 214 | </section> |
243 | </section> |
| 215 | 244 | ||
| 216 | <section> |
245 | <section> |
| 217 | <title>---</title> |
246 | <title>---</title> |