Ch16

154 views
109 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
154
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ch16

  1. 1. SYNOLOGY STUDY GROUP Linux Kernel Development               - Robert Love/3e Chapter 16 - cache Reporter: JeasonH / 黃志勝
  2. 2. Outlines ● Cache Mode ● Cache Eviction ● Address space ● Radix tree ● Buffer cache ● Flusher thread
  3. 3. Cache Mode  Write back  Write through  No Write
  4. 4. Cache Eviction ● Clairvoyant - adj. 有超人之目力或洞察力的 n. 千里眼 ) ● LRU - Least Recent Used ● LRU/2, LRU/n
  5. 5. address_space (physical_pages_of_a_file)
  6. 6. Radix tree
  7. 7. Buffer cache (ch14 block I/O device) Linux 2.4: ● Buffer cache – 以 block 為操作單位 ● Page cache – 以 page 為操作單位 一份資料可能同時 cache 在 buffer 與 page 上 浪費記憶體空間,並且需要同步。
  8. 8. Flusher thread ● dirty_background_ratio ● dirty_expire_interval, dirty_writeback_interval ● sync(), fsync()
  9. 9. Flusher thread Laptop mode – /proc/sys/vm/lap_top_mode = 0/1 當寫回發生時,順便將所有其他的 dirty 資料寫回 Disk ( 搭順風車 ) 配合 lap_top_mode 將值調大 dirty_expire_interval, dirty_writeback_interval
  10. 10. Flusher thread Linux 2.6 before – bdflush (dirty_background_ratio)    kupdated (dirty_expire_interval)          (dirty_writeback_interval) Linux 2.6 – pdfush : 2 to 8 threads Linux 2.6.32 – flusher : one thread for one block device
  11. 11. THANKS YOUR ATTENTION !

×