From: James S. <ja...@st...> - 2003-09-21 10:06:39
|
> At 10:13 Uhr +0100 21.09.2003, James Stevenson wrote: > > > - Why does uml implement RAM in files in tmpfs? Why not just normal > > > malloc'ed memory? At least I wouldn't need to use tmpfs (which would > >> be a little simplification in the setup) - it'll end up in RAM or > >> swap anyways, so.. > > > >because if you create the vm file in /tmp or somewhere else on the disk > >the host will continuously write back the memory image into the disk > >file. Which causes a massive slowdown. .. > > Yes, I think you misunderstood me, maybe I was unclear. What I wanted > to ask is not why tmpfs is better than a normal filesystem for /tmp, > but why uml doesn't use malloc instead of mmap to a tmp file. I > suggest that malloc and mmap to a file on tmpfs should have equal > performance (maybe malloc even sligtly better), but malloc does have > less administrative burden / is less awkward. Using mmap allows you to map a file that is shared between multiple processes which is the way uml runs. mmap can be called in such a way that the memory returned is matched tot eh file image but anyone who calls with the shared argument gets the memory shared on the file image. If you malloc data it is only avilable in a single process. |