Re: mmap() page swapping location?

From: Juan J. Quintela (quintela@fi.udc.es)
Date: Mon Jul 31 2000 - 20:22:42 EST


>>>>> "chris" == Chris Quinn <cq@htec.demon.co.uk> writes:

chris> Hello folks,
chris> I'm attempting to implement a database and in order to get a crash recovery scheme it's necessary to prevent modified mmap()'ed pages being flushed out to disk before the undo log is synced. One way to do this is via the mlock() call but it requires root privelege and is in any case overkill. What I thought would do the trick is to add a MAP_SWAP flag to mmap() to indicate that a dirty page should be swapped out not to the private file but to the swap device.
chris> I think try_to_swap_out() in mm/vmscan.c is the place to check vm_flag and act accordingly. I believe that dirty mmap()'ed pages are as likely to be considered for swapping as dirty pages of malloc()'ed data.
chris> This is good news if true, but is it?

s/MAP_SWAP/MAP_PRIVATE/ does just that ....
you need to have in account if you allow several processes reading the
database, blah, blah, blah .... Oh, and if you have a really _BIG
DATABASE_ you could want to play with MAP_NORESERVE (linux and some
others UNIX specific, not standard).

Later, Juan.

-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy

- 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 : Mon Jul 31 2000 - 21:00:35 EST