Re: mmap() versus read()

Pavel Machek (pavel@elf.ucw.cz)
Wed, 11 Mar 1998 20:00:27 +0100


Hi!

> bh> On Tue, 10 Mar 1998, Pavel Machek wrote:
> bh> [context: paging executables from origin; why not swap?]
> >> Ok. Is there easy way to change it? On my system, swap is order of
> >> magnitude faster than disk. I would like linux to take advantage of
> >> it.
>
> bh> There isn't an easy way to change it right now, unless you want to give up
> bh> the sharing of clean pages, which is a big loss. One option will be to
> bh> take a swap backed inode (I'm using such beasts to replace the SysV shm
> bh> objects) and use it to 'cache' the executable - this would be easy enough
> bh> to accomplish, but could be a potentially heavy user of swap. It does
> bh> have the benefit of also caching normal file access... (say, NFS ;-)
>
> But the problem is when you are using Linux on embedded systems
> without any swap (disk) at all. The programs are stored in the FLASH
> RAM so the cost of reading a page from the executable is almost zero,
> but using a swap area is impossible (no, we don't have 20 Meg RAM for
> a RAM swap disk)

I think that nobody is proposing mandatory use of swap as cache. But
on some systems, using swap as cache is win (my system, NFS). It is
not win in non-networked non-broken systems, so you probably do not
have to worry.

Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu