Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - devbram blk cache option: (5 Items)
   
devbram blk cache option  
Hi ,

I am using devb-ram to create a ramdisk. After loading the devb-ram a lot of memory seems to be used. The following is 
the output when I create a default ramdisk of 2M 

# pidin info
CPU:PPC Release:6.3.0  FreeMem:47Mb/64Mb BootTime:May 07 19:10:12 UTC 2009
Processor1: 80822014 8280 266MHz FPU
# devb-ram
# DINIT
Path=0 -
 target=0 lun=0     Direct-Access(0) - ram  Rev:
# pidin info
CPU:PPC Release:6.3.0  FreeMem:35Mb/64Mb BootTime:May 07 19:10:12 UTC 2009
Processor1: 80822014 8280 266MHz FPU

which is way way more than 2M. An overhead of 10M is a lot for a 2M ramdisk. 

With blk option cache=128k the numbers are good. Since its a ram based file system and access would be fast what would 
be the ideal cache size for a ram based filesystem ? 

Thanks and Regards,
Ashwin
RE: devbram blk cache option  
Ashwin,

 devb-ram was designed originally as a ramdisk and test harness for
io-blk, so by design it pretends to be a "real" block device.  As a
result, io-blk does all the normal caching that it would on real
hardware.  This is the extra memory you see.

You're right that since it's RAM-backed, all that caching isn't as
important.

If you already have another devb-* driver running in your system, the
best way to get a ramdisk is with the "blk ramdisk=<size>" option with
that driver.  This creates a special-purpose ramdisk that io-blk _knows_
is RAM, and all of the caching is bypassed completely.  It's the fastest
performance ramdisk, with very little overhead.

If you do NOT have another devb-* in your system, then you need to
decide how important performance is.  The "ramdisk" has less performance
overhead than using the full devb-ram.

If you aren't worried about performance, and any RAM disk is fast
enough, I suggest these command-line options:

devb-ram cam quiet blk cache=0,vnode=0,automount=hd0t77:/ram:qnx4 ram
capacity=4096

Which will create, format, and mount a 2MB ramdisk at /ram, with minimal
caching overhead.


If you need all the speed you can get, then try the following:

devb-ram cam quiet blk ramdisk=2m,cache=0,vnode=0 ram
capacity=32,nodinit

You'll see a /dev/hd0 and a /dev/ram0, ignore the /dev/hd0, and setup
/ram0 as the ramdisk:

dinit -h /dev/ram0  (ignore the warning about raw device instead of
partition)
mount -tqnx4 /dev/ram0 /ram

David

> -----Original Message-----
> From: Ashwin Patwekar [mailto:community-noreply@qnx.com] 
> Sent: May 7, 2009 10:29 AM
> To: general-filesystems
> Subject: devbram blk cache option
> 
> Hi ,
> 
> I am using devb-ram to create a ramdisk. After loading the 
> devb-ram a lot of memory seems to be used. The following is 
> the output when I create a default ramdisk of 2M 
> 
> # pidin info
> CPU:PPC Release:6.3.0  FreeMem:47Mb/64Mb BootTime:May 07 
> 19:10:12 UTC 2009
> Processor1: 80822014 8280 266MHz FPU
> # devb-ram
> # DINIT
> Path=0 -
>  target=0 lun=0     Direct-Access(0) - ram  Rev:
> # pidin info
> CPU:PPC Release:6.3.0  FreeMem:35Mb/64Mb BootTime:May 07 
> 19:10:12 UTC 2009
> Processor1: 80822014 8280 266MHz FPU
> 
> which is way way more than 2M. An overhead of 10M is a lot 
> for a 2M ramdisk. 
> 
> With blk option cache=128k the numbers are good. Since its a 
> ram based file system and access would be fast what would be 
> the ideal cache size for a ram based filesystem ? 
> 
> Thanks and Regards,
> Ashwin
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post28921
> 
> 
RE: devbram blk cache option  

> -----Original Message-----
> From: David Sarrazin [mailto:community-noreply@qnx.com]
> Sent: May-07-09 11:30 AM
> To: general-filesystems
> Subject: RE: devbram blk cache option
> 
> Ashwin,
> 
>  devb-ram was designed originally as a ramdisk and test harness for
> io-blk, so by design it pretends to be a "real" block device.  As a
> result, io-blk does all the normal caching that it would on real
> hardware.  This is the extra memory you see.
> 
> You're right that since it's RAM-backed, all that caching isn't as
> important.
> 
> If you already have another devb-* driver running in your system, the
> best way to get a ramdisk is with the "blk ramdisk=<size>" option with
> that driver.  This creates a special-purpose ramdisk that io-blk
> _knows_
> is RAM, and all of the caching is bypassed completely.  It's the
> fastest
> performance ramdisk, with very little overhead.
> 

Wasn't there a bug with ram disk setup by devb-* with version prior to 6.4.0?
RE: devbram blk cache option  
 

> -----Original Message-----
> From: Mario Charest [mailto:community-noreply@qnx.com] 
> Sent: May 7, 2009 11:32 AM
> To: general-filesystems
> Subject: RE: devbram blk cache option
> 
> 
> 
> > -----Original Message-----
> > From: David Sarrazin [mailto:community-noreply@qnx.com]
> > Sent: May-07-09 11:30 AM
> > To: general-filesystems
> > Subject: RE: devbram blk cache option
> > 
> > Ashwin,
> > 
> >  devb-ram was designed originally as a ramdisk and test harness for 
> > io-blk, so by design it pretends to be a "real" block device.  As a 
> > result, io-blk does all the normal caching that it would on real 
> > hardware.  This is the extra memory you see.
> > 
> > You're right that since it's RAM-backed, all that caching isn't as 
> > important.
> > 
> > If you already have another devb-* driver running in your 
> system, the 
> > best way to get a ramdisk is with the "blk ramdisk=<size>" 
> option with 
> > that driver.  This creates a special-purpose ramdisk that io-blk 
> > _knows_ is RAM, and all of the caching is bypassed 
> completely.  It's 
> > the fastest performance ramdisk, with very little overhead.
> > 
> 
> Wasn't there a bug with ram disk setup by devb-* with version 
> prior to 6.4.0?
> 

You're right Mario.  I missed that this was 6.3.0.  For now use the
first option (using devb-ram without the ramdisk option).  That bug was
fixed in 6.4.0.  The first option results in slightly lower RAM usage
than using ramdisk, so depending on what the goals were here, that might
be the better choice anyway.

David

> _______________________________________________
> General
> http://community.qnx.com/sf/go/post28943
> 
> 
Re: RE: devbram blk cache option  
Thanks David and Mario. 
I am on 6.3.0 so for now I will use the first approach.

Regards,
Ashwin