Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ch16

213 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

  • Be the first to like this

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 !

×