Re: [PATCH] virtual mapping (swap) support for ramfs (for 2.5/2.6)

From: Matt Yourst (yourst@mit.edu)
Date: Sat Jun 03 2000 - 21:06:07 EDT

  • Next message: Alan Cox: "Re: %eax %ax 2.2.15"

    Rik van Riel wrote:
    >
    > On Sat, 3 Jun 2000, Matt Yourst wrote:
    >
    > > Here's my partially-working patch that adds "virtual mapping"
    > > support to ramfs. This is a *very* early version of it, since it
    >
    > It's also pretty complex.
    >
    That's exactly what I was thinking in some cases too (the comments in the code indicate this.) For instance, in virtual_map_readpage, I didn't know how to solve the problem of removing the hashed swap entry only *after* the page is physically in RAM. Right now it's read synchronously, but that's obviously bad performance-wise. An async swap page read would need to update the hash table and swap map as part of the I/O completion/unlocking itself, which would probably mean extra work elsewhere.

    >
    > Maybe it would be easier if try_to_swap_out would just
    > unmap the page and set a special flag in the page, and
    > then shrink_mmap() could push the page to disk.
    >
    I'll take a look at this and see if I can make my code more robust. It worked fairly well when I first tried it back in 2.3.33, but it broke easily with newer kernels and all the recent VM system changes (I was lucky I could get the patch I sent you working at all!)

    >
    > (proper write clustering for that will be implemented
    > in 2.5, possibly by me)
    >
    That's another issue that I didn't know how to handle - even though page writes are clustered by the mmap code, they may be scattered anywhere in the swap file with my approach (again, not good for performance unless higher-level code specially handles this case.)

    - Matt Yourst

    -------------------------------------------------------------
     Matt T. Yourst Massachusetts Institute of Technology
     yourst@mit.edu 617.225.7690
     513 French House - 476 Memorial Drive - Cambridge, MA 02136
    -------------------------------------------------------------

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Jun 03 2000 - 21:12:37 EDT