<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 24, 2018 at 9:24 AM, Udit agarwal <span dir="ltr"><<a href="mailto:dev.madaari@gmail.com" target="_blank">dev.madaari@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jul 24, 2018 7:45 PM, "Gedare Bloom" <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br type="attribution"><blockquote class="gmail-m_-3623289588717233616quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_-3623289588717233616quoted-text">On Tue, Jul 24, 2018 at 10:12 AM, Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
> On Tue, Jul 24, 2018 at 4:48 AM, Udit agarwal <<a href="mailto:dev.madaari@gmail.com" target="_blank">dev.madaari@gmail.com</a>> wrote:<br>
>> Hi all,<br>
>> I've been trying to use IMFS with a ramdisk on BBB. Here's what i did:<br>
>><br>
>> After creating a ram disk (block size:512, block count:262144), i used<br>
>> mount_and_make_target_path("/d<wbr>ev/rda","/mnt",RTEMS_FILESYSTE<wbr>M_TYPE_IMFS,RTEMS_FILESYSTEM_<wbr>READ_WRITE,NULL)<br>
>><br>
>> There is no error during bootup, but when allocating a file(in the /mnt<br>
>> directory) of size 10MB(or even of 1MB) it gives a file too large error.<br>
>> I've used similar config for RFS too and that did worked, so probably<br>
>> there's no issue while setting up the RAM disk.<br>
>><br>
>> I've also tried testsuite/fstests/imfs_support setup, but looks like similar<br>
>> method doesn't work with ram-disks<br>
><br>
> What did you get back from mount_and_make_target_path()? Did it<br>
> succeed? I'm pretty sure this method should not be used for imfs, see<br>
> fstests/imfs_support/fs_suppor<wbr>t.c<br>
><br>
<br>
</div>Oh, I take that back. Sebastian's comment is accurate. You can<br>
probably make your approach work by replacing "/dev/rda" with NULL I<br>
would guess. The IMFS doesn't need a source, since it is backed by the<br>
heap.<br>
<div class="gmail-m_-3623289588717233616elided-text"></div></blockquote></div></div></div></span><div dir="auto">Yes, Sebastian's approach worked. I'm able to generate some benchmarking stats on IMFS too.</div></div></blockquote><div><br></div><div>I would expect the tuning parameter CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK</div><div>to have a significant impact on the performance of the IMFS. The default size is 128.</div><div>There is a block comment in cpukit/libfs/src/imfs/imfs.h which shows the possible values.</div><div>Since the file blocks are malloc'ed, the blocks default small-ish to avoid wasting </div><div>memory for small files. </div><div><br></div><div>The IMFS uses an inode structure based on that of the original UNIX filesystem.</div><div>So as the block size goes up, you can have more and more blocks in the</div><div>maximum file size.</div><div><br></div><div><div>* The data structure for the in-memory "memfiles" is based on classic UNIX.</div><div> *</div><div> * block_ptr is a pointer to a block of IMFS_MEMFILE_BYTES_PER_BLOCK in</div><div> * length which could be data or a table of pointers to blocks.</div><div> *</div><div> * Setting IMFS_MEMFILE_BYTES_PER_BLOCK to different values has a significant</div><div> * impact on the maximum file size supported as well as the amount of</div><div> * memory wasted due to internal file fragmentation. The following</div><div> * is a list of maximum file sizes based on various settings</div><div> *</div><div> * @code</div><div> * max_filesize with blocks of 16 is 1,328</div><div> * max_filesize with blocks of 32 is 18,656</div><div> * max_filesize with blocks of 64 is 279,488</div><div> * max_filesize with blocks of 128 is 4,329,344</div><div> * max_filesize with blocks of 256 is 68,173,568</div><div> * max_filesize with blocks of 512 is 1,082,195,456</div></div><div><br></div><div><br></div><div>If a system has lots of memory and wants to store larger files with lower malloc</div><div>overhead, then the default size should be increased. </div><div><br></div><div>NOTE: The IMFS silently ignores requests which are not power of</div><div>2 and are < 16 or greater than 512. See IMFS_determine_bytes_per_block()</div><div>and its use in imfs_initsupp.c.</div><div><br></div><div>For the purposes of benchmarking and since the 512 upper</div><div>block size (plus implied max file size) was determined so long</div><div>ago that a 1G RAM file seemed impossible, it probably makes sense</div><div>to let people configure up to 4K or 8K as the IMFS bytes per block.</div><div><br></div><div>And we should consider whether mis-configuring the bytes per block</div><div>in the IMFS should result in a silent defaulting or a fatal error. I know</div><div>I was surprised the last time I ran into this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail-m_-3623289588717233616quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_-3623289588717233616elided-text"><br>
>> --<br>
>> Regards,<br>
>> Udit kumar agarwal<br>
>> <a href="http://uditagarwal.in/" rel="noreferrer" target="_blank">http://uditagarwal.in/</a><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> users mailing list<br>
>> <a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
>> <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman<wbr>/listinfo/users</a><br>
</div></blockquote></div><br></div></div></span></div>
<br>______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br></blockquote></div><br></div></div>