Download presentation
Presentation is loading. Please wait.
1
Project 4. “File System Implementation”
TA Dongjin Kim
2
Introduction to Projects
Project 1: Setting up Environment for Project Project 2: Linux Fundamental Project 3: System Call and Synchronization Project 4: File System Project 5: Device Driver for Embedded H/W Especially, including “BeagleBoard Development”
3
Task 1 Contents of Project 4 Task 1. Buffer cache implementation on FUSE file system (50%) Task 2. File system performance evaluation (20%) Report (30%) Explanation about your work Answer to questions
4
FUSE File System What is FUSE?
Task 1 FUSE File System What is FUSE? FUSE : File System in User space General File System is in the Kernel Space Our Goal Simple Buffer Cache Management in FUSE
5
Task 1 FUSE Install Download provided “fuse tar.gz” from the course home page # wget # tar xf fuse tar.gz # cd fuse-2.9.4 # ./configure # make # make install
6
Task 1 FUSE Tools # wget # tar xf fuse-tutorial. # cd fuse-tutorial # ./configure # make
7
Use FUSE File System # cd src # mkdir /mnt/fuse # mkdir /root/fuse
Task 1 Use FUSE File System # cd src # mkdir /mnt/fuse # mkdir /root/fuse # ./bbfs -o direct_io /mnt/fuse /root/fuse # mount Check information Mounting Point Real Dir.
8
General File System File system operation in kernel space User Program
Task 1 General File System File system operation in kernel space User Program read() write() User Space Kernel Space VFS File System
9
Current FUSE File System
Task 1 Current FUSE File System File system operation in user space FUSE bb_read bb_write User Program read() write() read() write() User Space System Call Kernel Space VFS File System
10
Buffer Cache Implementation
Task 1 Buffer Cache Implementation Add buffer cache Add this FUSE bb_read bb_write Buffer Cache User Program read() write() read() write() User Space System Call Kernel Space VFS File System
11
Modify FUSE for Buffer Cache Implementation
Task 1 Modify FUSE for Buffer Cache Implementation Modify 2 functions in bbfs.c bb_read bb_write Read and write operations Read Buffer hit Return contents Buffer miss If buffer is full, evict some contents Read from disk and write to buffer Write Write into the buffer Implement 4 eviction algorithms 1.Random, 2.FIFO, 3. FIFO with second chance, and 4.LRU
12
Four Eviction Algorithms to Implement
Task 1 Four Eviction Algorithms to Implement 1. Random Choose victim randomly 2. FIFO First-In First-Out 3. FIFO with second chance From FIFO, instead of immediately eviction, check if its referenced bit is set If not set evict If set clear the referenced bit, move the entry to the head of the queue, and check next entry 4. LRU Least Recently Used For buffer hit, entry moves to the head of the queue
13
Specification to Implement the Buffer Cache
Task 1 Specification to Implement the Buffer Cache Do not use O_DIRECT flags for testing the given FUSE file system FUSE doesn’t support O_DIRECT yet Buffer Cache Data Cache Size : 5MB Don’t care about consistency (for just 1 user)
14
Performance Evaluation
Task 2 Performance Evaluation Use benchmark tool of project 1 Remove all O_DIRECT flags for FUSE Use FILESIZE 10MB Run benchmark and analyze Current Linux file system Same as project 1 FUSE with 0. No buffer, 1. Random Buffer, 2. FIFO Buffer, 3. FIFO with second chance Buffer, 4. LRU Buffer.
15
Project1 Task2. Simple C Program
Benchmark Computer program in order to assess the relative performance of an object, normally by running a number of standard tests and trials against it We can make File System Benchmark! with Sequential Access and Random Access Sequential Access Random Access Access Order 1 2 3 4 5 6 7 2 5 3 1 4 7 6 Logical Block 1 2 3 4 5 6 7 1 2 3 4 5 6 7
16
Project 1 Task2. Simple C Program
Sample code is here File create Sequential Write Sequential Read Random Write Random Read File Delete End You should Implement 3 functions You can refer “file_write_sequential()” function void file_read_sequential() : about 20 lines void file_write_random() : about 25 lines void file_read_random() : about 25 lines
17
Questions for the Report
Find answers from your brain, web site, book, Q1. Why performance of file system is different? Q2. Why performance of each eviction algorithm is different? In which cases each eviction algorithm can have advantage? Q3. Pros. and Cons. of FUSE file system (against file system in kernel space) Specify the references
18
Submission Contents Submission Source codes Report
Implemented and modified codes Include comments in the source codes Report Key points of your source code Do not attach entire source codes in the report Result screenshots Answers of questions Submission Due date: Dec. 1,PM 23:59 Delay penalty 10% per day (AM 00:00) Be careful! Do not send to other TAs Title: [EE516 Project 4] student_number Attached file: student_number.zip Various compression format is allowed
19
Additional Information
1. You can start it with the source code "bbfs.c" uploaded in "Syllabus and Lecture Notes" section. 2. For the task 2, you can use benchmark code available in "Projects -> Project 1" section. 3. For the task 2, fix second parameter of the benchmark, which is "request size", as 4096.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.