재질문) Ext2 file system 상에서 sparse file의 disk block 할당 순서

lsfeel0204의 이미지

안녕하세요?

File IO쪽 공부하다가 궁금한게 있어 질문을 올립니다..^^;;

ext2, ext4 file system 상에서 8G짜리 sparse file을 하나 만들어 놓고,

IOZone benchmark tool로 random write를 수행하였는데요.

blktrace로 write pattern을 분석해 보니까, 신기하게도 LBA 앞에서부터 write 연산이 발생하더라고요..

(당연한 얘기인지는 모르겠지만..제가 이쪽에 지식이 별로 없어서..ㅎㅎ)

그래서 ext2 file system에서 inode와 연관해서 disk block이 할당되는 과정에 대해서 궁금합니다.

실제로 LBA기준으로 random write라 하더라도, 해당 byte offset에서 disk block이 할당되어 있지 않다면, file system에 쓰기 요청이 오면 그 시점에 할당이 되는건지...

그리고 File system 상에 IO가 발생할 때 제일 밑 storage 단까지의 계략적인 과정을 대충 정리해 봤는데 맞는지 봐주시면 감사하겠습니다...^^;;

- User mode application에서 file descriptor를 통한 write system call 호출
- OS trap이 발생하여 kernel mode로 넘어감 (context switching 발생)
- VFS(Virtual file system)을 거쳐 해당 storage의 specific file system(e.g., ext2, ext4, etc.)의 write 함수 호출
- 해당 file의 inode 정보를 읽어와서 write를 수행하고자 하는 byte offset에 disk block(LBA)이 할당되어 있는지 확인
- 할당되어 있지 않을 경우, 각 file system 정책에 따라 disk block 할당
- inode 정보 변경
- Page cache에 write 수행 (일반 File I/O)
- Page cache를 bypass (O_SYNC, O_DIRECT I/O일 경우)
- File system이 실제 데이터를 할당된 LBA에 write 요청
- Generic block layer의 Elevator layer에서 I/O scheduling(e.g. NOOP, CFQ) 수행
- Request queue에 전달된 요청을 device driver를 통해 storage에 전달
- Sync, async IO에 따라 이후 동작은 달라짐
- 변경된 File system inode 정보도 metadata area에 기록
- 각 file system에 따른 추가 동작 수행 (e.g., Ext3,4의 Journaling 등)

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.