http://kernelnewbies.org   사이트에는 커널의 새소식들이 올라옵니다.


그중에서 filesystem barriers 와 관련된 것 한가지를 소개합니다.


filesystem barriers 라는 기능이 있습니다.


쉽게 애기하면 커널의 블록 드라이버에 캐쉬가 존재하듯이

하드디스크에도 캐쉬가 존재합니다.

운없게도 디스크가 동작중에 전원이 나가거나 하면 분명히 데이타를 다 썼는데...

재부팅후에 데이타가 없는 결과가 발생하기도 합니다.


이러한 것을 막고자 디스크에 있는 데이타가 다 쓰여진 것을 확인하는게 filesystem barriers 입니다.

아래의 내용은 원문입니다.


1.3. File system barriers enabled by default in ext3

Hard disks have a memory buffer were they temporally store the instructions and data issued from the OS while the disk processes it. The internal software of modern disks changes the order of the instructions to improve performance, which means that instructions may or may not be committed to the disk in the same order the OS issued them. This breaks many of the assumptions that file systems need to reliably implement things like journaling or COW, so disks provide a "cache flush" instruction that the OS uses when it needs it. In the Linux world, when a file system issues that instruction, it is called a "barrier". File systems such as XFS, Btrfs and ext4 already use and enable barriers by default; ext3 supports them but until this release it did not enable them by default: while the data safety guarantees are higher, their performance impact in Ext3 is noticeable in many common workloads, and it considered that it was an unacceptable performance regression to enable them by default. However, Linux distributions like Red Hat have enabled barriers by default in Ext3 for a long time, and now the default for mainline has been changed as well.

In other words: if you use Ext3 and you note performance regressions with this release, try disabling barriers ("barrier=0" mount option).


ext2 나 ext3 에는 디폴트로 이기능이 disable 되어 있었습니다.

왜냐하면 파일 시스템의 자체 문제로 이기능이 오히려 성능저하를 가져온다고 했기 때문입니다.

하지만 많은 시간동안 적용시켜 본 결과 별 문제가 없어 보여서 default 로 enable 을 사용하기로 했답니다.


다만!!!!!

혹시 ext3 를 쓰고 있는데 업데이트를 했더니 성능저하가 나왔으면... 이 옵션을 꺼보랍니다.(쪼금 시크한듯....)

방법은 마운트 옵션에서 

barrier=0 을 주고 마운트를 하라고 합니다.