Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello I am trying to find the disk cache size and the amount of data prefectched

ID: 3824933 • Letter: H

Question

Hello I am trying to find the disk cache size and the amount of data prefectched by the hard disk. But I dont understand what the difference is between the is between the two questions as I thought prefetching filled the cache. All of this has to be done using C code/timers and linux system calls here is the assignment.

The experiments that are designed should address the following questions l. How big is the block size used by the file system to read data? Hint: use reads of varying sizes and plot the time it takes to do such reads. Also, be wary of prefetching effects that often kick in during sequential reads 2. During a sequential read of a large file, how much data is prefetched by the file system? Hint: time each read and plot the time per read. 3. How big is the file cache? Hint: Repeated reads to a group of blocks that fit in cache will be very fast: repeated reads to a group of blocks that don't fit in cache will be slow. 4. How many direct pointers are in the inode? Hint: think about using write and O fsync0 to answer this question. Or use read(). Also, think about what happens when you extend a file and all of a sudden an indirect pointer has to be allocated how many more writes occur at that point?

Explanation / Answer

Answer.

1.

The block size specifies size that the filesystem will use to read and write data. Larger block sizes will help improve disk I/O performance when using large files, such as databases. Since the disk can read or write data for a longer period of time before having to search for the next block. For example, if you set your block size to 4096, or 4K, and you create a file that is 256 bytes in size, it will still consume 4K of space on your harddrive. For one file that may seem trivial, but when your filesystem contains hundreds or thousands of files, this can add up. Block size can also effect the maximum supported file size on some filesystems. This is because many modern filesystem are limited not by block size or file size, but by the number of blocks. Therefore ,"block size * max # of blocks = max block size" formula.

2. The prefetching system is aggressive, fetching as much data as fits in available memory. It is also relatively simple, fitting in well with existing operating system techniques; most code is in a user-space library. Small, but critical, changes in kernel behavior help ensure that prefetched data is kept until it is used. A contention controller detects changes in available memory and compensates by resizing the prefetching window, avoiding performance collapse when prefetching applications compete for memory and increasing performance when more memory is available.

3. File size is a measure of how much data a computer file contains or, alternately, how much storage it consumes. When a file is written to a file system, it may consume slightly more disk space than the file requires. This is because the file system rounds the size up to include any unused space left over in the last disk sector used by the file.The maximum file size a file system supports depends not only on the capacity of the file system, but also on the number of bits reserved for the storage of file size information. The maximum file size in the FAT32 file system, for example, is 4,294,967,295 bytes, which is one byte less than four gigabytes.

4. In the past, the structure may have consisted of eleven or thirteen pointers, but most modern file systems use fifteen pointers. These pointers consist of (assuming 15 pointers in the inode): Twelve pointers that directly point to blocks of the file's data (direct pointers).the application can issue write() calls to update the file with new contents. Thus, to avoid unexpected data loss due to write buffering, they simply force writes to disk, by calling fsync() , by using direct I/O interfaces that work around the cache, or by using the raw disk interface and avoiding the file system altogether.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote