Skip to content

Latest commit

ย 

History

History
282 lines (221 loc) ยท 11 KB

fileSystem.md

File metadata and controls

282 lines (221 loc) ยท 11 KB

๐Ÿ“ File System

๐Ÿ“š Table of Contents

File and File System

File system Implementation

Allocation of File Data in Disk

Contiguous Alloc

Linked Alloc

Indexed Alloc

Directory system Implementation



๐Ÿ“ File and File System

  • File
    • A named collection of related information
    • ์ผ๋ฐ˜์ ์œผ๋กœ ๋น„ํœ˜๋ฐœ์„ฑ ๋ณด์กฐ๊ธฐ์–ต์žฅ์น˜์— ์ €์žฅ
    • ์šด์˜์ฒด์ œ๋Š” ๋‹ค์–‘ํ•œ ์ €์žฅ ์žฅ์น˜๋ฅผ file์ด๋ผ๋Š” ๋™์ผํ•œ ๋…ผ๋ฆฌ์  ๋‹จ์œ„๋กœ ๋ณผ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์คŒ
    • Operation
      • crete, read, write, reposition, delete, open, close ๋“ฑ
  • File attribute(metadata)
    • ํŒŒ์ผ ์ž์ฒด์˜ ๋‚ด์šฉ์ด ์•„๋‹ˆ๋ผ ํŒŒ์ผ์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ๊ฐ์ข… ์ •๋ณด๋“ค
      • ํŒŒ์ผ ์ด๋ฆ„, ์œ ํ˜•, ์ €์žฅ ์œ„์น˜, ํŒŒ์ผ ์‚ฌ์ด์ฆˆ
      • ์ ‘๊ทผ ๊ถŒํ•œ(์ฝ๊ธฐ/์“ฐ๊ธฐ/์‹คํ–‰), ์‹œ๊ฐ„ (์ƒ์„ฑ/๋ณ€๊ฒฝ/์‚ฌ์šฉ), ์†Œ์œ ์ž ๋“ฑ
  • File system
    • ์šด์˜์ฒด์ œ์—์„œ ํŒŒ์ผ์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ถ€๋ถ„
    • ํŒŒ์ผ ๋ฐ ํŒŒ์ผ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ, ๋””๋ ‰ํ† ๋ฆฌ ์ •๋ณด ๋“ฑ์„ ๊ด€๋ฆฌ
    • ํŒŒ์ผ์˜ ์ €์žฅ ๋ฐฉ๋ฒ• ๊ฒฐ์ •
    • ํŒŒ์ผ ๋ณดํ˜ธ ๋“ฑ

Directory and Logical Disk

  • Directory
    • ํŒŒ์ผ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ค‘ ์ผ๋ถ€๋ฅผ ๋ณด๊ด€ํ•˜๊ณ  ์žˆ๋Š” ์ผ์ข…์˜ ํŠน๋ณ„ํ•œ ํŒŒ์ผ
    • ๊ทธ ๋””๋ ‰ํ† ๋ฆฌ์— ์†ํ•œ ํŒŒ์ผ ์ด๋ฆ„ ๋ฐ ํŒŒ์ผ attribute๋“ค
    • operation
      • search for a file, create a file, delete a file
      • list a directory, rename a file, traverse the file system
  • Partition(=Logical Disk)
    • ํ•˜๋‚˜์˜ (๋ฌผ๋ฆฌ์ ) ๋””์Šคํฌ ์•ˆ์— ์—ฌ๋Ÿฌ ํŒŒํ‹ฐ์…˜์„ ๋‘๋Š”๊ฒŒ ์ผ๋ฐ˜์ 
    • ์—ฌ๋Ÿฌ ๊ฐœ์˜ ๋ฌผ๋ฆฌ์ ์ธ ๋””์Šคํฌ๋ฅผ ํ•˜๋‚˜์˜ ํŒŒํ‹ฐ์…˜์œผ๋กœ ๊ตฌ์„ฑํ•˜๊ธฐ๋„ ํ•จ
    • (๋ฌผ๋ฆฌ์ ) ๋””์Šคํฌ๋ฅผ ํŒŒํ‹ฐ์…˜์œผ๋กœ ๊ตฌ์„ฑํ•œ ๋’ค ๊ฐ๊ฐ์˜ ํŒŒํ‹ฐ์…˜์— file system์„ ๊น”๊ฑฐ๋‚˜ swapping ๋“ฑ ๋‹ค๋ฅธ ์šฉ๋„๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ

File Operation

Create, Delete, Open, Close, REad, Write, Append, Seek, Get attributes, Set attributes, Rename

open()

open

  • ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๋ฉ”๋ชจ๋ฆฌ๋กœ ์˜ฌ๋ ค๋†“๋Š” ๊ฒƒ. openํ•˜๊ฒŒ ๋˜๋ฉด file์˜ metadata๊ฐ€ ๋ฉ”๋ชจ๋ฆฌ๋กœ ์˜ฌ๋ผ์˜จ๋‹ค.
  • open("a/b/c")
    • ๋””์Šคํฌ๋กœ๋ถ€ํ„ฐ ํŒŒ์ผ c์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ๋ฉ”๋ชจ๋ฆฌ๋กœ ๊ฐ€์ง€๊ณ  ์˜ด
    • ์ด๋ฅผ ์œ„ํ•˜์—ฌ directory path๋ฅผ search
      • ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ "/"๋ฅผ openํ•˜๊ณ  ๊ทธ ์•ˆ์—์„œ ํŒŒ์ผ 'a'์˜ ์œ„์น˜ ํš๋“
      • ํŒŒ์ผ 'a'๋ฅผ openํ•œ ํ›„ readํ•˜์—ฌ ๊ทธ ์•ˆ์—์„œ ํŒŒ์ผ 'b'์˜ ์œ„์น˜ ํš๋“..
    • directory path์˜ search์— ๋„ˆ๋ฌด ๋งŽ์€ ์‹œ๊ฐ„ ์†Œ์š”
      • open์„ read/write์™€ ๋ณ„๋„๋กœ ๋‘๋Š” ์ด์œ ์ž„
      • ํ•œ๋ฒˆ openํ•œ ํŒŒ์ผ์€ read/write์™€ ๋ณ„๋„๋กœ ๋‘๋Š” ์ด์œ ์ž„
    • open file table
      • ํ˜„์žฌ open๋œ ํŒŒ์ผ๋“ค์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ณด๊ด€์†Œ (in memory)
      • ๋””์Šคํฌ์˜ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ณด๋‹ค ๋ช‡ ๊ฐ€์ง€ ์ •๋ณด๊ฐ€ ์ถ”๊ฐ€
        • openํ•œ ํ”„๋กœ์„ธ์Šค์˜ ์ˆ˜
        • file offset :ํŒŒ์ผ ์–ด๋Š ์œ„์น˜ ์ ‘๊ทผ ์ค‘์ธ์ง€ ํ‘œ์‹œ(๋ณ„๋„์˜ ํ…Œ์ด๋ธ” ํ•„์š”)
    • file descriptor (file handle, file control block)
      • open file table์— ๋Œ€ํ•œ ์œ„์น˜ ์ •๋ณด(ํ”„๋กœ์„ธ์Šค ๋ณ„)

dirFile

File Protection

  • ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•ด ๋ˆ„๊ตฌ์—๊ฒŒ ์–ด๋–ค ์œ ํ˜•์˜ ์ ‘๊ทผ์„ ํ—ˆ๋ฝํ•  ๊ฒƒ์ธ๊ฐ€?
  • Access Control ๋ฐฉ๋ฒ•
    • Access control matrix
      • Access control list :ํŒŒ์ผ๋ณ„๋กœ ๋ˆ„๊ตฌ์—๊ฒŒ ์–ด๋–ค ์ ‘๊ทผ ๊ถŒํ•œ์ด ์žˆ๋Š” ํ‘œ์‹œ
      • capability :์‚ฌ์šฉ์ž๋ณ„๋กœ ์ž์‹ ์ด ์ ‘๊ทผ ๊ถŒํ•œ์„ ๊ฐ€์ง„ ํŒŒ์ผ ๋ฐ ํ•ด๋‹น ๊ถŒํ•œ ํ‘œ์‹œ
    • grouping
      • ์ „์ฒด user๋ฅผ owner, group, public์˜ ์„ธ ๊ทธ๋ฃน์œผ๋กœ ๊ตฌ๋ถ„
      • ๊ฐ ํŒŒ์ผ์— ๋Œ€ํ•ด ์„ธ ๊ทธ๋ฃน์˜ ์ ‘๊ทผ ๊ถŒํ•œ(rwx)์„ 3๋น„ํŠธ์”ฉ์œผ๋กœ ํ‘œ์‹œ
      • UNIX
    • password
      • ํŒŒ์ผ๋งˆ๋‹ค pwd๋ฅผ ๋‘๋Š” ๋ฐฉ๋ฒ•
      • ๋ชจ๋“  ์ ‘๊ทผ ๊ถŒํ•œ์— ๋Œ€ํ•ด ํ•˜๋‚˜์˜ pwd :all or nothing
      • ์ ‘๊ทผ ๊ถŒํ•œ๋ณ„ pwd :์•”๊ธฐ ๋ฌธ์ œ, ๊ด€๋ฆฌ ๋ฌธ์ œ

Access Methods

  • Sequential access, ์ˆœ์ฐจ ์ ‘๊ทผ
    • read all bytes/records from the beginning
    • ์ค‘๊ฐ„์— ํŒŒ์ผ์„ ๊ฑด๋„ˆ ๋„์–ด์„œ ์ฝ์„ ์ˆ˜ ์—†๋‹ค.
    • ์นด์„ธํŠธ ํ…Œ์ดํ”„๊ฐ€ ๋งค๊ฐœ์ฒด๋ผ๋ฉด ํŽธ๋ฆฌํ•จ.
  • Random access, ์ง์ ‘ ์ ‘๊ทผ
    • Bytes/records read in any order
    • ์–ด๋– ํ•œ ์ˆœ์„œ๋ผ๋„ ์ฝ์„ ์ˆ˜ ์žˆ๋‹ค(db๋Š” random access๊ฐ€ ํ•„์ˆ˜์ ์ž„)
    • LP ๋ ˆ์ฝ”๋“œ ํŒ๊ณผ ๊ฐ™์ด ์ ‘๊ทผ




๐Ÿ“ File system implementation

ํŒŒ์ผ์˜ ํฌ๊ธฐ๋Š” ๋™์ผํ•˜์ง€ ์•Š์ง€๋งŒ ๋””์Šคํฌ์— ๋™์ผํ•œ ํฌ๊ธฐ์˜ ์ €์žฅ ๋‹จ์œ„๋กœ ํŒŒ์ผ์„ ์ €์žฅํ•˜๊ณ  ์žˆ์Œ. ์ €์žฅ ๋‹จ์œ„ = block ๋‹จ์œ„

Allocation of File Data in Disk

  • Contiguous Alloc
  • Linked Alloc
  • Indexed Alloc

Contiguous Allocation, ์—ฐ์† ํ• ๋‹น

conti

  • ์žฅ์ 
    • ๊ตฌํ˜„์ด ์‰ฝ๋‹ค
      • ๋””์Šคํฌ์˜ ์ฃผ์†Œ๊ฐ€ ๊ฐ ์ฒซ ๋ฒˆ์งธ ๋ธ”๋ก์ž„.
      • ํŒŒ์ผ์˜ ์ด๋ฆ„ ์œ„์น˜ ์ •๋ณด๋ฅผ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ์Œ
    • ์ฝ๊ธฐ ์„ฑ๋Šฅ์ด ๋น ๋ฅด๋‹ค.(Fase io) (์‹ค์‹œ๊ฐ„์šฉ์œผ๋กœ ์‚ฌ์šฉ ์•„๋‹ˆ๋ฉด run ์ค‘์ด๋˜ process์˜ swapping์šฉ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.)
    • Direct access ๊ฐ€๋Šฅ
  • ๋‹จ์ 
    • ์‹œ๊ฐ„์ด ์ง€๋‚ ์ˆ˜๋ก ๋””์Šคํฌ ํŒŒํŽธํ™”๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค. (์™ธ๋ถ€ ์กฐ๊ฐ ๋ฐœ์ƒ)
    • ํŒŒ์ผ์˜ ํฌ๊ธฐ๋ฅผ ํ‚ค์šฐ๋Š”๋ฐ ์ œ์•ฝ์ด ์žˆ๋‹ค.
    • ํŒŒ์ผ์˜ ํฌ๊ธฐ๋ฅผ ํ‚ค์šฐ๋ƒ ์ค„์ด๋Š๋ƒ์— ๋”ฐ๋ผ hole ๋ฐœ์ƒ

Linked Allocation, ์—ฐ๊ฒฐ ํ• ๋‹น

linked

  • ์žฅ์ 
    • ์™ธ๋ถ€ ๋‹จํŽธํ™” ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค
  • ๋‹จ์ 
    • No random access
    • reliability ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค.
      • ํ•œ sector๊ฐ€ ๊ณ ์žฅ๋‚˜ pointer๊ฐ€ ์œ ์‹ค๋˜๋ฉด ๋งŽ์€ ๋ถ€๋ถ„์„ ์žƒ์Œ
    • pointer๋ฅผ ์œ„ํ•œ ๊ณต๊ฐ„์ด block์˜ ์ผ๋ถ€๊ฐ€ ๋˜์–ด ๊ณต๊ฐ„ ํšจ์œจ์„ฑ์„ ๋–จ์–ด๋œจ๋ฆผ
      • 512 bytes/sector, 4byte/pointer
  • ๋ณ€ํ˜•
    • file-allocation table (FAT) ํŒŒ์ผ ์‹œ์Šคํ…œ
      • ํฌ์ธํ„ฐ๋ฅผ ๋ณ„๋„์˜ ์œ„์น˜์— ๋ณด๊ด€ํ•˜์—ฌ reliability์™€ ๊ณต๊ฐ„ํšจ์œจ์„ฑ ๋ฌธ์ œ ํ•ด๊ฒฐ

Indexed Allocation, ์ธ๋ฑ์Šค๋œ ํ• ๋‹น

indexed

  • ์žฅ์ 
    • ์™ธ๋ถ€ ์กฐ๊ฐ์ด ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค.
    • direct access ๊ฐ€๋Šฅ
  • ๋‹จ์ 
    • small file์˜ ๊ฒฝ์šฐ ๊ณต๊ฐ„ ๋‚ญ๋น„(์‹ค์ œ๋กœ ๋งŽ์€ file๋“ค์ด small)
    • too large file์˜ ๊ฒฝ์šฐ ํ•˜๋‚˜์˜ block์œผ๋กœ index๋ฅผ ์ €์žฅํ•˜๊ธฐ์— ๋ถ€์กฑ
      • ํ•ด๊ฒฐ ๋ฐฉ์•ˆ
        1. linked scheme
        2. multi-level index

UNIX ํŒŒ์ผ์‹œ์Šคํ…œ์˜ ๊ตฌ์กฐ

unix

  • Boot block :๋ถ€ํŒ…์— ํ•„์š”ํ•œ ์ •๋ณด
  • Super block :ํŒŒ์ผ ์‹œ์Šคํ…œ์— ๊ด€ํ•œ ์ด์ฒด์ ์ธ ์ •๋ณด๋ฅผ ๋‹ด๊ณ  ์žˆ์Œ
  • Inode list :ํŒŒ์ผ ์ด๋ฆ„์„ ์ œ์™ธํ•œ ํŒŒ์ผ์˜ ๋ชจ๋“  ๋ฉ”ํƒ€ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅ
  • Data block :ํŒŒ์ผ์˜ ์‹ค์ œ ๋‚ด์šฉ์„ ๋ณด๊ด€
  • directory์— metadata์ €์žฅํ•˜์ง€ ์•Š๊ณ  inode ๋ฒˆํ˜ธ๋ฅผ directory๊ฐ€ ์ €์žฅํ•˜๊ณ  ์žˆ์Œ.

FAT file system(windows)

windows

  • Linked Allocation ๋ณ€ํ˜•ํ•˜์—ฌ ์‚ฌ์šฉ
  • Boot block
  • FAT
  • Root directory
  • Data block

Windows vs. UNIX

windMac

Free Space management

๋น„์–ด์žˆ๋Š” ๋ธ”๋ก ์–ด๋–ป๊ฒŒ ๊ด€๋ฆฌ ํ•  ๊ฒƒ์ธ๊ฐ€.

  • Bitmap

bitmap

- bitmap์€ ๋ธ”๋ก ๋ณ„๋กœ ๋น„ํŠธ๋ฅผ ๋‘ฌ์„œ ์‚ฌ์šฉ์ค‘์ธ์ง€ ์•„๋‹Œ์ง€ ๊ตฌ๋ถ„
- ๋ถ€๊ฐ€์ ์ธ ๊ณต๊ฐ„ ํ•„์š”
- ์—ฐ์†์ ์ธ n๊ฐœ์˜ free block์„ ์ฐพ๋Š”๋ฐ ํšจ๊ณผ์ 
  • Linked list
    • ๋ชจ๋“  free block๋“ค์„ ๋งํฌ๋กœ ์—ฐ๊ฒฐ
    • ์—ฐ์†์ ์ธ ๊ฐ€์šฉ๊ณต๊ฐ„์„ ์ฐพ๋Š” ๊ฒƒ์€ ์‰ฝ์ง€ ์•Š๋‹ค
    • ๊ณต๊ฐ„์˜ ๋‚ญ๋น„๊ฐ€ ์—†๋‹ค
  • Grouping
    • linked list ๋ฐฉ๋ฒ•์˜ ๋ณ€ํ˜•
    • ์ฒซ๋ฒˆ์งธ free block์ด n๊ฐœ์˜ pointer๋ฅผ ๊ฐ€์ง
      • n-1 ํฌ์ธํ„ฐ๋Š” free data block์„ ๊ฐ€๋ฆฌํ‚ด
      • ๋งˆ์ง€๋ง‰ pointer๊ฐ€ ๊ฐ€๋ฆฌํ‚ค๋Š” block์€ ๋˜ ๋‹ค์‹œ N pointer๋ฅผ ๊ฐ€์ง
  • Counting
    • ํ”„๋กœ๊ทธ๋žจ๋“ค์ด ์ข…์ข… ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์—ฐ์†์ ์ธ block์„ ํ• ๋‹นํ•˜๊ณ  ๋ฐ˜๋‚ฉํ•œ๋‹ค๋Š” ์„ฑ์งˆ์— ์ฐฉ์•ˆ
    • first free block, # of contiguous free blocks๋ฅผ ์œ ์ง€




๐Ÿ“ Directory Implementation

  • Linear list
    • <file name, file์˜ metadata>์˜ list
    • ๊ตฌํ˜„์ด ๊ฐ„๋‹จ
    • ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด์— ํŒŒ์ผ์ด ์žˆ๋Š”์ง€ ์ฐพ๊ธฐ ์œ„ํ•ด์„œ๋Š” linear search ํ•„์š”(time consuming)
  • Hash table
    • Linear list + hashing
    • Hash table์€ file name์„ ์ด ํŒŒ์ผ์˜ linear list์˜ ์œ„์น˜๋กœ ๋ฐ”๊พธ์–ด์คŒ
    • search time์„ ์—†์•ฐ
    • collision ๋ฐœ์ƒ ๊ฐ€๋Šฅ
  • File์˜ metadata์˜ ๋ณด๊ด€ ์œ„์น˜
    • ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด์— ์ง์ ‘ ๋ณด๊ด€
    • ๋””๋ ‰ํ† ๋ฆฌ์—๋Š” ํฌ์ธํ„ฐ๋ฅผ ๋‘๊ณ  ๋‹ค๋ฅธ ๊ณณ์— ๋ณด๊ด€
      • inode, FAT
  • Long file name์˜ ์ง€์›
    • <file name, file์˜ metadata>์˜ list์—์„œ ๊ฐ entry๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ๊ณ ์ • ํฌ๋ฆญ
    • file name์ด ๊ณ ์ • ํฌ๊ธฐ์˜ entry ๊ธธ์ด๋ณด๋‹ค ๊ธธ์–ด์ง€๋Š” ๊ฒฝ์šฐ entry์˜ ๋งˆ์ง€๋ง‰ ๋ถ€๋ถ„์— ์ด๋ฆ„์˜ ๋’ท๋ถ€๋ถ„์ด ์œ„์น˜ํ•œ ๊ณณ์˜ ํฌ์ธํ„ฐ๋ฅผ ๋‘๋Š” ๋ฐฉ๋ฒ•
    • ์ด๋ฆ„์˜ ๋‚˜๋จธ์ง€ ๋ถ€๋ถ„์€ ๋™์ผํ•œ directory file์˜ ์ผ๋ถ€์— ์กด์žฌ




VFS and NFS

  • Virtual File System(VFS)
    • ์„œ๋กœ ๋‹ค๋ฅธ ๋‹ค์–‘ํ•œ file system์— ๋™์ผํ•œ ์‹œ์Šคํ…œ ์ฝœ ์ธํ„ฐํŽ˜์ด์Šค(API)๋ฅผ ํ†ตํ•ด ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” OS์˜ layer
  • Network File System(NFS)

nfs

  • ๋ถ„์‚ฐ ์‹œ์Šคํ…œ์—์„œ๋Š” ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ํŒŒ์ผ์ด ๊ณต์œ ๋  ์ˆ˜ ์žˆ์Œ
  • NFS๋Š” ๋ถ„์‚ฐ ํ™˜๊ฒฝ์—์„œ์˜ ๋Œ€ํ‘œ์ ์ธ ํŒŒ์ผ ๊ณต์œ  ๋ฐฉ๋ฒ•์ž„

page cache and buffer cache

  • Page cache
    • Virtual memory์˜ paging system์—์„œ ์‚ฌ์šฉํ•˜๋Š” page frame์„ caching์˜ ๊ด€์ ์—์„œ ์„ค๋ช…ํ•˜๋Š” ์šฉ์–ด
    • Memory-mapped I/O๋ฅผ ์“ฐ๋Š” ๊ฒฝ์šฐ file์˜ IO์—์„œ๋„ page cache์‚ฌ์šฉ
  • Memory-mapped I/O
    • File์˜ ์ผ๋ถ€๋ฅผ virtual memory์— mapping ์‹œํ‚ด
    • mapping์‹œํ‚จ ์˜์—ญ์— ๋Œ€ํ•œ ๋ฉ”๋ชจ๋ฆฌ ์ ‘๊ทผ ์—ฐ์‚ฐ์€ ํŒŒ์ผ์˜ ์ž…์ถœ๋ ฅ์„ ์ˆ˜ํ–‰ํ•˜๊ฒŒ ํ•จ
  • Buffer cache
    • ํŒŒ์ผ์‹œ์Šคํ…œ์„ ํ†ตํ•œ IO ์—ฐ์‚ฐ์€ ๋ฉ”๋ชจ๋ฆฌ์˜ ํŠน์ • ์˜์—ญ์ธ buffer cache ์‚ฌ์šฉ
    • file ์‚ฌ์šฉ์˜ locality ํ™œ์šฉ
      • ํ•œ๋ฒˆ ์ฝ์–ด์˜จ block์— ๋Œ€ํ•œ ํ›„์† ์š”์ฒญ์‹œ buffer cache์—์„œ ์ฆ‰์‹œ ์ „๋‹ฌ
    • ๋ชจ๋“  ํ”„๋กœ์„ธ์Šค๊ฐ€ ๊ณต์šฉ์œผ๋กœ ์‚ฌ์šฉ
    • replacement algorithm ํ•„์š”(LRU, LFU)
  • Unified Buffer Caches
    • ์ตœ๊ทผ OS์—์„œ๋Š” ๊ธฐ์กด์˜ ๋ฒ„ํผ ์บ์‹œ๊ฐ€ page cache์— ํ†ตํ•ฉ

pbcache0

pbcache

program execution

pe

  • ๋ฉ”๋ชจ๋ฆฌ์— code๊ฐ€ ์•ˆ์˜ฌ๋ผ์™€์žˆ์œผ๋ฉด file system์—์„œ ๋ถˆ๋Ÿฌ์˜ด
  • memory mapped file์ด๋ผ๋ฉด swap area๋กœ ๊ฐ€๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์ž์‹ ์˜ ์ฃผ์†Œ๊ณต๊ฐ„์— ๋งคํ•‘๋˜์–ด ์žˆ์Œ(?)

์šด์˜์ฒด์ œ ์ด๋ก ์ด ๋๋‚ฌ์Šต๋‹ˆ๋‹ค. ๊ฐ€์žฅ ๊ธธ๊ฒŒ ๋Š๊ปด์ง€๋Š” ๊ณผ๋ชฉ์ด์ง€ ์•Š์•˜๋‚˜ ์‹ถ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์œ ๋ช… ๋ฆฌํฌ๋ฅผ ๋ณด๋ฉด ๋‹ค๋ฃจ์ง€ ์•Š๋Š” ๊ณณ์ด ๋Œ€๋‹ค์ˆ˜์ธ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๊ฐœ์ธ์ ์œผ๋กœ ์ž์„ธํžˆ ํ•˜๋‚˜์˜ ์ฃผ์ œ๋ฅผ ์•Œ๊ธฐ๋ณด๋‹ค ํฐ ํ‹€์—์„œ ์–ด๋–ค ๋ฐฉ์‹๊ณผ ๋ฐฉ๋ฒ•์„ ๊ฐ€์ง€๊ณ  ๊ตฌํ˜„์„ ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ์•„๋Š”๊ฒŒ ์ค‘์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค ใ…Žใ…Ž



๐Ÿ“š ์ฐธ๊ณ 

๋ฐ˜๊ต์Šˆ๋‹˜ ์šด์˜์ฒด์ œ


โ‰๏ธ ๋ฉด์ ‘ ์˜ˆ์ƒ ์งˆ๋ฌธ

  1. ํŒŒ์ผ ์‹œ์Šคํ…œ์ด ๋ฌด์—‡์ธ๊ฐ€์š”?
  1. Directory๊ฐ€ ๋ฌด์—‡์ธ๊ฐ€์š”?
  1. ํŒŒ์ผ ์‹œ์Šคํ…œ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•์—๋Š” ๋ฌด์—‡์ด ์žˆ๊ณ  ๊ฐ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”

3-1. Contiguous Alloc์˜ ํŠน์ง•์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

3-2. Linked Alloc์˜ ํŠน์ง•์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

3-3. Indexed Alloc์˜ ํŠน์ง•์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

  1. ๋ฉ”๋ชจ๋ฆฌ์˜ ๋นˆ๊ณต๊ฐ„์€ ์–ด๋–ป๊ฒŒ ๊ด€๋ฆฌํ•˜๋‚˜์š”? ๊ฐ ๊ด€๋ฆฌ ๋ฐฉ๋ฒ•์˜ ํŠน์ง•์„ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”
  1. ๋””๋ ‰ํ† ๋ฆฌ์˜ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์„ค๋ช…ํ•ด์ฃผ์„ธ์š”