Defining cache skips for various file systems

I have a project for a school where I need to find out how many misses in the cache file system will take place under heavy and light loads and on a multiprocessor machine. Having discussed this with my professor, I came up with a basic execution plan:

  • Create a program that will crash the file system and fill the buffer cache.
  • Use the system comparison tool to record the number of misses in the cache.
  • Rinse and repeat with new conditions.

But, being a beginner in developing an operating system, I'm not sure how to proceed. So, here are some points where I need help :

  • What actions will the ideal program perform to fill the buffer cache? Currently, the program I wrote reads and writes to several different files, x times.
  • What tools exist to record the number of misses in the cache? I looked at oprofile, but I don't think it controls the file system cache. But I found this list that looks promising.
  • Will other running processes affect these tests?

Thanks for your help!

+4
source share
2 answers

1) If you are trying to test the performance of your file system, drop a few threads that manipulate a lot of file metadata along with your I / O streams. In addition, when performing I / O on multiple parallel threads, mix streams with large-scale transfers and streams that perform small movements. Many file systems will combine small I / O operations together into larger requests that the physical disk can handle in a more time-efficient manner, and mixing I / O of different sizes can help increase the cache faster (because it should buffer the combined I / O) .

2) Be careful with this list of tools, many of them look like they are designed to work on raw devices, and not through the file system level (therefore, the results you obtained may not represent what you think they are doing) . If you are looking for a tool to test a specific file system, the best option would be to check with the development team of that file system. They most likely point to the tool they used to evaluate their FS during development, even if it is a custom tool developed internally.

3) Yes, everything that works and can access the file system under test can potentially affect your results. You might want to create a separate file system that will be used only for this test, and disable any background checks that might try to access it during the execution of your tests.

+2
source

This is an interesting question. Maybe I can give you a partial answer.

You should know that Linux has several file system caches, which may have different tools.

  • Inode Cache
  • Dentry Cache
  • Block cache

One way is to calculate (guess?) How much block-level traffic your operations should handle, and then measure the operations of the real block (read, write, search) using blktrace.

I donโ€™t know how to read cache miss status in inode and dentry cache. I would really like to be told that I am not right here.

The hard way is to annotate the cache and inode storage with their own counters, but these caches are pretty hard core code.

0
source

All Articles