<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 10, 2013 at 6:00 PM, Greg Freemyer <span dir="ltr"><<a href="mailto:greg.freemyer@gmail.com" target="_blank">greg.freemyer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
Mandeep Sandhu <<a href="mailto:mandeepsandhu.chd@gmail.com">mandeepsandhu.chd@gmail.com</a>> wrote:<br>
>On Thu, Oct 10, 2013 at 5:00 PM, Ulka Vaze <<a href="mailto:ulka.vaze@l2it.com">ulka.vaze@l2it.com</a>> wrote:<br>
><br>
>> Hi,<br>
>> disk cache is same as filesystem cache. Also called buffer cache.<br>
>> This is implemneted below fs layer.<br>
>> It is basically a cache of disk blocks mainatined in RAM. (In pages)<br>
>> called buffers.<br>
>><br>
><br>
>Ok. So this won't contain "files" but rather "blocks" many of which<br>
>will<br>
>represent a single file?<br>
<br>
</div>The buffer cache knows nothing about files. It may happen to contain the blocks that correspond to a complete file, but the buffer cache doesn't have any way to know that.<br>
<div class="im"><br>
>> The purpose of this cache is to improve performance as disk devices<br>
>are<br>
>> slow.<br>
>> You can access this cache from the kernel.<br>
>> Block layer accesses this from the request structure and commits<br>
>blocks on<br>
>> disk.<br>
>> There are more layers in between like IOschedulers / SCSI etc.<br>
>><br>
><br>
>Where does the mapping for file to disk pages/blocks exist? Is it in<br>
>the<br>
>inode or dentry entries or something else?<br>
<br>
</div>That is a very filesystem dependent question.<br>
<br>
In general dentry entries point to inodes and inodes point to blocks of pointers. Those pointers point to actual data blocks.<br>
<br>
You need to discuss a specific filesystem type to even start to discuss anything specific.<br>
<br>
Ie. Does the fat filesystem have an equivalent of inodes?<br>
<div class="im"><br>
>> How does your device accesses files ?<br>
>><br>
><br>
>The device itself runs stripped down version of a fairly recent Linux<br>
>version (3.x). It has DMA capabilities to transfer content to/from the<br>
>hosts memory from/to it's own.<br>
<br>
</div>If 3.x is really current you have 2 more options at least: dm-cache and bcache.<br>
<br>
I don't know much about either, but they are going to be better options for I think than the traditional buffer cache.<br>
<span class="HOEnZb"><font color="#888888">Greg<br>
--<br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.<br></font></span></blockquote><div><br></div><div>Ulka, Greg,<br><br></div><div>Thanks a lot for your inputs.<br><br></div><div>I have a lot of reading up to do, so I'll come back if have any specific doubts.<br>
<br></div><div>Thanks again.<br><br></div><div>Regards,<br>-mandeep<br><br></div></div></div></div>