Messages in this thread | | | From | (Linus Torvalds) | Subject | Re: tmpfs and the VM (Was: Re: questions on page cache and buffers) | Date | 20 Aug 1997 05:54:55 GMT |
| |
In article <Pine.LNX.3.95.970819123004.95A-100000@nextd.demon.co.uk>, Mark Hemment <markhe@nextd.demon.co.uk> wrote: > > First, the page-cache needs to be modified to allow dirty, named pages >to exist without a VM mapping.
Why? I agree that the dirty page support is pretty broken right now (it really needs a finer-granularity dirty map), but we do want a VM mapping. The straightforward way to handle it is to just force a "swap inode" for all anonymous mappings and allocate it all from there.
Also note that we actually do have the reverse mapping information from physical pages to virtual pages, although it is non-obvious:
page_map -> inode inode -> vm_area_list
so to find the virtual copy of a physical page you just look up the inode, and then follow all mappings of that inode (it's not as costly as it sounds, really).
That also goes for shared swap inodes.
Note that the "swap inode" wouldn't be just _one_ inode, it would be one inode per process (or rather, per vm) plus one global one (the global one is needed for shared anonymous mappings which have global semantics unlike normal anonymous mappings).
I'm not saying the swap inode is trivial to actually implement, but I think it is the RightWay(tm) to implement this.
"Pages without VM mappings - just say no".
Linus
| |