Hi,
I have a product which boots from a cdrom, using a ramdisk for its root filesystem. This scheme allows for silent operation after boot, and allows the user to remove the CD at run time.
Of course it also uses a good deal of additional RAM, and I'd like to reduce this. For example, a binary running from the the ramdisk takes up memory on the ramdisk itself, the same amount of memory in terms of cached disk reads, and code size plus runtime allocations as a process. I thought perhaps I could reduce one or both of the first two.
Questions:
Can I compress the ramdisk in memory? I was thinking about using cloop e2compr or squashfs on the ramdisk. Any ideas why this wouldn't work conceptually? Practically, has anyone used one of these with the
2.2 kernel? (I'm stuck with it for the time being.)Alternatively, can I turn off read caching for the ramdisk? Correct me if I'm wrong, but it seems redundant to be caching files in ram when reading them off a ramdisk. I realize that the cached pages will get evicted if memory is running low, but I'd like to avoid the situation where a file read from the ramdisk replaces one read from CD.
Incidentally, just throwing in more RAM isn't an option, as this has to work with existing units in the field.
Thanks, Greg