Author Topic: What's Tmpfs For?  (Read 4005 times)

PaulBx1

  • Newbie
  • *
  • Posts: 41
    • View Profile
What's Tmpfs For?
« on: March 25, 2006, 05:45:21 pm »
I was reading Meanie's description of differences between Sharp and Cacko:

"However, there are also a few differences introduced by Cacko. The startup image in Cacko is bz2 compressed to save space. It gets extracted to /tmp (which is 10MB in size compared to the 1MB on Sharp) during startup and loaded from there. Once loaded, the extracted image is deleted. A bigger tmpfs allows you to open larger files but since tmpfs uses physical RAM, less physical memory is available, so instead of having 63MB, you end up with 54MB. This is a reasonable trade-off."

I was also reading this interesting article about what can be done with tmpfs.

That makes me wonder, why isn't tmpfs in the Zaurus dynamically allocating the size it needs at any one time, rather than sitting there doing nothing but consuming 10MB? And why don't we put things that belong there like temporary logs and what-not? Or is everything that makes sense already there (only 40k in my machine)?

Seems like if the Sharp ROM can get by with 1MB, Cacko should be able to also if the tmpfs is capable of resizing.
SL-C1000 Cacko 1.23 in hand, PDP-11 RT-11 in brain

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
What's Tmpfs For?
« Reply #1 on: March 26, 2006, 05:36:24 am »
It does grow with the size of the files you put in there however if you dont limit to a max of 1/2 your ram you cant unmount it or deallocate it (cant remeber which)

for logs you can always symlink but i prefer to have my logs after a reboot, espesially when i am testing things
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
What's Tmpfs For?
« Reply #2 on: March 26, 2006, 06:41:47 am »
Quote
It does grow with the size of the files you put in there however if you dont limit to a max of 1/2 your ram you cant unmount it or deallocate it (cant remeber which)

for logs you can always symlink but i prefer to have my logs after a reboot, espesially when i am testing things
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120291\"][{POST_SNAPBACK}][/a][/div]

Yes perhaps that is worth clarifying... that 10Mb specified is a maximum size that tmpfs can reach. The tmpfs on the Sharp and Cacko ROMs are used for among other things /tmp and 1Mb is somewhat on the small size.

With only 1Mb of /tmp some package management doesn't work if you  attempt to use large ipk files and most files packed with UCLX will not execute (things like Kismet) because UCLX uses /tmp to decompress the executable.

If you are concerned about the amount of space used by tmpfs you could reduce it but unless you fully understand the reason that it's set to 10Mb don't change it.

-Andy
« Last Edit: March 26, 2006, 06:42:28 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

koen

  • Hero Member
  • *****
  • Posts: 1008
    • View Profile
    • http://dominion.thruhere.net/koen/cms/
What's Tmpfs For?
« Reply #3 on: March 26, 2006, 07:51:27 am »
Quote
Quote
It does grow with the size of the files you put in there however if you dont limit to a max of 1/2 your ram you cant unmount it or deallocate it (cant remeber which)

for logs you can always symlink but i prefer to have my logs after a reboot, espesially when i am testing things
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120291\"][{POST_SNAPBACK}][/a][/div]

Yes perhaps that is worth clarifying... that 10Mb specified is a maximum size that tmpfs can reach. The tmpfs on the Sharp and Cacko ROMs are used for among other things /tmp and 1Mb is somewhat on the small size.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120303\"][{POST_SNAPBACK}][/a][/div]

Depending on your linux kernel version tmpfs is statically allocated (i.e. it will use 10MB regardless of what you put in it) or dynamically (it will take as much ram as needed and maxes  out at 1/2 your ram size.).
IIRC with kernel 2.6 tmpfs buffers can be paged out to swap, so apps can use more ram.
Forums are not bugtrackers!!! Smart questions
Ångström release team
iPAQ h2210, iPAQ h5550, iPAQ hx4700, Zaurus SL-C700, Nokia 770, all running some form of GPE
My blog

PaulBx1

  • Newbie
  • *
  • Posts: 41
    • View Profile
What's Tmpfs For?
« Reply #4 on: March 27, 2006, 11:05:55 am »
I just have the Kernel v2.4.20 that came with Cacko 1.23. Apparently it is static.

Quote
If you are concerned about the amount of space used by tmpfs you could reduce it but unless you fully understand the reason that it's set to 10Mb don't change it.

Sounds like good advice, I will leave it unmolested for now.    

Thanks for the clarifications, guys!
SL-C1000 Cacko 1.23 in hand, PDP-11 RT-11 in brain

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
What's Tmpfs For?
« Reply #5 on: March 27, 2006, 11:20:05 am »
Quote
ur linux kernel version tmpfs is statically allocated (i.e. it will use 10MB regardless of what you put in it) or dynamically (it will take as much ram as needed and maxes  out at 1/2 your ram size.).
IIRC with kernel 2.6 tmpfs buffers can be paged out to swap, so apps can use more ram.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=120305\"][{POST_SNAPBACK}][/a][/div]

actually the documentation in Documentation/filesystems/tmpfs.txt on the 2.4.20 kernel from the Sharp source suggests that version can use swap too.

and an unspecified default is 1/2 of the RAM, specifying the size either limits or extends that.. it is possible to use size specifiers like 25% or 75% also.

-Andy
« Last Edit: March 27, 2006, 11:21:29 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card