๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
โญ Group_Study/Operating System

[7์ฃผ์ฐจ] Virtual Memory Management: SW components

by ํฌ์ŠคํŠธ์‰์ดํฌ 2023. 1. 17.

Virtual Memory Management: SW components

SoftWare Components: ๊ฐœ์š”

โœ” ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์œ„ํ•œ ๊ด€๋ฆฌ ๊ธฐ๋ฒ•๋“ค

  • Allocation Strategies (ํ• ๋‹น ๊ธฐ๋ฒ•)
  • Fetch Strategies
  • Placement Strategies(๋ฐฐ์น˜ ๊ธฐ๋ฒ•)
  • Replacement Strategies (๊ต์ฒด ๊ธฐ๋ฒ•)
  • Cleaning Strategies (์ •๋ฆฌ ๊ธฐ๋ฒ•)
  • Load Control Strategies (๋ถ€ํ•˜ ์กฐ์ ˆ ๊ธฐ๋ฒ•)

Alloctaion Strategies

โœ” ๊ฐ ํ”„๋กœ์„ธ์Šค์—๊ฒŒ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์–ผ๋งˆ๋งŒํผ ์ค„ ๊ฒƒ์ธ๊ฐ€?

  • Fixed Alloctaion(๊ณ ์ • ํ• ๋‹น)
    • ํ”„๋กœ์„ธ์Šค์˜ ์‹คํ–‰ ๋™์•ˆ ๊ณ ์ •๋œ ํฌ๊ธฐ์˜ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น
  • Variable allocation(๊ฐ€๋ณ€ ํ• ๋‹น)
    • ํ”„๋กœ์„ธ์Šค์˜ ์‹คํ–‰๋™์•ˆ ํ• ๋‹นํ•˜๋Š” ๋ฉ”๋ชจํ‚ค๋ฆฌ์˜ ํฌ๊ธฐ๊ฐ€ ์œ ๋™์ 

โœ” ๊ณ ๋ ค ์‚ฌํ•ญ

  • ํ”„๋กœ์„ธ์Šค ์‹คํ–‰์— ํ•„์š”ํ•œ ๋ฉ”๋ชจ๋ฆฌ ์–‘์„ ์˜ˆ์ธกํ•ด์•ผ ํ•œ๋‹ค
  • ๋„ˆ๋ฌด ํฐ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น
    • ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋‚ญ๋น„ ๋œ๋‹ค
  • ๋„ˆ๋ฌด ์ ์€ ๋ฉ”๋ชจ๋ฆฌ ํ• ๋‹น
    • Page fault rate ์ƒ์Šน
    • ์‹œ์Šคํ…œ ์„ฑ๋Šฅ ์ €ํ•˜

Fetch Strategies

โœ” ํŠน์ • page๋ฅผ ๋ฉ”๋ชจ๋ฆฌ์— ์–ธ์ œ ์ ์žฌํ•  ๊ฒƒ์ธ๊ฐ€

  • Demain fetch(demand paging)
    • ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ฐธ์กฐํ•˜๋Š” ํŽ˜์ด์ง€๋“ค๋งŒ ์ ์žฌ
    • page fault overhead
  • Anticipatory fetch(pre-paging)
    • ์ฐธ์กฐ๋  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์€ page ์˜ˆ์ธก
    • ๊ฐ€๊นŒ์šด ๋ฏธ๋ž˜์— ์ฐธ์กฐ๋  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์€ page๋ฅผ ๋ฏธ๋ฆฌ ์ ์žฌ
    • ์˜ˆ์ธก ์„ฑ๊ณต ์‹œ, page fault overhead๊ฐ€ ์—†๋‹ค
    • Prediction overhead(Kernel ๊ฐœ์ž…)
    • Hit ratio์— ๋ฏผ๊ฐ

โœ” ์‹ค์ œ ๋Œ€๋ถ€๋ถ„์˜ ์‹œ์Šคํ…œ์€ Demand Fetch ๊ธฐ๋ฒ• ์‚ฌ์šฉ

  • ์ผ๋ฐ˜์ ์œผ๋กœ ์ค€์ˆ˜ํ•œ ์„ฑ๋Šฅ
  • Anticipatory fetch
    • Prediction overhead, ์ž˜๋ชป๋œ ์˜ˆ์ธก ์‹œ ์ž์› ๋‚ญ๋น„๊ฐ€ ํผ

โœ” Anticipatory fetch ๊ธฐ๋ฒ•์€ ์ผ๋ฐ˜์ ์ธ ์šด์˜์ฒด์ œ๋ณด๋‹ค ๊ฐœ์ธ์ด ์‹œ์Šคํ…œ/ํ”„๋กœ๊ทธ๋žจ ์„ค๊ณ„์‹œ ์ ์šฉ ๊ฐ€๋Šฅ

Placement Strategies

โœ” Page/segment๋ฅผ ์–ด๋””์— ์ ์žฌํ•  ๊ฒƒ์ธ๊ฐ€
โœ” Paging system์—๋Š” ๋ถˆํ•„์š”

โœ” Segmentation system์—์„œ์˜ ๋ฐฐ์น˜ ๊ธฐ๋ฒ•

  • First-fit
  • Best-fit
  • Worst-fit
  • Next-fit

Replacement Strategies

โœ” ์ƒˆ๋กœ์šด page๋ฅผ ์–ด๋–ค page์™€ ๊ต์ฒด ํ•  ๊ฒƒ์ธ๊ฐ€ (๋นˆ page frame์ด ์—†๋Š” ๊ฒฝ์šฐ)

  • Fixed allocation
  • Variable allocation

Cleaning Strategies

โœ” ๋ณ€๊ฒฝ๋œ page๋ฅผ ์–ธ์ œ write-back ํ•  ๊ฒƒ์ธ๊ฐ€?

  • ๋ณ€๊ฒฝ๋œ ๋‚ด์šฉ์„ swap device์— ๋ฐ˜์˜
  • Demand cleaning
    • ํ•ด๋‹น page์— ๋ฉ”๋ชจ๋ฆฌ์—์„œ ๋‚ด๋ ค์˜ฌ ๋•Œ write back
  • Anticipatory cleaning(pre-cleaning)
    • ๋” ์ด์ƒ ๋ณ€๊ฒฝ๋  ๊ฐ€๋Šฅ์„ฑ์ด ์—†๋‹ค๊ณ  ํŒ๋‹จ ํ•  ๋•Œ, ๋ฏธ๋ฆฌ write-back
    • Page ๊ต์ฒด ์‹œ ๋ฐœ์ƒํ•˜๋Š” write-back ์‹œ๊ฐ„ ์ ˆ์•ฝ
    • Write-back ์ดํ›„, page ๋‚ด์šฉ์ด ์ˆ˜์ •๋˜๋ฉด overhead!

โœ” ์‹ค์ œ ๋Œ€๋ถ€๋ถ„์˜ ์‹œ์Šคํ…œ์€ Demand Fetch ๊ธฐ๋ฒ• ์‚ฌ์šฉ

  • ์ผ๋ฐ˜์ ์œผ๋กœ ์ค€์ˆ˜ํ•œ ์„ฑ๋Šฅ
  • Anticipatory fetch
    • Prediction overhead, ์ž˜๋ชป๋œ ์˜ˆ์ธก ์‹œ ์ž์› ๋‚ญ๋น„๊ฐ€ ํผ

Load Control Strategies

โœ” ์‹œ์Šคํ…œ์˜ multi-programming degree ์กฐ์ ˆ

  • Allocation strategies์™€ ์—ฐ๊ณ„
null

โœ” ์ ์ • ์ˆ˜์ค€์˜ multi-programming degree๋ฅผ ์œ ์ง€ํ•ด์•ผ ํ•œ๋‹ค

  • Plateau(๊ณ ์›) ์˜์—ญ์œผ๋กœ ์œ ์ง€
  • ์ €๋ถ€ํ•˜ ์ƒํƒœ(Under-loaded)
    • ์‹œ์Šคํ…œ ์ž์› ๋‚ญ๋น„, ์„ฑ๋Šฅ ์ €ํ•˜
  • ๊ณ ๋ถ€ํ•˜ ์ƒํƒœ(Over-loaded)
    • ์ž์›์— ๋Œ€ํ•œ ๊ฒฝ์ ฑ ์‹ฌํ™”, ์„ฑ๋Šฅ ์ €ํ•˜
    • Thrashing(์Šค๋ ˆ์‹ฑ)ํ˜„์ƒ ๋ฐœ์ƒ
      • ๊ณผ๋„ํ•œ page fault

๋Œ“๊ธ€