SCALABILITY OF EXT2
description
Transcript of SCALABILITY OF EXT2
![Page 1: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/1.jpg)
SCALABILITY OF EXT2
Yancan Huang, Guoliang Jin
May 13, 2008
![Page 2: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/2.jpg)
MOTIVATION Graph for create
![Page 3: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/3.jpg)
MOTIVATION Graph for open
![Page 4: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/4.jpg)
MOTIVATION
Same method, different graphs: Code for create:asmlinkage long sys_creat(const char __user * pathname,
int mode){
return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC,
mode);}
Code for open:sys_open(pathname, O_RDWR);
Why? Create: where does the time go?
![Page 5: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/5.jpg)
OVERVIEW
Motivation What is scalability of file system Experiment environment
Setup Techniques Benchmark
Create: where does the time go The file create process What does ext2_lookup do What dose ext2_create do The file open process
Conclusion & Future work
![Page 6: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/6.jpg)
WHAT IS SCALABILITY OF FILE SYSTEM
Large File Systems
Large, Sparse Files
Large, Contiguous Files
Large Directories
Large Numbers of Files
![Page 7: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/7.jpg)
EXPERIMENT ENVIRONMENT
Setup: UML Mount our own ext2 file system called ext2k With 1GB empty virtual disk
Measuring techniques gettimeofday long long c; __asm__ __volatile__ (“rdtsc” : “=A” (c));
Output techniques printk write to log on host
Benchmark Sequential create and open on a 1GB disk
![Page 8: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/8.jpg)
OVERVIEW
Motivation What is scalability of file system Experiment environment
Setup Techniques Benchmark
Create: where does the time go The file create process What does ext2_lookup do What dose ext2_create do The file open process
Conclusion & Future work
![Page 9: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/9.jpg)
CREATE: WHERE DOES THE TIME GO
asmlinkage long sys_creat(const char __user * pathname, int mode)
{return sys_open(pathname,
O_CREAT | O_WRONLY | O_TRUNC, mode);
}
![Page 10: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/10.jpg)
THE FILE CREATE PROCESS
The process of sys_opensys_open { // fs/open.c
do_sys_open { // fs/open.cgetnameget_unused_fd_flagsdo_filp_open { // fs/open.c
open_namei // fs/namei.cinameidata_to_filp
}fsnotify_openfd_installputname
}prevent_tail_call
}
![Page 11: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/11.jpg)
THE FILE CREATE PROCESS When open_namei meets file create
open_namei {……path_lookup_createlookup_hashopen_namei_create if (! error)
return 0;……
}
45%54%
![Page 12: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/12.jpg)
THE FILE CREATE PROCESS The process of lookup_hash
lookup_hash {permission__lookup_hash {cached_lookup // always fail for create
struct dentry *new = d_allocdentry = inode->i_op->lookup if (!dentry) // always true for
createdentry = new
return dentry
}
}
![Page 13: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/13.jpg)
THE FILE CREATE PROCESS The process of open_namei_create
open_namei_create {vfs_create {
may_createsecurity_inode_createdir->i_op->create // dir is an
inodefsnotify_create
}may_open
}
![Page 14: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/14.jpg)
WE ARE NOW IN EXT2
Thanks to inode->i_op->lookup Thanks to inode->i_op->create
Going to ext2_lookup Going to ext2_create
![Page 15: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/15.jpg)
WHAT DOES EXT2_LOOKUP DO
The process of ext2_lookupext2_lookup {
ext2_inode_by_name {ext2_find_entry {
……
}}igetd_splice_alias
}
![Page 16: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/16.jpg)
WHAT DOES EXT2_FIND_ENTRY DO
The process of ext2_find_entryext2_find_entry {
do {ext2_get_pageext2_last_byte
while () {ext2_matchext2_next_entry
}} while ()
}
![Page 17: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/17.jpg)
NOW WHERE WE ARE When open_namei meets file create
open_namei {……path_lookup_createlookup_hashopen_namei_create if (! error)
return 0;……
}
![Page 18: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/18.jpg)
WHAT DOES EXT2_CREATE DO The process of ext2_create
ext2_create {ext2_new_inodemark_inode_dirtyext2_add_nondir {
ext2_add_linkd_instantiate
}
}
![Page 19: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/19.jpg)
WHAT DOES EXT2_ADD_LINK DO The process of ext2_add_link
ext2_add_link {for () {
ext2_get_pageext2_last_bytewhile () {
ext2_matchext2_rec_len_from_disk
}} __ext2_write_beginext2_commit_chunk
}
![Page 20: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/20.jpg)
HOW OFTEN THESE WHILE LOOP EXECUTED
![Page 21: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/21.jpg)
REVISIT THE CREATE GRAPH
![Page 22: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/22.jpg)
THE FILE OPEN PROCESS
The process of sys_opensys_open { // fs/open.c
do_sys_open { // fs/open.cgetnameget_unused_fd_flagsdo_filp_open { // fs/open.c
open_namei // fs/namei.cinameidata_to_filp
}fsnotify_openfd_installputname
}prevent_tail_call
}
![Page 23: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/23.jpg)
THE FILE OPEN PROCESS When open_namei meets file open
open_namei {……if (!(flag & O_CREAT)) {
error = path_lookup_open(dfd, pathname, lookup_flags(flag), nd, flag);
if (error)return error;
goto ok;} ……
}
![Page 24: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/24.jpg)
THE FILE OPEN PROCESS The process of path_lookup_open
path_lookup_open {__path_lookup_intent_open {
get_empty_filpdo_path_lookup {
path_walk {
link_path_walk {……
}}
}}
}
![Page 25: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/25.jpg)
THE FILE OPEN PROCESS The process of link_path_walk
link_path_walk {__link_path_open // in the dcacheif (fail) { // force real lookup
requestsdgetmntgrt__link_path_open
}
}
![Page 26: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/26.jpg)
REVISIT THE OPEN GRAPH
![Page 27: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/27.jpg)
OVERVIEW Motivation What is scalability of file system Experiment environment
Setup Techniques Benchmark
Create: where does the time go The file create process What does ext2_lookup do What dose ext2_create do The file open process
Conclusion & Future work
![Page 28: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/28.jpg)
CONCLUSION
In create, ext2_lookup makes sure there won’t be two files with the same name, and ext2_add_link performs a similar routine again
The dentry structure of ext2 is linear Using B-tree to manage this in memory structure
would show better performance
Another scalability issue in ext2 is that its inode number is determined when the disk is formatted
![Page 29: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/29.jpg)
FUTURE WORK
Try to use B-tree to manage the dentry structure and test the performance But the B-tree itself is complex
Try more workload
![Page 30: SCALABILITY OF EXT2](https://reader036.fdocuments.us/reader036/viewer/2022081511/56814d36550346895dba61eb/html5/thumbnails/30.jpg)
QUESTIONS?