lkml.org 
[lkml]   [1998]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Swapping thoughts
On Thu, 21 May 1998, Nix wrote:

> > No you don't... Executables are mmap()ed and reside inside
> > the page cache.
>
> It seems passing strange that executables are treated that way
> but all other files are not.

They are. All mmap()ed files reside in the page cache...

> Why do we have separate code paths for open() & friends?[1] It
> seems that they could be implemented in terms of mmap(), too;

Not completely. For instance, you can't mmap() files larger
than 2GB, while you could open them, if we had a filesystem
supporting this function.
Furthermore, most files in /proc can't be mmap()ed (mmap()ing
/proc/kcore would be a nice case of recursion), the same
goes for most files in /dev and mmap()ing files also costs
some of the (scarce) address space.

> Is this a silly idea? It seems so obvious that I'm sure I'm
> missing something or you'd have done it already.

It's not really silly. You just overlooked the fact that
to some application address space is too scarce to mmap()
all the files they have open. Besides, we need the open()
path anyway, since we sometimes want to open sockets or
character devices.

Rik.
+-------------------------------------------+--------------------------+
| Linux: - LinuxHQ MM-patches page | Scouting webmaster |
| - kswapd ask-him & complain-to guy | Vries cubscout leader |
| http://www.phys.uu.nl/~riel/ | <H.H.vanRiel@phys.uu.nl> |
+-------------------------------------------+--------------------------+


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

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.115 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site